From 80109586e6cb6d3e2e0a53a9079c3125ec9b8368 Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Fri, 1 Nov 2019 20:33:09 +0300 Subject: tdf#126128 Reduce page properties dialog's height. Change-Id: Ie35c9cb4c9b134a94f3a125dd800936b7160950c Reviewed-on: https://gerrit.libreoffice.org/81910 Tested-by: Jenkins Reviewed-by: Andras Timar --- cui/source/tabpages/tpbitmap.cxx | 5 +- cui/source/tabpages/tpgradnt.cxx | 4 +- cui/source/tabpages/tphatch.cxx | 4 +- cui/source/tabpages/tppattern.cxx | 4 +- cui/uiconfig/ui/bitmaptabpage.ui | 157 ++++++++++++------------- cui/uiconfig/ui/gradientpage.ui | 221 ++++++++++++++++++++++-------------- cui/uiconfig/ui/hatchpage.ui | 3 +- cui/uiconfig/ui/patterntabpage.ui | 147 ++++++++++++------------ include/sfx2/dialoghelper.hxx | 2 + sfx2/source/dialog/dialoghelper.cxx | 5 + 10 files changed, 307 insertions(+), 245 deletions(-) diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 7d1f17be236b..946da898ad08 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -119,8 +119,11 @@ SvxBitmapTabPage::SvxBitmapTabPage(weld::Container* pPage, weld::DialogControlle m_xBtnImport->hide(); // Calculate size of display boxes + + Size aBitmapLBSize = getPagePropertiesOptimalSize(m_xBitmapLB->GetDrawingArea()->get_ref_device()); + m_xBitmapLB->set_size_request(aBitmapLBSize.Width(), aBitmapLBSize.Height()); + Size aSize = getDrawPreviewOptimalSize(m_aCtlBitmapPreview.GetDrawingArea()->get_ref_device()); - m_xBitmapLB->set_size_request(aSize.Width(), aSize.Height()); m_xCtlBitmapPreview->set_size_request(aSize.Width(), aSize.Height()); SfxItemPool* pPool = m_rXFSet.GetPool(); diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index f8affa0f044e..ac7832e2b4d2 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -68,8 +68,10 @@ SvxGradientTabPage::SvxGradientTabPage(weld::Container* pPage, weld::DialogContr , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "previewctl", m_aCtlPreview)) , m_xGradientLBWin(new weld::CustomWeld(*m_xBuilder, "gradientpresetlist", *m_xGradientLB)) { - Size aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device()); + Size aSize = getPagePropertiesOptimalSize(m_xGradientLB->GetDrawingArea()->get_ref_device()); m_xGradientLB->set_size_request(aSize.Width(), aSize.Height()); + + aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device()); m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height()); // this page needs ExchangeSupport SetExchangeSupport(); diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index aeb5d9c85fcb..76de2709df89 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -63,8 +63,10 @@ SvxHatchTabPage::SvxHatchTabPage(weld::Container* pPage, weld::DialogController* , m_xHatchLBWin(new weld::CustomWeld(*m_xBuilder, "hatchpresetlist", *m_xHatchLB)) , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "previewctl", m_aCtlPreview)) { - Size aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device()); + Size aSize = getPagePropertiesOptimalSize(m_xHatchLB->GetDrawingArea()->get_ref_device()); m_xHatchLBWin->set_size_request(aSize.Width(), aSize.Height()); + + aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device()); m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height()); // this page needs ExchangeSupport diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index 713a7c3a6628..aa3b561a2c7d 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -87,8 +87,10 @@ SvxPatternTabPage::SvxPatternTabPage(weld::Container* pPage, weld::DialogControl , m_xPatternLBWin(new weld::CustomWeld(*m_xBuilder, "patternpresetlist", *m_xPatternLB)) { // size of the bitmap display - Size aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device()); + Size aSize = getPagePropertiesOptimalSize(m_xPatternLB->GetDrawingArea()->get_ref_device()); m_xPatternLB->set_size_request(aSize.Width(), aSize.Height()); + + aSize = getDrawPreviewOptimalSize(m_aCtlPreview.GetDrawingArea()->get_ref_device()); m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height()); m_xBitmapCtl.reset(new SvxBitmapCtl); diff --git a/cui/uiconfig/ui/bitmaptabpage.ui b/cui/uiconfig/ui/bitmaptabpage.ui index dae24f1ea007..52503da401fc 100644 --- a/cui/uiconfig/ui/bitmaptabpage.ui +++ b/cui/uiconfig/ui/bitmaptabpage.ui @@ -36,6 +36,7 @@ True True + start True never never @@ -332,6 +333,78 @@ 2 + + + + + + + True + False + Options + + + + + + + + True + True + 1 + + + + + True + False + end + start + 0 + none + + + True + False + 6 + 12 + + + True + False + vertical + 4 + + + True + False + never + never + in + + + True + False + + + True + False + + + Example + + + + + + + + + True + True + 0 + + True @@ -431,7 +504,7 @@ True True - 3 + 1 @@ -482,6 +555,7 @@ True True True + 0 adjustment1 @@ -501,78 +575,7 @@ False True - 4 - - - - - - - - - True - False - Options - - - - - - - - True - True - 1 - - - - - True - False - end - start - 0 - none - - - True - False - 6 - 12 - - - True - False - vertical - - - True - False - never - never - in - - - True - False - - - True - False - - - Example - - - - - - - - - True - True - 0 + 2 @@ -600,14 +603,14 @@ - - + + - - + + diff --git a/cui/uiconfig/ui/gradientpage.ui b/cui/uiconfig/ui/gradientpage.ui index 11970d4856c8..f07f89486549 100644 --- a/cui/uiconfig/ui/gradientpage.ui +++ b/cui/uiconfig/ui/gradientpage.ui @@ -78,6 +78,7 @@ True True + start True never never @@ -435,92 +436,6 @@ 2 - - - True - True - percentadjustment2 - - - 1 - 7 - - - - - True - True - False - 0 - True - - - - - - - 0 - 7 - - - - - True - False - _To Color: - True - colortolb - 0 - - - 0 - 6 - 2 - - - - - True - True - False - 0 - True - - - - - - - 0 - 5 - - - - - True - True - percentadjustment1 - - - 1 - 5 - - - - - True - False - _From Color: - True - colorfromlb - 0 - - - 0 - 4 - 2 - - True @@ -578,7 +493,6 @@ False From color percentage True - colorfrommtr False @@ -592,7 +506,6 @@ False To color percentage True - colortomtr False @@ -678,6 +591,138 @@ 0 + + + True + False + 82 + vertical + 4 + + + True + False + 2 + 6 + + + True + False + _From Color: + True + colorfromlb + 0 + + + 0 + 0 + + + + + True + True + False + 0 + True + + + + + + 0 + 1 + + + + + True + True + 0 + From color + percentadjustment1 + + + 1 + 1 + + + + + + + + False + True + 0 + + + + + True + False + 2 + 6 + + + True + False + _To Color: + True + colortolb + 0 + + + 0 + 0 + + + + + True + True + False + 0 + True + + + + + + 0 + 1 + + + + + True + True + 0 + To color + percentadjustment2 + + + 1 + 1 + + + + + + + + False + True + 1 + + + + + False + True + 1 + + diff --git a/cui/uiconfig/ui/hatchpage.ui b/cui/uiconfig/ui/hatchpage.ui index 0195a5c1e8c9..2111ac913ea4 100644 --- a/cui/uiconfig/ui/hatchpage.ui +++ b/cui/uiconfig/ui/hatchpage.ui @@ -45,6 +45,7 @@ True True + start True never never @@ -292,7 +293,6 @@ center 0 True - @@ -331,7 +331,6 @@ center 0 True - diff --git a/cui/uiconfig/ui/patterntabpage.ui b/cui/uiconfig/ui/patterntabpage.ui index 0c054341703f..8662d05c6356 100644 --- a/cui/uiconfig/ui/patterntabpage.ui +++ b/cui/uiconfig/ui/patterntabpage.ui @@ -31,6 +31,7 @@ True True + start True never never @@ -179,9 +180,9 @@ True True + GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK start start - GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK Pattern Editor @@ -205,6 +206,77 @@ 0 + + + + + + + True + False + Options + + + + + + + + True + True + 1 + + + + + True + False + end + start + 0 + none + + + True + False + 6 + 12 + + + True + False + vertical + + + True + False + never + never + in + + + True + False + + + True + False + + + Example + + + + + + + + + False + False + 0 + + True @@ -233,7 +305,6 @@ False 0 True - @@ -279,7 +350,6 @@ False 0 True - @@ -301,77 +371,6 @@ - - - True - False - Options - - - - - - - - True - True - 1 - - - - - True - False - end - start - 0 - none - - - True - False - 6 - 12 - - - True - False - vertical - - - True - False - never - never - in - - - True - False - - - True - False - - - Example - - - - - - - - - False - False - 0 - - - - - - True diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx index c18545a75c49..2ccc9284c332 100644 --- a/include/sfx2/dialoghelper.hxx +++ b/include/sfx2/dialoghelper.hxx @@ -32,6 +32,8 @@ Size SFX2_DLLPUBLIC getPreviewStripSize(const OutputDevice& rReference); Size SFX2_DLLPUBLIC getPreviewOptionsSize(const OutputDevice& rReference); +Size SFX2_DLLPUBLIC getPagePropertiesOptimalSize(const OutputDevice& rReference); + OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper); OUString SFX2_DLLPUBLIC formatTime(const DateTime& rDateTime, const LocaleDataWrapper& rWrapper); diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx index 4c7d63e23e0e..4a810a386f1c 100644 --- a/sfx2/source/dialog/dialoghelper.cxx +++ b/sfx2/source/dialog/dialoghelper.cxx @@ -35,6 +35,11 @@ Size getPreviewOptionsSize(const OutputDevice& rReference) return rReference.LogicToPixel(Size(70 , 27), MapMode(MapUnit::MapAppFont)); } +Size getPagePropertiesOptimalSize(const OutputDevice& rReference) +{ + return rReference.LogicToPixel(Size(88, 120), MapMode(MapUnit::MapAppFont)); +} + OUString getWidestTime(const LocaleDataWrapper& rWrapper) { Date aDate(22, 12, 2000); -- cgit