这是什么 GTK 小部件?

Jo-*_*tad 7 gtk application-development

最近,我看到下面的小部件出现在 GTK 应用程序中。我在格莱德找不到它。它是什么?

在此处输入图片说明

Dav*_*lla 11

查看图腾代码,它看起来像是GtkToolbar 中的一组GktButton,应用了 CSS 样式并使用符号图标(它们也由 Ubuntu 中的主题安装)而不是库存图标。

这是 Python 中的示例

# Assuming builder is an initialized Gtk.Builder object and toolbar exists
# in the .ui definition file and is populated with Gtk.ToolButtons

context = builder.get_object('toolbar').get_style_context()
context.add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
Run Code Online (Sandbox Code Playgroud)

有关 GTK+ 3 CSS 样式的更多信息: