- Inherit AdwApplicationWindow - GtkHeaderBar → AdwHeaderBar - Simplify the widget tree structure [1] - Drop custom key handler, use bindings instead [1] It used to have a big messy chain of leaflets, headers, and whatnot. Now it's simplified as: AdwLeaflet + ---------------- + --------------------------------- + | AdwHeaderBar | AdwHeaderBar | + ---------------- + --------------------------------- + | GtkSearchBar | | + ---------------- + | | | | | | | | | | | | GtkStack | | CcPanelList | | | | | | | | | | | | | | + ---------------- + --------------------------------- +
207 lines
9.5 KiB
XML
207 lines
9.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<interface>
|
|
<requires lib="gtk+" version="3.20"/>
|
|
<template class="CcWindow" parent="AdwApplicationWindow">
|
|
<property name="default-width">980</property>
|
|
<property name="default-height">640</property>
|
|
<child>
|
|
<object class="AdwLeaflet" id="main_leaflet">
|
|
<property name="transition-type">slide</property>
|
|
<signal name="notify::folded" handler="on_main_leaflet_folded_changed_cb" object="CcWindow" swapped="yes" />
|
|
|
|
<child>
|
|
<object class="GtkBox" id="sidebar_box">
|
|
<property name="hexpand">False</property>
|
|
<property name="orientation">vertical</property>
|
|
|
|
<child>
|
|
<object class="AdwHeaderBar" id="header">
|
|
<property name="show-start-title-buttons">True</property>
|
|
<property name="show-end-title-buttons" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
|
|
<property name="title-widget">
|
|
<object class="AdwWindowTitle" id="sidebar_title_widget">
|
|
<property name="title" translatable="yes">Settings</property>
|
|
</object>
|
|
</property>
|
|
<child>
|
|
<object class="GtkButton" id="previous_button">
|
|
<property name="receives_default">True</property>
|
|
<property name="icon_name">go-previous-symbolic</property>
|
|
<signal name="clicked" handler="previous_button_clicked_cb" object="CcWindow" swapped="yes" />
|
|
<accessibility>
|
|
<property name="label" translatable="yes">All Settings</property>
|
|
</accessibility>
|
|
<style>
|
|
<class name="image-button"/>
|
|
</style>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkToggleButton" id="search_button">
|
|
<property name="visible">True</property>
|
|
<property name="receives_default">True</property>
|
|
<property name="icon_name">edit-find-symbolic</property>
|
|
<accessibility>
|
|
<property name="label" translatable="yes">Search</property>
|
|
</accessibility>
|
|
<style>
|
|
<class name="image-button"/>
|
|
</style>
|
|
</object>
|
|
</child>
|
|
<child type="end">
|
|
<object class="GtkMenuButton">
|
|
<property name="visible">True</property>
|
|
<property name="icon-name">open-menu-symbolic</property>
|
|
<property name="menu-model">primary_menu</property>
|
|
<property name="primary">True</property>
|
|
<accessibility>
|
|
<property name="label" translatable="yes">Primary Menu</property>
|
|
</accessibility>
|
|
<style>
|
|
<class name="image-button"/>
|
|
</style>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
|
|
<child>
|
|
<object class="GtkSearchBar" id="search_bar">
|
|
<property name="search_mode_enabled" bind-source="search_button" bind-property="active" bind-flags="sync-create|bidirectional" />
|
|
<child>
|
|
<object class="GtkSearchEntry" id="search_entry">
|
|
<property name="width_chars">25</property>
|
|
<property name="max_width_chars">25</property>
|
|
<signal name="activate" handler="search_entry_activate_cb" object="CcWindow" swapped="yes" />
|
|
<signal name="notify::text" handler="update_list_title" object="CcWindow" swapped="yes" />
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkScrolledWindow">
|
|
<property name="vexpand">True</property>
|
|
<property name="width-request">200</property>
|
|
<property name="hscrollbar_policy">never</property>
|
|
<style>
|
|
<class name="view"/>
|
|
</style>
|
|
<child>
|
|
<object class="CcPanelList" id="panel_list">
|
|
<property name="search-mode" bind-source="search_bar" bind-property="search-mode-enabled" bind-flags="bidirectional" />
|
|
<property name="search-query" bind-source="search_entry" bind-property="text" bind-flags="default" />
|
|
<signal name="show-panel" handler="show_panel_cb" object="CcWindow" swapped="yes" />
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
|
|
<child>
|
|
<object class="GtkSeparator" id="panel_separator">
|
|
<property name="visible">True</property>
|
|
<property name="orientation">vertical</property>
|
|
<style>
|
|
<class name="sidebar"/>
|
|
</style>
|
|
</object>
|
|
</child>
|
|
|
|
<child>
|
|
<object class="GtkBox" id="panel_box">
|
|
<property name="orientation">vertical</property>
|
|
<property name="hexpand">True</property>
|
|
<property name="vexpand">True</property>
|
|
<child>
|
|
<object class="AdwHeaderBar" id="panel_headerbar">
|
|
<property name="visible">True</property>
|
|
<property name="hexpand">True</property>
|
|
<property name="show-start-title-buttons" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
|
|
<property name="show-end-title-buttons">True</property>
|
|
<property name="title-widget">
|
|
<object class="AdwWindowTitle" id="panel_title_widget" />
|
|
</property>
|
|
<child>
|
|
<object class="GtkRevealer" id="back_revealer">
|
|
<property name="transition-type">crossfade</property>
|
|
<property name="transition-duration" bind-source="main_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
|
|
<property name="visible" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
|
|
<property name="reveal-child" bind-source="main_leaflet" bind-property="folded" bind-flags="sync-create"/>
|
|
<child>
|
|
<object class="GtkButton" id="back">
|
|
<property name="visible">True</property>
|
|
<property name="receives_default">False</property>
|
|
<property name="valign">center</property>
|
|
<property name="icon-name">go-previous-symbolic</property>
|
|
<signal name="clicked" handler="back_button_clicked_cb" object="CcWindow" swapped="yes" />
|
|
<style>
|
|
<class name="image-button"/>
|
|
</style>
|
|
<accessibility>
|
|
<property name="label" translatable="yes">Back</property>
|
|
</accessibility>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkBox" id="top_left_box" />
|
|
</child>
|
|
<child type="end">
|
|
<object class="GtkBox" id="top_right_box" />
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkStack" id="stack">
|
|
<property name="hexpand">True</property>
|
|
<property name="vexpand">True</property>
|
|
<property name="transition_type">crossfade</property>
|
|
<property name="width_request">360</property>
|
|
<style>
|
|
<class name="background"/>
|
|
</style>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</template>
|
|
|
|
<object class="GtkSizeGroup" id="header_sizegroup">
|
|
<property name="mode">vertical</property>
|
|
<widgets>
|
|
<widget name="search_button"/>
|
|
<widget name="previous_button"/>
|
|
</widgets>
|
|
</object>
|
|
|
|
<!-- Warning dialog for development builds -->
|
|
<object class="GtkMessageDialog" id="development_warning_dialog">
|
|
<property name="message-type">warning</property>
|
|
<property name="transient-for">CcWindow</property>
|
|
<property name="resizable">false</property>
|
|
<property name="modal">true</property>
|
|
<property name="buttons">ok</property>
|
|
<property name="text" translatable="yes">Warning: Development Version</property>
|
|
<property name="secondary-text" translatable="yes">This version of Settings should only be used for development purposes. You may experience incorrect system behavior, data loss, and other unexpected issues. </property>
|
|
<signal name="response" handler="on_development_warning_dialog_responded_cb" object="CcWindow" swapped="yes" />
|
|
</object>
|
|
|
|
<menu id="primary_menu">
|
|
<section>
|
|
<item>
|
|
<attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
|
|
<attribute name="action">win.show-help-overlay</attribute>
|
|
</item>
|
|
<item>
|
|
<attribute name="label" translatable="yes">Help</attribute>
|
|
<attribute name="action">app.help</attribute>
|
|
</item>
|
|
</section>
|
|
</menu>
|
|
|
|
</interface>
|