diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-03-16 09:50:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-03-16 14:02:44 +0000 |
commit | dffde8403e0bb81d7eb3b7853cece187e1d36c62 (patch) | |
tree | 29b557823aea3d221559bc74864c7b4e28ba2ea0 /vcl/source/app | |
parent | 85d23f8ce86a71c8d7d2cb34e8b790dcfc8df654 (diff) |
allow more than DrawingArea to report style updates
Change-Id: I791e4ad45daeeb77ca25e36ae6520168b2ece044
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148980
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f9a6cfc75dc2..61fa56dd3223 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -580,6 +580,25 @@ void SalInstanceWidget::connect_key_release(const Link<const KeyEvent&, bool>& r weld::Widget::connect_key_release(rLink); } +IMPL_LINK(SalInstanceWidget, SettingsChangedHdl, VclWindowEvent&, rEvent, void) +{ + if (rEvent.GetId() != VclEventId::WindowDataChanged) + return; + + DataChangedEvent* pData = static_cast<DataChangedEvent*>(rEvent.GetData()); + if (pData->GetType() == DataChangedEventType::SETTINGS) + m_aStyleUpdatedHdl.Call(*this); +} + +void SalInstanceWidget::connect_style_updated(const Link<Widget&, void>& rLink) +{ + if (m_aStyleUpdatedHdl.IsSet()) + m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl)); + weld::Widget::connect_style_updated(rLink); + if (m_aStyleUpdatedHdl.IsSet()) + m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl)); +} + bool SalInstanceWidget::get_extents_relative_to(const Widget& rRelative, int& x, int& y, int& width, int& height) const { @@ -633,6 +652,8 @@ void SalInstanceWidget::queue_resize() { m_xWidget->queue_resize(); } SalInstanceWidget::~SalInstanceWidget() { + if (m_aStyleUpdatedHdl.IsSet()) + m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl)); if (m_aMnemonicActivateHdl.IsSet()) m_xWidget->SetMnemonicActivateHdl(Link<vcl::Window&, bool>()); if (m_bMouseEventListener) @@ -6233,6 +6254,11 @@ void SalInstanceDrawingArea::connect_key_release(const Link<const KeyEvent&, boo weld::Widget::connect_key_release(rLink); } +void SalInstanceDrawingArea::connect_style_updated(const Link<Widget&, void>& rLink) +{ + weld::Widget::connect_style_updated(rLink); +} + void SalInstanceDrawingArea::set_cursor(PointerStyle ePointerStyle) { m_xDrawingArea->SetPointer(ePointerStyle); |