From a130f0f406e67cda098adc3086e937317f737583 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 24 May 2022 18:43:45 +0200 Subject: Implement weld::IconView::[gs]et_item_width Change-Id: I211e3c21b4e0148c4ff6fc9931838e37ccd0cc41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134897 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/inc/salvtables.hxx | 3 +++ vcl/source/app/salvtables.cxx | 3 +++ vcl/unx/gtk3/gtkinst.cxx | 10 ++++++++++ 3 files changed, 16 insertions(+) (limited to 'vcl') diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 7752b5243c11..45e9700ad2c8 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1761,6 +1761,9 @@ private: public: SalInstanceIconView(::IconView* pIconView, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + virtual int get_item_width() const override; + virtual void set_item_width(int width) override; + virtual void freeze() override; virtual void thaw() override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 4755c94e51cb..4432b4c5afe6 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5308,6 +5308,9 @@ SalInstanceIconView::SalInstanceIconView(::IconView* pIconView, SalInstanceBuild m_xIconView->SetPopupMenuHdl(LINK(this, SalInstanceIconView, CommandHdl)); } +int SalInstanceIconView::get_item_width() const { return m_xIconView->GetEntryWidth(); } +void SalInstanceIconView::set_item_width(int width) { m_xIconView->SetEntryWidth(width); } + void SalInstanceIconView::freeze() { bool bIsFirstFreeze = IsFirstFreeze(); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 1f61fc49db3d..0575aa8c3c7a 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -16252,6 +16252,16 @@ public: m_nIdCol = m_nTextCol + 1; } + virtual int get_item_width() const override + { + return gtk_icon_view_get_item_width(m_pIconView); + } + + virtual void set_item_width(int width) override + { + gtk_icon_view_set_item_width(m_pIconView, width); + } + virtual void insert(int pos, const OUString* pText, const OUString* pId, const OUString* pIconName, weld::TreeIter* pRet) override { disable_notify_events(); -- cgit v1.2.3