[Libreoffice-commits] core.git: sd/source sd/uiconfig
Pranam Lashkari (via logerrit)
logerrit at kemper.freedesktop.org
Sat May 2 21:22:40 UTC 2020
sd/source/ui/sidebar/SlideBackground.cxx | 34 +++++++++++++---------
sd/source/ui/sidebar/SlideBackground.hxx | 3 +
sd/uiconfig/simpress/ui/sidebarslidebackground.ui | 19 ++++++++++++
3 files changed, 42 insertions(+), 14 deletions(-)
New commits:
commit cbe86ee37018dc4bf04783ecf70fef2863e61ad7
Author: Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Thu Apr 23 19:29:10 2020 +0530
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat May 2 23:22:06 2020 +0200
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 at collabora.com>
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
@@ -193,6 +193,25 @@
<placeholder/>
</child>
</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>
More information about the Libreoffice-commits
mailing list