diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-29 14:52:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-29 20:59:08 +0100 |
commit | bdbc439ac6c6a0eb615d55dcaaf0722f3013b812 (patch) | |
tree | f8a729cf80c7a6da2f2fc9aa05bdd5a94fabac08 /sc | |
parent | 517e093d78012896b54628d6a3092162be3cedec (diff) |
tdf#49813 make autofilter popup at least the width of its column
Change-Id: Idbcf3cdb62fb2886c3b05da721e8d326e0187588
Reviewed-on: https://gerrit.libreoffice.org/81690
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/cctrl/checklistmenu.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/inc/checklistmenu.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 6a8a51a0328e..b9b5acca11c8 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -878,7 +878,7 @@ void ScCheckListMenuWindow::CancelButton::Click() ::CancelButton::Click(); } -ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) : +ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc, int nWidth) : ScMenuFloatingWindow(pParent, pDoc), maEdSearch(VclPtr<ScSearchEdit>::Create(this)), maChecks(VclPtr<ScCheckListBox>::Create(this)), @@ -893,7 +893,8 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p { float fScaleFactor = GetDPIScaleFactor(); - maWndSize = Size(200 * fScaleFactor, 330 * fScaleFactor); + nWidth = std::max<int>(nWidth, 200 * fScaleFactor); + maWndSize = Size(nWidth, 330 * fScaleFactor); maTabStops.AddTabStop( this ); maTabStops.AddTabStop( maEdSearch.get() ); diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index f62e8f6dc13c..2ff574a15252 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -335,7 +335,7 @@ public: Config(); }; - explicit ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc); + explicit ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc, int nWidth = -1); virtual ~ScCheckListMenuWindow() override; virtual void dispose() override; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 777a9ed220f1..8f5324a7cd00 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -629,7 +629,8 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) ScDocument* pDoc = pViewData->GetDocument(); mpAutoFilterPopup.disposeAndClear(); - mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc)); + int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(nCol, nTab), pViewData->GetPPTX()); + mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc, nColWidth)); // Avoid flicker when hovering over the menu items. if (!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus)) |