gnome-control-center/panels/online-accounts/online-accounts.ui
Georges Basile Stavracas Neto 1594d8c7a1 online-accounts: Align the panel widgets in the middle
The current implementation of the Online Accounts panel allows
2 states: either the widgets of the panel fill the whole horizontal
space, or they shrink and fill only the absolutely minimum. The
ideal solution, however, is to make them grow with the panel.

Fix that by turn the main box into a GtkGrid, and adding stub widgets
that expand horizontally and pull the main widgets to the middle,
allowing them to cover at most 1/3 of the screen. The widgets themselves
are inside a GtkBox, so that hiding them automatically removes the
spacing in between.

https://bugzilla.gnome.org/show_bug.cgi?id=774222
2017-02-22 23:00:49 -03:00

278 lines
13 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<template class="CcGoaPanel" parent="CcPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkOverlay">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child type="overlay">
<object class="GtkRevealer" id="notification_revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="transition_type">slide-down</property>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="notification_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
</object>
</child>
<child>
<object class="GtkButton" id="undo_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Undo</property>
<signal name="clicked" handler="on_undo_button_clicked" object="CcGoaPanel" swapped="no" />
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">none</property>
<signal name="clicked" handler="on_notification_closed" object="CcGoaPanel" swapped="no" />
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon-name">window-close-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="app-notification" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="min_content_height">350</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row-spacing">18</property>
<property name="column-spacing">18</property>
<property name="orientation">vertical</property>
<property name="margin_start">32</property>
<property name="margin_end">32</property>
<property name="margin_top">18</property>
<property name="margin_bottom">18</property>
<property name="hexpand">True</property>
<property name="width-request">300</property>
<!--
Stub boxes to pull the widgets to the middle, and yet allow them to
grow and cover a third of the available space
-->
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="top-attach">0</property>
<property name="left-attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="top-attach">0</property>
<property name="left-attach">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">18</property>
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<property name="width-request">300</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Connect to your data in the cloud</property>
<attributes>
<attribute name="scale" value="1.66" />
</attributes>
</object>
</child>
<child>
<object class="GtkLabel" id="offline_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">No internet connection — connect to setup new online accounts</property>
</object>
</child>
<child>
<object class="GtkFrame" id="accounts_frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkListBox" id="accounts_listbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="selection_mode">none</property>
<signal name="row-activated" handler="on_listbox_row_activated" object="CcGoaPanel" swapped="yes" />
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin-top">24</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Add an account</property>
<attributes>
<attribute name="weight" value="bold" />
</attributes>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkListBox" id="providers_listbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="selection_mode">none</property>
<signal name="row-activated" handler="on_provider_row_activated" object="CcGoaPanel" swapped="yes" />
<child>
<object class="GtkListBoxRow" id="more_providers_row">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="margin">12</property>
<property name="icon-name">view-more-symbolic</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="top-attach">0</property>
<property name="left-attach">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="GtkDialog" id="edit_account_dialog">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
<property name="use_header_bar">1</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<signal name="delete-event" handler="on_edit_account_dialog_delete_event" object="CcGoaPanel" swapped="yes" />
<child type="titlebar">
<object class="GtkHeaderBar" id="edit_account_headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
</object>
</child>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="border_width">0</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_type">crossfade</property>
<property name="homogeneous">False</property>
<child>
<object class="GtkBox" id="new_account_vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="name">new-account</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin">18</property>
<property name="spacing">24</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="accounts_vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
</object>
</child>
<child>
<object class="GtkButton" id="remove_account_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">end</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Remove Account</property>
<signal name="clicked" handler="on_remove_button_clicked" object="CcGoaPanel" swapped="yes" />
<style>
<class name="destructive-action" />
</style>
</object>
</child>
</object>
<packing>
<property name="name">editor</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>