summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2017-03-07 12:19:02 +0100
committerSzymon Kłos <eszkadev@gmail.com>2017-03-07 12:06:57 +0000
commitb57d06315175c7aabfde6c02ee4f122cfbef10e8 (patch)
tree0985288df73f3a034d9941e05a6f4b6d9f96f373 /sfx2
parentc4fc38a86f77d87263e78fae04a31f19c21fb017 (diff)
Notebookbar: don't show unnecessary separators in the popup
Change-Id: I89d11e2859676696e7bc0751ae9e71e5ae939a79 Reviewed-on: https://gerrit.libreoffice.org/34945 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <eszkadev@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/notebookbar/DropdownBox.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/sfx2/source/notebookbar/DropdownBox.cxx b/sfx2/source/notebookbar/DropdownBox.cxx
index 705103af7f06..97d63a716ef9 100644
--- a/sfx2/source/notebookbar/DropdownBox.cxx
+++ b/sfx2/source/notebookbar/DropdownBox.cxx
@@ -57,6 +57,7 @@ public:
virtual void PopupModeEnd() override
{
+ hideSeparators(false);
for (int i = 0; i < m_pBox->GetChildCount(); i++)
{
m_pBox->GetChild(i)->Hide();
@@ -65,6 +66,37 @@ public:
FloatingWindow::PopupModeEnd();
}
+ void hideSeparators(bool bHide = true)
+ {
+ // separator on the beginning
+ Window* pWindow = m_pBox->GetChild(0);
+ while (pWindow && pWindow->GetType() == WindowType::CONTAINER)
+ {
+ pWindow = pWindow->GetChild(0);
+ }
+ if (pWindow && pWindow->GetType() == WindowType::FIXEDLINE)
+ {
+ if (bHide)
+ pWindow->Hide();
+ else
+ pWindow->Show();
+ }
+
+ // separator on the end
+ pWindow = m_pBox->GetChild(m_pBox->GetChildCount() - 1);
+ while (pWindow && pWindow->GetType() == WindowType::CONTAINER)
+ {
+ pWindow = pWindow->GetChild(pWindow->GetChildCount() - 1);
+ }
+ if (pWindow && pWindow->GetType() == WindowType::FIXEDLINE)
+ {
+ if (bHide)
+ pWindow->Hide();
+ else
+ pWindow->Show();
+ }
+ }
+
void dispose() override
{
m_pBox.disposeAndClear();
@@ -150,6 +182,8 @@ IMPL_LINK(DropdownBox, PBClickHdl, Button*, /*pButton*/, void)
}
}
+ m_pPopup->hideSeparators(true);
+
m_pPopup->getBox()->set_height_request(GetSizePixel().Height());
long x = GetPosPixel().getX();