cc-window.ui 15.9 KB
Newer Older
1 2 3 4 5 6
<?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>
7 8
    <property name="default-width">980</property>
    <property name="default-height">640</property>
9 10
    <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" />
11
    <signal name="key-press-event" handler="window_key_press_event_cb" object="CcWindow" swapped="no" after="yes" />
12
    <child>
Adrien Plazas's avatar
Adrien Plazas committed
13
      <object class="HdyLeaflet" id="main_leaflet">
14 15
        <property name="visible">True</property>
        <property name="can_focus">False</property>
Adrien Plazas's avatar
Adrien Plazas committed
16 17
        <property name="mode-transition-type">slide</property>
        <property name="child-transition-type">slide</property>
18
        <child>
19
          <object class="GtkBox" id="sidebar_box">
20 21 22 23 24 25 26
            <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>
27
                <property name="search_mode_enabled" bind-source="search_button" bind-property="active" bind-flags="sync-create|bidirectional" />
28 29 30 31 32 33 34
                <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>
35
                    <property name="input_hints">no-emoji</property>
36 37 38 39
                    <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>
40
                    <signal name="activate" handler="search_entry_activate_cb" object="CcWindow" swapped="no" />
41
                    <signal name="notify::text" handler="update_list_title" object="CcWindow" swapped="yes" />
42 43 44 45 46 47 48 49 50 51
                  </object>
                </child>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
52
              <object class="GtkScrolledWindow" id="list_scrolled">
53 54 55
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="vexpand">True</property>
56
                <property name="width-request">200</property>
57 58 59 60
                <property name="hscrollbar_policy">never</property>
                <style>
                  <class name="view"/>
                </style>
61 62 63 64 65 66 67 68 69
                <child>
                  <object class="CcPanelList" id="panel_list">
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <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="no" />
                  </object>
                </child>
70 71 72 73 74 75 76 77 78
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">1</property>
              </packing>
            </child>
          </object>
          <packing>
Adrien Plazas's avatar
Adrien Plazas committed
79
            <property name="name">sidebar</property>
80 81 82
          </packing>
        </child>
        <child>
83
          <object class="GtkSeparator" id="panel_separator">
84 85 86
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="orientation">vertical</property>
87 88 89
            <style>
              <class name="sidebar"/>
            </style>
90 91 92 93 94 95 96 97 98
          </object>
        </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>
99
            <property name="width_request">300</property>
100 101 102 103 104
            <style>
              <class name="background"/>
            </style>
          </object>
          <packing>
Adrien Plazas's avatar
Adrien Plazas committed
105
            <property name="name">panel</property>
106 107 108 109 110
          </packing>
        </child>
      </object>
    </child>
    <child type="titlebar">
111
      <object class="HdyTitleBar">
112 113 114
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <child>
Adrien Plazas's avatar
Adrien Plazas committed
115
          <object class="HdyLeaflet" id="header_box">
116
            <property name="visible">True</property>
117
            <property name="can_focus">False</property>
118
            <property name="orientation">horizontal</property>
Adrien Plazas's avatar
Adrien Plazas committed
119 120 121 122 123 124 125
            <property name="mode-transition-type" bind-source="main_leaflet" bind-property="mode-transition-type" bind-flags="bidirectional|sync-create"/>
            <property name="mode-transition-duration" bind-source="main_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
            <property name="child-transition-type" bind-source="main_leaflet" bind-property="child-transition-type" bind-flags="bidirectional|sync-create"/>
            <property name="child-transition-duration" bind-source="main_leaflet" bind-property="child-transition-duration" bind-flags="bidirectional|sync-create"/>
            <property name="visible-child-name" bind-source="main_leaflet" bind-property="visible-child-name" bind-flags="bidirectional|sync-create"/>
            <signal name="notify::visible-child" handler="notify_header_visible_child_cb" swapped="no"/>
            <signal name="notify::fold" handler="notify_fold_cb" object="CcWindow" after="yes" swapped="no"/>
126
            <child>
127 128 129 130 131
              <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>
132
                <child>
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
                  <object class="GtkButton" id="previous_button">
                    <property name="can_focus">True</property>
                    <property name="receives_default">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>
                    <child internal-child="accessible">
                      <object class="AtkObject" id="a11y-button1">
                        <property name="accessible-name" translatable="yes">All Settings</property>
                      </object>
                    </child>
                    <style>
                      <class name="image-button"/>
                    </style>
                  </object>
                </child>
                <child>
                  <object class="GtkToggleButton" id="search_button">
156
                    <property name="visible">True</property>
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
                    <property name="can_focus">True</property>
                    <property name="receives_default">True</property>
                    <child internal-child="accessible">
                      <object class="AtkObject">
                        <property name="accessible-name" translatable="yes">Search</property>
                      </object>
                    </child>
                    <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>
174 175
                  </object>
                </child>
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
                <child>
                  <object class="GtkMenuButton">
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">True</property>
                    <property name="menu_model">primary_menu</property>
                    <child internal-child="accessible">
                      <object class="AtkObject">
                        <property name="accessible-name" translatable="yes">Primary Menu</property>
                      </object>
                    </child>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="icon_name">open-menu-symbolic</property>
                      </object>
                    </child>
                    <style>
                      <class name="image-button"/>
                    </style>
197
                  </object>
198 199 200
                  <packing>
                    <property name="pack_type">end</property>
                  </packing>
201
                </child>
202
              </object>
Adrien Plazas's avatar
Adrien Plazas committed
203 204 205
              <packing>
                <property name="name">sidebar</property>
              </packing>
206 207
            </child>
            <child>
208
              <object class="GtkSeparator" id="header_separator">
209
                <property name="visible">True</property>
210 211
                <property name="can_focus">False</property>
                <property name="orientation">vertical</property>
212
                <style>
213
                  <class name="sidebar"/>
214
                </style>
215 216
              </object>
            </child>
Robert Ancell's avatar
Robert Ancell committed
217
            <child>
218
              <object class="GtkHeaderBar" id="panel_headerbar">
Robert Ancell's avatar
Robert Ancell committed
219
                <property name="visible">True</property>
220 221 222
                <property name="can_focus">False</property>
                <property name="hexpand">True</property>
                <property name="show_close_button">True</property>
Adrien Plazas's avatar
Adrien Plazas committed
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
                <child>
                  <object class="GtkRevealer" id="back_revealer">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="transition-type">crossfade</property>
                    <property name="transition-duration" bind-source="main_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
                    <child>
                      <object class="GtkButton" id="back">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="receives_default">False</property>
                        <property name="valign">center</property>
                        <property name="use-underline">True</property>
                        <signal name="clicked" handler="back_button_clicked_cb" object="CcWindow" swapped="no" />
                        <style>
                          <class name="image-button"/>
                        </style>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="a11y-back">
                            <property name="accessible-name" translatable="yes">Back</property>
                          </object>
                        </child>
                        <child>
                          <object class="GtkImage" id="back_image">
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <property name="icon_name">go-previous-symbolic</property>
                            <property name="icon_size">1</property>
                          </object>
                        </child>
                      </object>
                    </child>
                  </object>
                </child>
Robert Ancell's avatar
Robert Ancell committed
257
                <child>
258
                  <object class="GtkBox" id="top_right_box">
Robert Ancell's avatar
Robert Ancell committed
259
                    <property name="visible">True</property>
260
                    <property name="can_focus">True</property>
Robert Ancell's avatar
Robert Ancell committed
261
                  </object>
262 263 264
                  <packing>
                    <property name="pack_type">end</property>
                  </packing>
Robert Ancell's avatar
Robert Ancell committed
265
                </child>
266
              </object>
Adrien Plazas's avatar
Adrien Plazas committed
267 268 269
              <packing>
                <property name="name">panel</property>
              </packing>
270 271 272 273 274 275
            </child>
          </object>
        </child>
      </object>
    </child>
  </template>
276 277 278 279 280 281 282 283

  <object class="HdyHeaderGroup" id="header_group">
    <headerbars>
      <headerbar name="header"/>
      <headerbar name="panel_headerbar"/>
    </headerbars>
  </object>

284 285 286 287 288 289 290
  <object class="GtkSizeGroup" id="header_sizegroup">
    <property name="mode">vertical</property>
    <widgets>
      <widget name="search_button"/>
      <widget name="previous_button"/>
    </widgets>
  </object>
291 292 293 294 295 296 297 298 299

  <!-- Synchronize left header and sidebar -->
  <object class="GtkSizeGroup">
    <property name="mode">horizontal</property>
    <widgets>
      <widget name="header"/>
      <widget name="sidebar_box"/>
    </widgets>
  </object>
300

Adrien Plazas's avatar
Adrien Plazas committed
301 302 303 304 305 306 307 308 309
  <!-- Synchronize separators -->
  <object class="GtkSizeGroup">
    <property name="mode">horizontal</property>
    <widgets>
      <widget name="header_separator"/>
      <widget name="panel_separator"/>
    </widgets>
  </object>

310 311 312 313 314 315 316 317 318
  <!-- Synchronize right header and panel -->
  <object class="GtkSizeGroup">
    <property name="mode">horizontal</property>
    <widgets>
      <widget name="panel_headerbar"/>
      <widget name="stack"/>
    </widgets>
  </object>

319 320 321 322 323 324 325 326 327 328 329 330
  <!-- 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="no" />
  </object>

Robert Ancell's avatar
Robert Ancell committed
331 332 333 334 335 336 337 338 339 340 341 342 343
  <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>

344
</interface>