gnome-control-center/shell/window.ui
Felipe Borges 357e944336 window: Split the window decorations between the header bars
When application menus are not supported by the desktop environment
or are disabled, Gtk+ makes the menu available with a fallback. For
client-side decorations the fallback consists of adding a menu
button at the begining of the titlebar. Since g-c-c has a split
headerbar, we need to explicitly handle the decoration layout.

This commit forces the "menu" to belong to the left headerbar, and
leaves the other buttons to ble placed at the right headerbar.

The "show-close-button" property has to be set in order to present
any type of decoration buttons in the header bar.

https://bugzilla.gnome.org/show_bug.cgi?id=786692
2017-09-12 11:10:33 +02:00

204 lines
8.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="CcWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<property name="window_position">center</property>
<property name="default-width">980</property>
<property name="default-height">640</property>
<signal name="notify::window" handler="gdk_window_set_cb" object="CcWindow" swapped="no" />
<signal name="map-event" handler="window_map_event_cb" object="CcWindow" swapped="no" />
<child>
<object class="GtkBox" id="main_hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="sidebar_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkSearchBar" id="search_bar">
<property name="visible">True</property>
<property name="search_mode_enabled" bind-source="search_button" bind-property="active" bind-flags="sync-create|bidirectional" />
<property name="app_paintable">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">25</property>
<property name="max_width_chars">25</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
<signal name="activate" handler="search_entry_activate_cb" object="CcWindow" swapped="no" />
<signal name="notify::text" handler="update_list_title" object="CcWindow" swapped="yes" />
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="list_scrolled">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="width-request">200</property>
<property name="hscrollbar_policy">never</property>
<style>
<class name="view"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="transition_type">crossfade</property>
<style>
<class name="background"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkBox" id="header_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkHeaderBar" id="header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show-close-button">True</property>
<property name="title" translatable="yes">Settings</property>
<child>
<object class="GtkButton" id="previous_button">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<signal name="clicked" handler="previous_button_clicked_cb" object="CcWindow" swapped="no" />
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
</child>
<child>
<object class="GtkToggleButton" id="search_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-find-symbolic</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
</child>
<child>
<object class="GtkHeaderBar" id="panel_headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkBox" id="top_right_box">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkLockButton" id="lock_button">
<property name="can_focus">True</property>
<property name="no_show_all">True</property>
<style>
<class name="text-button" />
</style>
</object>
</child>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="GtkSizeGroup" id="header_sizegroup">
<property name="mode">vertical</property>
<widgets>
<widget name="lock_button"/>
<widget name="search_button"/>
<widget name="previous_button"/>
</widgets>
</object>
<!-- Synchronize left header and sidebar -->
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="header"/>
<widget name="sidebar_box"/>
</widgets>
</object>
</interface>