删除 HeaderBar gtk3 vala

Remove HeaderBar gtk3 vala

我有这样的疑问,可以去掉'HeaderBar'吗?我想使用 WebKit 并制作自己的控制器。 也许可以通过 CssProvider 做到这一点?

Screen

解决方案 - window.set_decorated(false);

您要 'remove' 不是 'HeaderBar',而是 window 装饰。 Gtk.HeaderBar its a different thing. Window decoration is dependable of the window manager as stated in the documentation:

By default, windows are decorated with a title bar, resize controls, etc.

Some window managers allow GTK+ to disable these decorations, creating a borderless window. If you set the decorated property to false using this function, GTK+ will do its best to convince the window manager not to decorate the window. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling show.

On Windows, this function always works, since there’s no window manager policy involved.

尽管您使用了正确的方法来禁用 window 修饰 (Gtk.Window set_decorated(bool)),但仍需要进行这些说明。