diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-11-17 13:14:59 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-11-17 13:40:37 +0100 |
commit | 7ff24c6619648164a8642642217709f1a29c89c1 (patch) | |
tree | d0a02e47df8eb50879adc2a32bbeb97320825267 | |
parent | 3b501c4478e5da43ea092c51e5afdb66790d028a (diff) |
TSCP: change bold button to a toolbox button as bold icon
Change-Id: Ic1a96544c4b3a1f8d631535c8a5f43b6680539f4
Reviewed-on: https://gerrit.libreoffice.org/44860
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | include/svx/ClassificationDialog.hxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/ClassificationDialog.cxx | 25 | ||||
-rw-r--r-- | svx/uiconfig/ui/classificationdialog.ui | 27 |
3 files changed, 41 insertions, 15 deletions
diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx index 0033126f5e93..64a5206924e4 100644 --- a/include/svx/ClassificationDialog.hxx +++ b/include/svx/ClassificationDialog.hxx @@ -15,6 +15,7 @@ #include <vcl/dialog.hxx> #include <vcl/button.hxx> #include <vcl/lstbox.hxx> +#include <vcl/toolbox.hxx> #include <vcl/fixed.hxx> #include <vcl/edit.hxx> #include <vcl/layout.hxx> @@ -40,7 +41,7 @@ private: VclPtr<PushButton> m_pOkButton; VclPtr<ClassificationEditView> m_pEditWindow; VclPtr<PushButton> m_pSignButton; - VclPtr<PushButton> m_pBoldButton; + VclPtr<ToolBox> m_pToolBox; VclPtr<ListBox> m_pClassificationListBox; VclPtr<ListBox> m_pRecentlyUsedListBox; VclPtr<ListBox> m_pInternationalClassificationListBox; @@ -61,6 +62,7 @@ private: sal_Int32 m_nCurrentSelectedCategory; DECL_LINK(ButtonClicked, Button*, void); + DECL_LINK(SelectToolboxHdl, ToolBox*, void); DECL_LINK(SelectClassificationHdl, ListBox&, void); DECL_LINK(SelectMarkingHdl, ListBox&, void); DECL_LINK(SelectIPPartNumbersHdl, ListBox&, void); diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx index f7c3edf068cf..fa4ef3e03084 100644 --- a/svx/source/dialog/ClassificationDialog.cxx +++ b/svx/source/dialog/ClassificationDialog.cxx @@ -174,7 +174,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer get(m_pOkButton, "ok"); get(m_pEditWindow, "classificationEditWindow"); get(m_pSignButton, "signButton"); - get(m_pBoldButton, "boldButton"); + get(m_pToolBox, "toolbox"); get(m_pRecentlyUsedListBox, "recentlyUsedCB"); get(m_pClassificationListBox, "classificationCB"); get(m_pInternationalClassificationListBox, "internationalClassificationCB"); @@ -190,7 +190,8 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer m_pSignButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked)); m_pSignButton->Show(m_bPerParagraph); - m_pBoldButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked)); + m_pToolBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectToolboxHdl)); + m_pIntellectualPropertyPartAddButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked)); m_pClassificationListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectClassificationHdl)); @@ -244,7 +245,7 @@ void ClassificationDialog::dispose() m_pOkButton.clear(); m_pEditWindow.clear(); m_pSignButton.clear(); - m_pBoldButton.clear(); + m_pToolBox.clear(); m_pRecentlyUsedListBox.clear(); m_pClassificationListBox.clear(); m_pInternationalClassificationListBox.clear(); @@ -685,11 +686,7 @@ IMPL_LINK(ClassificationDialog, SelectIPPartHdl, ListBox&, rBox, void) IMPL_LINK(ClassificationDialog, ButtonClicked, Button*, pButton, void) { - if (pButton == m_pBoldButton) - { - m_pEditWindow->InvertSelectionWeight(); - } - else if (pButton == m_pSignButton) + if (pButton == m_pSignButton) { m_aParagraphSignHandler(); } @@ -700,6 +697,18 @@ IMPL_LINK(ClassificationDialog, ButtonClicked, Button*, pButton, void) } } + +IMPL_LINK_NOARG(ClassificationDialog, SelectToolboxHdl, ToolBox*, void) +{ + sal_uInt16 nId = m_pToolBox->GetCurItemId(); + const OUString sCommand = m_pToolBox->GetItemCommand(nId); + if (sCommand == "bold") + { + m_pEditWindow->InvertSelectionWeight(); + } +} + + IMPL_LINK_NOARG(ClassificationDialog, EditWindowModifiedHdl, LinkParamNone*, void) { toggleWidgetsDependingOnCategory(); diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui index ab4f449726a3..a4469611c80c 100644 --- a/svx/uiconfig/ui/classificationdialog.ui +++ b/svx/uiconfig/ui/classificationdialog.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.20.1 --> <interface domain="sfx"> - <requires lib="gtk+" version="3.0"/> + <requires lib="gtk+" version="3.4"/> <requires lib="LibreOffice" version="1.0"/> <object class="GtkDialog" id="AdvancedDocumentClassificationDialog"> <property name="can_focus">False</property> @@ -213,11 +213,23 @@ <property name="spacing">6</property> <property name="homogeneous">True</property> <child> - <object class="GtkButton" id="boldButton"> - <property name="label" translatable="yes" context="classificationdialog|boldButton">Bold</property> + <object class="GtkToolbar" id="toolbox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkToolButton" id="bold"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="action_name">bold</property> + <property name="label" translatable="yes" context="classificationdialog|boldButton">Bold</property> + <property name="use_underline">True</property> + <property name="icon_name">cmd/lc_bold.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> @@ -370,5 +382,8 @@ <action-widget response="0">cancel</action-widget> <action-widget response="0">help</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> |