[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 1 12:06:03 UTC 2019


 sc/source/ui/condformat/condformatdlgentry.cxx |   28 +++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

New commits:
commit aace6e60b555740260a85ec90036b85d61ee4f06
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Sep 30 16:27:24 2019 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Tue Oct 1 14:05:13 2019 +0200

    Resolves: tdf#126781 force comboboxes to take 1/3 avail space
    
    and not their natural size as this dialog is fixed width so we need
    to make do. This brings the right border of the entry inside the
    scrolled window area as expected
    
    Change-Id: I60d6078436cbfacbbfda55838e4b0584da4bab1e
    Reviewed-on: https://gerrit.libreoffice.org/79915
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 6b2e29192761..7d914952bbdb 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -39,6 +39,10 @@
 
 #include <set>
 
+// set the widget width to something to override their auto-width calc and
+// force them to take a 1/3 of the available space
+#define CommonWidgetWidth 10
+
 ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos)
     : mpParent(pParent)
     , mxBuilder(Application::CreateBuilder(pParent->GetContainer(), "modules/scalc/ui/conditionalentry.ui"))
@@ -52,6 +56,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, co
     , mpDoc(pDoc)
     , maPos(rPos)
 {
+    mxLbType->set_size_request(CommonWidgetWidth, -1);
     mxLbType->connect_changed(LINK(pParent, ScCondFormatList, TypeListHdl));
     mxGrid->connect_mouse_press(LINK(this, ScCondFrmtEntry, EntrySelectHdl));
     maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
@@ -152,6 +157,8 @@ ScConditionFrmtEntry::ScConditionFrmtEntry(ScCondFormatList* pParent, ScDocument
     , mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
     , mbIsInStyleCreate(false)
 {
+    mxLbCondType->set_size_request(CommonWidgetWidth, -1);
+    mxLbType->set_size_request(CommonWidgetWidth, -1);
     mxWdPreview->set_size_request(-1, mxLbStyle->get_preferred_size().Height());
 
     mxLbType->set_active(1);
@@ -491,6 +498,7 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry(ScCondFormatList* pParent, ScDocument* pD
     , mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
     , mxEdFormula(new formula::RefEdit(mxBuilder->weld_entry("formula")))
 {
+    mxLbType->set_size_request(CommonWidgetWidth, -1);
     mxWdPreview->set_size_request(-1, mxLbStyle->get_preferred_size().Height());
 
     Init(pDialogParent);
@@ -720,6 +728,10 @@ ScColorScale2FrmtEntry::ScColorScale2FrmtEntry(ScCondFormatList* pParent, ScDocu
     , mxFtMin(mxBuilder->weld_label("Label_minimum"))
     , mxFtMax(mxBuilder->weld_label("Label_maximum"))
 {
+    mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
+    mxLbEntryTypeMin->set_size_request(CommonWidgetWidth, -1);
+    mxLbEntryTypeMax->set_size_request(CommonWidgetWidth, -1);
+
     mxFtMin->show();
     mxFtMax->show();
 
@@ -852,6 +864,10 @@ ScColorScale3FrmtEntry::ScColorScale3FrmtEntry(ScCondFormatList* pParent, ScDocu
     , mxFtMin(mxBuilder->weld_label("Label_minimum"))
     , mxFtMax(mxBuilder->weld_label("Label_maximum"))
 {
+    mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
+    mxLbEntryTypeMin->set_size_request(CommonWidgetWidth, -1);
+    mxLbEntryTypeMiddle->set_size_request(CommonWidgetWidth, -1);
+    mxLbEntryTypeMax->set_size_request(CommonWidgetWidth, -1);
     mxFtMin->show();
     mxFtMax->show();
 
@@ -1054,6 +1070,10 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry(ScCondFormatList* pParent, ScDocument* pD
     , mxFtMin(mxBuilder->weld_label("Label_minimum"))
     , mxFtMax(mxBuilder->weld_label("Label_maximum"))
 {
+    mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
+    mxLbDataBarMinType->set_size_request(CommonWidgetWidth, -1);
+    mxLbDataBarMaxType->set_size_request(CommonWidgetWidth, -1);
+
     // "min" selector doesn't need "max" entry, and vice versa
     removeType(*mxLbDataBarMinType, COLORSCALE_MAX);
     removeType(*mxLbDataBarMaxType, COLORSCALE_MIN);
@@ -1188,6 +1208,9 @@ ScDateFrmtEntry::ScDateFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, co
     , mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
     , mbIsInStyleCreate(false)
 {
+    mxLbDateEntry->set_size_request(CommonWidgetWidth, -1);
+    mxLbStyle->set_size_request(CommonWidgetWidth, -1);
+
     mxWdPreview->set_size_request(mxLbStyle->get_preferred_size().Height(), -1);
 
     Init();
@@ -1307,6 +1330,8 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
     , mxLbEntryType(mxBuilder->weld_combo_box("listbox"))
     , mpContainer(pParent)
 {
+    mxLbEntryType->set_size_request(CommonWidgetWidth, -1);
+
     mxImgIcon->set_from_icon_name(ScIconSetFormat::getIconName(eType, i));
     if(pEntry)
     {
@@ -1392,6 +1417,9 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(ScCondFormatList* pParent, ScDocument* pD
     , mxLbIconSetType(mxBuilder->weld_combo_box("iconsettype"))
     , mxIconParent(mxBuilder->weld_container("iconparent"))
 {
+    mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
+    mxLbIconSetType->set_size_request(CommonWidgetWidth, -1);
+
     Init();
     mxLbColorFormat->connect_changed(LINK(pParent, ScCondFormatList, ColFormatTypeHdl));
 


More information about the Libreoffice-commits mailing list