diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-18 21:17:01 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2024-05-19 20:33:05 +0200 |
commit | 07e6ed881032d1df3ec96c93f5e6c502e021eeb6 (patch) | |
tree | 83a2e8e117759bd39097c2793d770ae7a2f0379c /vcl | |
parent | b01d89eaf473870281f6ecbdeb12aa3fcd79f9bb (diff) |
Resolves: tdf#157453 support FM_PROP_LINECOUNT for combobox dropdow rows
Change-Id: I3d18ed505c2eea7305903f9a476c332db0148113
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167814
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/salvtables.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 16 |
3 files changed, 19 insertions, 1 deletions
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 4074e097a4f4..d6d3a90ce2e4 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -922,6 +922,8 @@ public: return 20 * (pDefault ? pDefault->GetDPIScaleFactor() : 1.0); } + void set_max_drop_down_rows(int nRows) override { m_xComboBox->SetDropDownLineCount(nRows); } + void CallHandleEventListener(VclWindowEvent& rEvent) { if (rEvent.GetId() == VclEventId::DropdownPreOpen diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index faf645fc7943..8dc0edf814fd 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6927,6 +6927,8 @@ public: virtual void set_mru_entries(const OUString&) override { assert(false && "not implemented"); } + virtual void set_max_drop_down_rows(int) override { assert(false && "not implemented"); } + virtual void set_item_menu(const OUString&, weld::Menu*) override { assert(false && "not implemented"); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index a899fc16c606..6a06947d4cd2 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -21034,6 +21034,11 @@ public: #endif } + virtual void set_max_drop_down_rows(int) override + { + SAL_WARN( "vcl.gtk", "set_max_drop_down_rows unimplemented"); + } + virtual ~GtkInstanceComboBox() override { // m_xCustomMenuButtonHelper.reset(); @@ -21114,6 +21119,7 @@ private: gint m_nPrePopupCursorPos; int m_nMRUCount; int m_nMaxMRUCount; + int m_nMaxDropdownRows; static gboolean idleAutoComplete(gpointer widget) { @@ -21236,7 +21242,7 @@ private: { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - int nMaxRows = rSettings.GetListBoxMaximumLineCount(); + int nMaxRows = m_nMaxDropdownRows == -1 ? rSettings.GetListBoxMaximumLineCount() : m_nMaxDropdownRows; bool bAddScrollWidth = false; int nRows = get_count_including_mru(); if (nMaxRows < nRows) @@ -22154,6 +22160,7 @@ public: , m_nPrePopupCursorPos(-1) , m_nMRUCount(0) , m_nMaxMRUCount(0) + , m_nMaxDropdownRows(-1) { int nActive = gtk_combo_box_get_active(m_pComboBox); @@ -22838,6 +22845,11 @@ public: return nWidth; } + virtual void set_max_drop_down_rows(int nMaxRows) override + { + m_nMaxDropdownRows = nMaxRows; + } + virtual ~GtkInstanceComboBox() override { m_xCustomMenuButtonHelper.reset(); @@ -23223,6 +23235,8 @@ public: return 0; } + virtual void set_max_drop_down_rows(int) override { assert(false && "not implemented"); } + virtual ~GtkInstanceEntryTreeView() override { if (m_nAutoCompleteIdleId) |