diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2020-04-23 19:29:10 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-05-02 23:22:06 +0200 |
commit | cbe86ee37018dc4bf04783ecf70fef2863e61ad7 (patch) | |
tree | 8ed9461660292e2fb6033cdb3ce110c1bd948a6f | |
parent | 550f564d1689036a247d73d25a2d903b26ad06fa (diff) |
Added separate color picker for slide background gradient
Change-Id: I27b60244f011cb482affa5f47cde170daf3fc309
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92889
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 34 | ||||
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.hxx | 3 | ||||
-rw-r--r-- | sd/uiconfig/simpress/ui/sidebarslidebackground.ui | 19 |
3 files changed, 42 insertions, 14 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 45da884abdae..cb3a5ffdc3f9 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -102,7 +102,8 @@ SlideBackground::SlideBackground( mxFillStyle(m_xBuilder->weld_combo_box("fillstyle")), mxFillLB(new ColorListBox(m_xBuilder->weld_menu_button("fillattr"), GetFrameWeld())), mxFillAttr(m_xBuilder->weld_combo_box("fillattr1")), - mxFillGrad(new ColorListBox(m_xBuilder->weld_menu_button("fillattr2"), GetFrameWeld())), + mxFillGrad1(new ColorListBox(m_xBuilder->weld_menu_button("fillattr2"), GetFrameWeld())), + mxFillGrad2(new ColorListBox(m_xBuilder->weld_menu_button("fillattr3"), GetFrameWeld())), mxInsertImage(m_xBuilder->weld_button("button2")), mxDspMasterBackground(m_xBuilder->weld_check_button("displaymasterbackground")), mxDspMasterObjects(m_xBuilder->weld_check_button("displaymasterobjects")), @@ -240,7 +241,8 @@ void SlideBackground::Initialize() mxFillStyle->connect_changed(LINK(this, SlideBackground, FillStyleModifyHdl)); mxFillLB->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl)); - mxFillGrad->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl)); + mxFillGrad1->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl)); + mxFillGrad2->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl)); mxFillAttr->connect_changed(LINK(this, SlideBackground, FillBackgroundHdl)); ViewShell* pMainViewShell = mrBase.GetMainViewShell().get(); @@ -378,13 +380,15 @@ void SlideBackground::Update() { mxFillLB->hide(); mxFillAttr->hide(); - mxFillGrad->hide(); + mxFillGrad1->hide(); + mxFillGrad2->hide(); } break; case SOLID: { mxFillAttr->hide(); - mxFillGrad->hide(); + mxFillGrad1->hide(); + mxFillGrad2->hide(); mxFillLB->show(); const Color aColor = GetColorSetOrDefault(); mxFillLB->SelectEntry(aColor); @@ -392,15 +396,16 @@ void SlideBackground::Update() break; case GRADIENT: { - mxFillLB->show(); + mxFillLB->hide(); mxFillAttr->hide(); - mxFillGrad->show(); + mxFillGrad1->show(); + mxFillGrad2->show(); const XGradient xGradient = GetGradientSetOrDefault(); const Color aStartColor = xGradient.GetStartColor(); - mxFillLB->SelectEntry(aStartColor); + mxFillGrad1->SelectEntry(aStartColor); const Color aEndColor = xGradient.GetEndColor(); - mxFillGrad->SelectEntry(aEndColor); + mxFillGrad2->SelectEntry(aEndColor); } break; @@ -410,7 +415,8 @@ void SlideBackground::Update() mxFillAttr->show(); mxFillAttr->clear(); SvxFillAttrBox::Fill(*mxFillAttr, pSh->GetItem(SID_HATCH_LIST)->GetHatchList()); - mxFillGrad->hide(); + mxFillGrad1->hide(); + mxFillGrad2->hide(); const OUString aHatchName = GetHatchingSetOrDefault(); mxFillAttr->set_active_text( aHatchName ); @@ -423,7 +429,8 @@ void SlideBackground::Update() mxFillLB->hide(); mxFillAttr->show(); mxFillAttr->clear(); - mxFillGrad->hide(); + mxFillGrad1->hide(); + mxFillGrad2->hide(); OUString aName; if(nPos == BITMAP) { @@ -684,7 +691,8 @@ void SlideBackground::dispose() mxMasterSlide.reset(); mxBackgroundLabel.reset(); mxFillAttr.reset(); - mxFillGrad.reset(); + mxFillGrad1.reset(); + mxFillGrad2.reset(); mxFillStyle.reset(); mxFillLB.reset(); mxInsertImage.reset(); @@ -1097,8 +1105,8 @@ IMPL_LINK_NOARG(SlideBackground, FillColorHdl, ColorListBox&, void) case drawing::FillStyle_GRADIENT: { XGradient aGradient; - aGradient.SetStartColor(mxFillLB->GetSelectEntryColor()); - aGradient.SetEndColor(mxFillGrad->GetSelectEntryColor()); + aGradient.SetStartColor(mxFillGrad1->GetSelectEntryColor()); + aGradient.SetEndColor(mxFillGrad2->GetSelectEntryColor()); // the name doesn't really matter, it'll be converted to unique one eventually, // but it has to be non-empty diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index 92d426a40367..1b368c043849 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -86,7 +86,8 @@ private: std::unique_ptr<weld::ComboBox> mxFillStyle; std::unique_ptr<ColorListBox> mxFillLB; std::unique_ptr<weld::ComboBox> mxFillAttr; - std::unique_ptr<ColorListBox> mxFillGrad; + std::unique_ptr<ColorListBox> mxFillGrad1; + std::unique_ptr<ColorListBox> mxFillGrad2; std::unique_ptr<weld::Button> mxInsertImage; std::unique_ptr<weld::CheckButton> mxDspMasterBackground; std::unique_ptr<weld::CheckButton> mxDspMasterObjects; diff --git a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui index 21828850d462..644c443fb966 100644 --- a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui +++ b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui @@ -195,6 +195,25 @@ </object> <packing> <property name="left_attach">1</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkMenuButton" id="fillattr3"> + <property name="width_request">150</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="draw_indicator">True</property> + <property name="label" translatable="no"></property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">1</property> <property name="top_attach">5</property> </packing> </child> |