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

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Fri Nov 24 13:51:42 UTC 2017


 svx/source/dialog/ClassificationDialog.cxx   |    8 ++++++
 svx/source/dialog/ClassificationEditView.cxx |    2 -
 svx/uiconfig/ui/classificationdialog.ui      |   32 +++++++++++++--------------
 3 files changed, 25 insertions(+), 17 deletions(-)

New commits:
commit 12d12fa8fae469b01db68d23fa6ee2eb89a86d45
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Nov 24 17:39:38 2017 +0900

    TSCP: fix oversizing of ListBox-es by defining max lines & chars
    
    Change-Id: I47e8018c5f2c0ea890b5a11ac7cc03fafb7d1eed
    Reviewed-on: https://gerrit.libreoffice.org/45205
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index a7b1469100f5..aa7f2e778be9 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -194,16 +194,19 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer
 
     m_pIntellectualPropertyPartAddButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked));
 
+    m_pClassificationListBox->setMaxWidthChars(20);
     m_pClassificationListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectClassificationHdl));
     for (const OUString& rName : maHelper.GetBACNames())
         m_pClassificationListBox->InsertEntry(rName);
 
+    m_pInternationalClassificationListBox->setMaxWidthChars(20);
     m_pInternationalClassificationListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectClassificationHdl));
     for (const OUString& rName : maInternationalHelper.GetBACNames())
         m_pInternationalClassificationListBox->InsertEntry(rName);
 
     if (!maHelper.GetMarkings().empty())
     {
+        m_pMarkingListBox->setMaxWidthChars(20);
         m_pMarkingListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectMarkingHdl));
         m_pMarkingListBox->SetLoseFocusHdl(LINK(this, ClassificationDialog, LoseFocusMarkingHdl));
 
@@ -216,14 +219,19 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer
         m_pMarkingLabel->Show(false);
     }
 
+    m_pIntellectualPropertyPartNumberListBox->SetDropDownLineCount(5);
+    m_pIntellectualPropertyPartNumberListBox->setMaxWidthChars(20);
     m_pIntellectualPropertyPartNumberListBox->SetDoubleClickHdl(LINK(this, ClassificationDialog, SelectIPPartNumbersHdl));
     for (const OUString& rName : maHelper.GetIntellectualPropertyPartNumbers())
         m_pIntellectualPropertyPartNumberListBox->InsertEntry(rName);
 
+    m_pIntellectualPropertyPartListBox->SetDropDownLineCount(5);
+    m_pIntellectualPropertyPartNumberListBox->setMaxWidthChars(20);
     m_pIntellectualPropertyPartListBox->SetDoubleClickHdl(LINK(this, ClassificationDialog, SelectIPPartHdl));
     for (const OUString& rName : maHelper.GetIntellectualPropertyParts())
         m_pIntellectualPropertyPartListBox->InsertEntry(rName);
 
+    m_pRecentlyUsedListBox->setMaxWidthChars(5);
     m_pRecentlyUsedListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectRecentlyUsedHdl));
 
     bool bExpand = officecfg::Office::Common::Classification::IntellectualPropertySectionExpanded::get();
diff --git a/svx/source/dialog/ClassificationEditView.cxx b/svx/source/dialog/ClassificationEditView.cxx
index 76b778303bc2..75eec4aa8329 100644
--- a/svx/source/dialog/ClassificationEditView.cxx
+++ b/svx/source/dialog/ClassificationEditView.cxx
@@ -49,7 +49,7 @@ ClassificationEditView::ClassificationEditView(vcl::Window* pParent, WinBits nBi
     Color aBgColor = rStyleSettings.GetWindowColor();
 
     float fScaleFactor = GetDPIScaleFactor();
-    set_width_request(600 * fScaleFactor);
+    set_width_request(500 * fScaleFactor);
     set_height_request(100 * fScaleFactor);
 
     SetMapMode(MapMode(MapUnit::MapTwip));
diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui
index 911363016f25..bfc3d78d8f7e 100644
--- a/svx/uiconfig/ui/classificationdialog.ui
+++ b/svx/uiconfig/ui/classificationdialog.ui
@@ -291,6 +291,7 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">0</property>
+                        <property name="width">2</property>
                       </packing>
                     </child>
                     <child>
@@ -305,26 +306,13 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkTreeView" id="intellectualPropertyPartLB">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="hexpand">True</property>
-                        <property name="vexpand">True</property>
-                        <child internal-child="selection">
-                          <object class="GtkTreeSelection"/>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkButton" id="intellectualPropertyPartAddButton">
                         <property name="label" translatable="yes" context="classificationdialog|intellectualPropertyPartAddButton">Add</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="halign">center</property>
+                        <property name="valign">center</property>
                       </object>
                       <packing>
                         <property name="left_attach">2</property>
@@ -359,7 +347,19 @@
                       </packing>
                     </child>
                     <child>
-                      <placeholder/>
+                      <object class="GtkTreeView" id="intellectualPropertyPartLB">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <child internal-child="selection">
+                          <object class="GtkTreeSelection"/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                      </packing>
                     </child>
                     <child>
                       <placeholder/>


More information about the Libreoffice-commits mailing list