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/79872 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -41,6 +41,10 @@
|
|||||||
|
|
||||||
#include <set>
|
#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)
|
ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos)
|
||||||
: mpParent(pParent)
|
: mpParent(pParent)
|
||||||
, mxBuilder(Application::CreateBuilder(pParent->GetContainer(), (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView())?OUString("modules/scalc/ui/conditionalentrymobile.ui"):OUString("modules/scalc/ui/conditionalentry.ui"))))
|
, mxBuilder(Application::CreateBuilder(pParent->GetContainer(), (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView())?OUString("modules/scalc/ui/conditionalentrymobile.ui"):OUString("modules/scalc/ui/conditionalentry.ui"))))
|
||||||
@@ -54,6 +58,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, co
|
|||||||
, mpDoc(pDoc)
|
, mpDoc(pDoc)
|
||||||
, maPos(rPos)
|
, maPos(rPos)
|
||||||
{
|
{
|
||||||
|
mxLbType->set_size_request(CommonWidgetWidth, -1);
|
||||||
mxLbType->connect_changed(LINK(pParent, ScCondFormatList, TypeListHdl));
|
mxLbType->connect_changed(LINK(pParent, ScCondFormatList, TypeListHdl));
|
||||||
mxGrid->connect_mouse_press(LINK(this, ScCondFrmtEntry, EntrySelectHdl));
|
mxGrid->connect_mouse_press(LINK(this, ScCondFrmtEntry, EntrySelectHdl));
|
||||||
maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
|
maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
|
||||||
@@ -154,6 +159,8 @@ ScConditionFrmtEntry::ScConditionFrmtEntry(ScCondFormatList* pParent, ScDocument
|
|||||||
, mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
|
, mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
|
||||||
, mbIsInStyleCreate(false)
|
, mbIsInStyleCreate(false)
|
||||||
{
|
{
|
||||||
|
mxLbCondType->set_size_request(CommonWidgetWidth, -1);
|
||||||
|
mxLbType->set_size_request(CommonWidgetWidth, -1);
|
||||||
mxWdPreview->set_size_request(-1, mxLbStyle->get_preferred_size().Height());
|
mxWdPreview->set_size_request(-1, mxLbStyle->get_preferred_size().Height());
|
||||||
|
|
||||||
mxLbType->set_active(1);
|
mxLbType->set_active(1);
|
||||||
@@ -493,6 +500,7 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry(ScCondFormatList* pParent, ScDocument* pD
|
|||||||
, mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
|
, mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
|
||||||
, mxEdFormula(new formula::RefEdit(mxBuilder->weld_entry("formula")))
|
, mxEdFormula(new formula::RefEdit(mxBuilder->weld_entry("formula")))
|
||||||
{
|
{
|
||||||
|
mxLbType->set_size_request(CommonWidgetWidth, -1);
|
||||||
mxWdPreview->set_size_request(-1, mxLbStyle->get_preferred_size().Height());
|
mxWdPreview->set_size_request(-1, mxLbStyle->get_preferred_size().Height());
|
||||||
|
|
||||||
Init(pDialogParent);
|
Init(pDialogParent);
|
||||||
@@ -722,6 +730,10 @@ ScColorScale2FrmtEntry::ScColorScale2FrmtEntry(ScCondFormatList* pParent, ScDocu
|
|||||||
, mxFtMin(mxBuilder->weld_label("Label_minimum"))
|
, mxFtMin(mxBuilder->weld_label("Label_minimum"))
|
||||||
, mxFtMax(mxBuilder->weld_label("Label_maximum"))
|
, 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();
|
mxFtMin->show();
|
||||||
mxFtMax->show();
|
mxFtMax->show();
|
||||||
|
|
||||||
@@ -854,6 +866,10 @@ ScColorScale3FrmtEntry::ScColorScale3FrmtEntry(ScCondFormatList* pParent, ScDocu
|
|||||||
, mxFtMin(mxBuilder->weld_label("Label_minimum"))
|
, mxFtMin(mxBuilder->weld_label("Label_minimum"))
|
||||||
, mxFtMax(mxBuilder->weld_label("Label_maximum"))
|
, 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();
|
mxFtMin->show();
|
||||||
mxFtMax->show();
|
mxFtMax->show();
|
||||||
|
|
||||||
@@ -1056,6 +1072,10 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry(ScCondFormatList* pParent, ScDocument* pD
|
|||||||
, mxFtMin(mxBuilder->weld_label("Label_minimum"))
|
, mxFtMin(mxBuilder->weld_label("Label_minimum"))
|
||||||
, mxFtMax(mxBuilder->weld_label("Label_maximum"))
|
, 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
|
// "min" selector doesn't need "max" entry, and vice versa
|
||||||
removeType(*mxLbDataBarMinType, COLORSCALE_MAX);
|
removeType(*mxLbDataBarMinType, COLORSCALE_MAX);
|
||||||
removeType(*mxLbDataBarMaxType, COLORSCALE_MIN);
|
removeType(*mxLbDataBarMaxType, COLORSCALE_MIN);
|
||||||
@@ -1190,6 +1210,9 @@ ScDateFrmtEntry::ScDateFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, co
|
|||||||
, mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
|
, mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
|
||||||
, mbIsInStyleCreate(false)
|
, mbIsInStyleCreate(false)
|
||||||
{
|
{
|
||||||
|
mxLbDateEntry->set_size_request(CommonWidgetWidth, -1);
|
||||||
|
mxLbStyle->set_size_request(CommonWidgetWidth, -1);
|
||||||
|
|
||||||
mxWdPreview->set_size_request(mxLbStyle->get_preferred_size().Height(), -1);
|
mxWdPreview->set_size_request(mxLbStyle->get_preferred_size().Height(), -1);
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
@@ -1309,6 +1332,8 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
|
|||||||
, mxLbEntryType(mxBuilder->weld_combo_box("listbox"))
|
, mxLbEntryType(mxBuilder->weld_combo_box("listbox"))
|
||||||
, mpContainer(pParent)
|
, mpContainer(pParent)
|
||||||
{
|
{
|
||||||
|
mxLbEntryType->set_size_request(CommonWidgetWidth, -1);
|
||||||
|
|
||||||
mxImgIcon->set_from_icon_name(ScIconSetFormat::getIconName(eType, i));
|
mxImgIcon->set_from_icon_name(ScIconSetFormat::getIconName(eType, i));
|
||||||
if(pEntry)
|
if(pEntry)
|
||||||
{
|
{
|
||||||
@@ -1394,6 +1419,9 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(ScCondFormatList* pParent, ScDocument* pD
|
|||||||
, mxLbIconSetType(mxBuilder->weld_combo_box("iconsettype"))
|
, mxLbIconSetType(mxBuilder->weld_combo_box("iconsettype"))
|
||||||
, mxIconParent(mxBuilder->weld_container("iconparent"))
|
, mxIconParent(mxBuilder->weld_container("iconparent"))
|
||||||
{
|
{
|
||||||
|
mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
|
||||||
|
mxLbIconSetType->set_size_request(CommonWidgetWidth, -1);
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
mxLbColorFormat->connect_changed(LINK(pParent, ScCondFormatList, ColFormatTypeHdl));
|
mxLbColorFormat->connect_changed(LINK(pParent, ScCondFormatList, ColFormatTypeHdl));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user