summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-27 16:49:46 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-11-28 18:43:18 +0100
commit2eefc29b53b01dc07eb62aeb42cd56f178370d1d (patch)
treeb3e66c969355e44b46cf67723c3088c06303c99e
parentf2b7b0efba1ffc22b987563a5df339282018bc7a (diff)
Resolves: tdf#144410 show submenu indicator for color filtering options
includes.. 1) Related: tdf#144410 we don't want a gap in a multicol spanning separator we would need another column to show a drop down indicator, and we don't want the separators to have a visible gap in that case Change-Id: Ib45b4cda41a09b631f3ea4d4427a8073a9e243d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125900 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2) gtk[3|4] move the indicator to the edge Change-Id: Ib92e8f1e35e6465b52a69f3a8513068668dc6953 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125951 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx9
-rw-r--r--sc/source/ui/inc/checklistmenu.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx6
-rw-r--r--sc/uiconfig/scalc/ui/filterdropdown.ui1
-rw-r--r--vcl/source/treelist/treelistbox.cxx5
5 files changed, 15 insertions, 8 deletions
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 7e4f1b9fbfdc..6eca1fbbdf94 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -124,7 +124,7 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, SelectHdl, weld::TreeView&, void)
setSelectedMenuItem(nSelectedMenu, true);
}
-void ScCheckListMenuControl::addMenuItem(const OUString& rText, Action* pAction)
+void ScCheckListMenuControl::addMenuItem(const OUString& rText, Action* pAction, bool bIndicateSubMenu)
{
MenuItemData aItem;
aItem.mbEnabled = true;
@@ -134,7 +134,12 @@ void ScCheckListMenuControl::addMenuItem(const OUString& rText, Action* pAction)
mxMenu->show();
mxMenu->append_text(rText);
if (mbCanHaveSubMenu)
- mxMenu->set_image(mxMenu->n_children() - 1, css::uno::Reference<css::graphic::XGraphic>(), 1);
+ {
+ if (bIndicateSubMenu)
+ mxMenu->set_image(mxMenu->n_children() - 1, *mxDropDown, 1);
+ else
+ mxMenu->set_image(mxMenu->n_children() - 1, css::uno::Reference<css::graphic::XGraphic>(), 1);
+ }
}
void ScCheckListMenuControl::addSeparator()
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 427f29c3f7d3..1043fe771d6a 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -124,7 +124,7 @@ public:
bool bCanHaveSubMenu, bool bTreeMode, int nWidth);
~ScCheckListMenuControl();
- void addMenuItem(const OUString& rText, Action* pAction);
+ void addMenuItem(const OUString& rText, Action* pAction, bool bIndicateSubMenu = false);
void addSeparator();
ScCheckListMenuWindow* addSubMenuItem(const OUString& rText, bool bEnabled);
void resizeToFitMenuItems();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 05d75755aecb..71b994c75d76 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -602,7 +602,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
pNotifier = SfxViewShell::Current();
int nColWidth = ScViewData::ToPixel(rDoc.GetColWidth(nCol, nTab), mrViewData.GetPPTX());
- mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, &rDoc, false,
+ mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, &rDoc, true,
aFilterEntries.mbHasDates, nColWidth,
nullptr, pNotifier));
ScCheckListMenuControl& rControl = mpAutoFilterPopup->get_widget();
@@ -746,9 +746,9 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
ScResId(SCSTR_FILTER_NOTEMPTY), new AutoFilterAction(this, AutoFilterMode::NonEmpty));
rControl.addSeparator();
rControl.addMenuItem(
- ScResId(SCSTR_FILTER_TEXT_COLOR), new AutoFilterAction(this, AutoFilterMode::TextColor));
+ ScResId(SCSTR_FILTER_TEXT_COLOR), new AutoFilterAction(this, AutoFilterMode::TextColor), true);
rControl.addMenuItem(
- ScResId(SCSTR_FILTER_BACKGROUND_COLOR), new AutoFilterAction(this, AutoFilterMode::BackgroundColor));
+ ScResId(SCSTR_FILTER_BACKGROUND_COLOR), new AutoFilterAction(this, AutoFilterMode::BackgroundColor), true);
rControl.addSeparator();
rControl.addMenuItem(
ScResId(SCSTR_STDFILTER), new AutoFilterAction(this, AutoFilterMode::Custom));
diff --git a/sc/uiconfig/scalc/ui/filterdropdown.ui b/sc/uiconfig/scalc/ui/filterdropdown.ui
index fccc56e8b5b3..6ad9f0ae6797 100644
--- a/sc/uiconfig/scalc/ui/filterdropdown.ui
+++ b/sc/uiconfig/scalc/ui/filterdropdown.ui
@@ -87,6 +87,7 @@
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="expand">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index f2357b890fe2..197980774442 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -2606,6 +2606,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, tools::Long nLine, vcl:
Size aRectSize(0, nTempEntryHeight);
SvViewDataEntry* pViewDataEntry = GetViewDataEntry( &rEntry );
+ const bool bSeparator(rEntry.GetFlags() & SvTLEntryFlags::IS_SEPARATOR);
const size_t nTabCount = aTabs.size();
const size_t nItemCount = rEntry.ItemCount();
@@ -2738,8 +2739,8 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, tools::Long nLine, vcl:
rItem.Paint(aEntryPos, *this, rRenderContext, pViewDataEntry, rEntry);
- // division line between tabs
- if (pNextTab && rItem.GetType() == SvLBoxItemType::String &&
+ // division line between tabs (but not if this is a separator line)
+ if (!bSeparator && pNextTab && rItem.GetType() == SvLBoxItemType::String &&
// not at the right edge of the window!
aRect.Right() < nMaxRight)
{