[Libreoffice-commits] core.git: include/svx svx/source svx/uiconfig

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Fri Nov 17 12:41:02 UTC 2017


 include/svx/ClassificationDialog.hxx       |    4 +++-
 svx/source/dialog/ClassificationDialog.cxx |   25 +++++++++++++++++--------
 svx/uiconfig/ui/classificationdialog.ui    |   27 +++++++++++++++++++++------
 3 files changed, 41 insertions(+), 15 deletions(-)

New commits:
commit 7ff24c6619648164a8642642217709f1a29c89c1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Nov 17 13:14:59 2017 +0900

    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 at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

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>


More information about the Libreoffice-commits mailing list