diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-05-21 13:58:52 +0200 |
---|---|---|
committer | Yousuf Philips <philipz85@hotmail.com> | 2015-06-01 17:13:23 +0000 |
commit | 0e2ef262bea4cbc7cb04cfcd1d47f2a9d6092398 (patch) | |
tree | 01e2685c4b968e5be536f493ddf5d24df09d3a58 /svx | |
parent | c1b9d61bacaf676d69a0f49a79fb086535f79a48 (diff) |
tdf#88276: Add background colour toolbar and sidebar buttons
but they do nothing yet, follow-up commit(s) add real functionality
to them
Change-Id: Ieac5d0326b284069b8da1b39f94bdb5a8c84b6dd
Reviewed-on: https://gerrit.libreoffice.org/15841
Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/text/TextPropertyPanel.cxx | 19 | ||||
-rw-r--r-- | svx/source/sidebar/text/TextPropertyPanel.hxx | 1 | ||||
-rw-r--r-- | svx/uiconfig/ui/sidebartextpanel.ui | 33 |
3 files changed, 44 insertions, 9 deletions
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index 5e4f48a4b293..01661366285f 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -97,8 +97,9 @@ TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Ref get(mpToolBoxFont, "fonteffects"); get(mpToolBoxIncDec, "fontadjust"); get(mpToolBoxSpacing, "spacingbar"); - get(mpToolBoxFontColorSw, "colorbar"); - get(mpToolBoxFontColor, "colorsingle"); + get(mpToolBoxFontColorSw, "colorbar_writer"); + get(mpToolBoxFontColor, "colorbar_others"); + get(mpToolBoxBackgroundColor, "colorbar_background"); //toolbox SetupToolboxItems(); @@ -144,15 +145,20 @@ void TextPropertyPanel::HandleContextChange ( mpToolBoxIncDec->Show(maContext.GetApplication_DI() != sfx2::sidebar::EnumContext::Application_Calc); bool bWriterText = false; + bool bDrawText = false; + bool bNeedTextSpacing = false; + switch (maContext.GetCombinedContext_DI()) { case CombinedEnumContext(Application_Calc, Context_Cell): case CombinedEnumContext(Application_Calc, Context_Pivot): - mpToolBoxSpacing->Disable(); + // bNeedTextSpacing = false; break; case CombinedEnumContext(Application_Calc, Context_EditCell): case CombinedEnumContext(Application_Calc, Context_DrawText): + bNeedTextSpacing = true; + case CombinedEnumContext(Application_WriterVariants, Context_DrawText): case CombinedEnumContext(Application_WriterVariants, Context_Annotation): case CombinedEnumContext(Application_DrawImpress, Context_DrawText): @@ -162,12 +168,13 @@ void TextPropertyPanel::HandleContextChange ( case CombinedEnumContext(Application_DrawImpress, Context_Draw): case CombinedEnumContext(Application_DrawImpress, Context_TextObject): case CombinedEnumContext(Application_DrawImpress, Context_Graphic): - mpToolBoxSpacing->Enable(); + bNeedTextSpacing = true; + bDrawText = true; break; case CombinedEnumContext(Application_WriterVariants, Context_Text): case CombinedEnumContext(Application_WriterVariants, Context_Table): - mpToolBoxSpacing->Enable(); + bNeedTextSpacing = true; bWriterText = true; break; @@ -175,8 +182,10 @@ void TextPropertyPanel::HandleContextChange ( break; } + mpToolBoxSpacing->Enable(bNeedTextSpacing); mpToolBoxFontColor->Show(!bWriterText); mpToolBoxFontColorSw->Show(bWriterText); + mpToolBoxBackgroundColor->Show(bDrawText); } void TextPropertyPanel::DataChanged (const DataChangedEvent& /*rEvent*/) diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx index 7ea19a69d754..30e494b164ca 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.hxx +++ b/svx/source/sidebar/text/TextPropertyPanel.hxx @@ -87,6 +87,7 @@ private: VclPtr<ToolBox> mpToolBoxSpacing; VclPtr<ToolBox> mpToolBoxFontColorSw; VclPtr<ToolBox> mpToolBoxFontColor; + VclPtr<ToolBox> mpToolBoxBackgroundColor; //control items ::sfx2::sidebar::ControllerItem maFontSizeControl; diff --git a/svx/uiconfig/ui/sidebartextpanel.ui b/svx/uiconfig/ui/sidebartextpanel.ui index 91930e9b0df5..eb962bad41d5 100644 --- a/svx/uiconfig/ui/sidebartextpanel.ui +++ b/svx/uiconfig/ui/sidebartextpanel.ui @@ -215,7 +215,7 @@ <property name="can_focus">False</property> <property name="spacing">12</property> <child> - <object class="sfxlo-SidebarToolBox" id="colorbar"> + <object class="sfxlo-SidebarToolBox" id="colorbar_writer"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="show_arrow">False</property> @@ -255,7 +255,7 @@ </packing> </child> <child> - <object class="sfxlo-SidebarToolBox" id="colorsingle"> + <object class="sfxlo-SidebarToolBox" id="colorbar_others"> <property name="visible">True</property> <property name="can_focus">False</property> <child> @@ -280,6 +280,31 @@ </packing> </child> <child> + <object class="sfxlo-SidebarToolBox" id="colorbar_background"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkMenuToolButton" id="backgroundcolor"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="is_important">True</property> + <property name="action_name">.uno:CharBackColor</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> <object class="sfxlo-SidebarToolBox" id="position"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -315,7 +340,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="pack_type">end</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child> @@ -341,7 +366,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="pack_type">end</property> - <property name="position">3</property> + <property name="position">4</property> </packing> </child> </object> |