summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-03-10 16:20:07 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-04-06 11:58:20 +0200
commitac1aefd5174258d9bcb41465ce566ed1a0819f3d (patch)
tree4032ae853c330f9360e58f7401294e37da517d43 /vcl/unx
parent88cca903a88902e51c24853f1d10aeae39b39cdd (diff)
Extend ToolBarManager to build weld::Toolbar
- used for SubToolBarController eg. framework shape toolbar popup present in the sidebar fontwork panel - add separate implementation for vcl and weld based ToolBarManager - provide basic functionality for weld based (just inserting standard items with icons and controllers) - not implemented: addons items merging etc. Change-Id: I8e460f34abd512d70e95a1d484d728b7d809ce9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113387 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 377ac47461de..10df2ee6e317 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -8783,10 +8783,21 @@ public:
return aFind->second->get_active();
}
+ virtual void insert_item(int pos, const OUString& rId) override
+ {
+ OString sId = OUStringToOString(rId, RTL_TEXTENCODING_UTF8);
+ GtkToolItem* pItem = gtk_tool_button_new(nullptr, sId.getStr());
+ gtk_buildable_set_name(GTK_BUILDABLE(pItem), sId.getStr());
+ gtk_toolbar_insert(m_pToolbar, pItem, pos);
+ gtk_widget_show(GTK_WIDGET(pItem));
+ add_to_map(pItem, nullptr);
+ }
+
virtual void insert_separator(int pos, const OUString& rId) override
{
+ OString sId = OUStringToOString(rId, RTL_TEXTENCODING_UTF8);
GtkToolItem* pItem = gtk_separator_tool_item_new();
- gtk_buildable_set_name(GTK_BUILDABLE(pItem), OUStringToOString(rId, RTL_TEXTENCODING_UTF8).getStr());
+ gtk_buildable_set_name(GTK_BUILDABLE(pItem), sId.getStr());
gtk_toolbar_insert(m_pToolbar, pItem, pos);
gtk_widget_show(GTK_WIDGET(pItem));
}
@@ -16715,6 +16726,7 @@ public:
if (m_pClosedEvent)
Application::RemoveUserEvent(m_pClosedEvent);
g_signal_handler_disconnect(m_pPopover, m_nSignalId);
+ signal_closed();
}
};