diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-02 14:51:35 -0400 |
---|---|---|
committer | Radek Doulík <rodo@novell.com> | 2012-11-07 11:50:24 +0000 |
commit | 9d90fc7593445d0cd2333a827840e1c993e7a9b5 (patch) | |
tree | 3a3549408317bdda1aef703be4539d1d0851baf1 /sc | |
parent | cd5b4dcf8ccf0c3a3fac286f0e42d73ef8dbe6a5 (diff) |
Minor enhancements on the autofilter popup window.
1) Launch pop-up right-aligned in case the cell is wider than the popup.
Launching it always left-aligned will look weird especially when the column
is very wide.
2) Allow type-ahead search when launching the autofilter via keyboard. This
is achieved by making two small changes to the popup; first, the focus is set
on the check list box upon launching, and second, the type-ahead search is
enabled on the check list box control.
Change-Id: I8a33a52afc6005b4a7428d5f7046eff986da80d2
Reviewed-on: https://gerrit.libreoffice.org/997
Reviewed-by: Radek Doulík <rodo@novell.com>
Tested-by: Radek Doulík <rodo@novell.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/cctrl/checklistmenu.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index ca85f70e9944..f3b07b20c07b 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -915,6 +915,9 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(Window* pParent, ScDocument* pDoc) maTabStopCtrls.push_back(&maBtnUnselectSingle); maTabStopCtrls.push_back(&maBtnOk); maTabStopCtrls.push_back(&maBtnCancel); + + // Enable type-ahead search in the check list box. + maChecks.SetStyle(maChecks.GetStyle() | WB_QUICK_SEARCH); } ScCheckListMenuWindow::~ScCheckListMenuWindow() @@ -1355,7 +1358,18 @@ void ScCheckListMenuWindow::launch(const Rectangle& rRect) // We need to have at least one member selected. maBtnOk.Enable(maChecks.GetCheckedEntryCount() != 0); - StartPopupMode(rRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS)); + Rectangle aRect(rRect); + if (maWndSize.Width() < aRect.GetWidth()) + { + // Target rectangle (i.e. cell width) is wider than the window. + // Simulate right-aligned launch by modifying the target rectangle + // size. + long nDiff = aRect.GetWidth() - maWndSize.Width(); + aRect.Left() += nDiff; + } + + StartPopupMode(aRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS)); + cycleFocus(); // Set initial focus to the check list box. } void ScCheckListMenuWindow::close(bool bOK) |