[metacity] theme-viewer: move combo boxes to sidebar
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] theme-viewer: move combo boxes to sidebar
- Date: Mon, 2 Oct 2017 19:05:01 +0000 (UTC)
commit 5b1f3b6a1bf55702ee758d390c93573f085e7f14
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Oct 2 22:04:00 2017 +0300
theme-viewer: move combo boxes to sidebar
data/ui/theme-viewer-window.ui | 552 +++++++++++++++++++-----------------
theme-viewer/theme-viewer-window.c | 4 -
2 files changed, 292 insertions(+), 264 deletions(-)
---
diff --git a/data/ui/theme-viewer-window.ui b/data/ui/theme-viewer-window.ui
index 4a04856..3b040c1 100644
--- a/data/ui/theme-viewer-window.ui
+++ b/data/ui/theme-viewer-window.ui
@@ -2,61 +2,6 @@
<!-- Generated with glade 3.20.0 -->
<interface domain="metacity">
<requires lib="gtk+" version="3.20"/>
- <object class="GtkHeaderBar" id="header_bar">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="show_close_button">True</property>
- <child type="title">
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">10</property>
- <child>
- <object class="GtkComboBoxText" id="type_combo_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="active">0</property>
- <items>
- <item>GTK+</item>
- <item>Metacity</item>
- </items>
- <signal name="changed" handler="type_combo_box_changed_cb" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="theme_combo_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <signal name="changed" handler="theme_combo_box_changed_cb" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="reload_button">
- <property name="label" translatable="yes">Reload</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <signal name="clicked" handler="reload_button_clicked_cb" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
<object class="GtkAdjustment" id="scale_adjustment">
<property name="lower">1</property>
<property name="upper">4</property>
@@ -83,7 +28,7 @@
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkBox" id="sidebar">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
@@ -94,13 +39,41 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <property name="spacing">3</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Dark Theme:</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkComboBoxText" id="type_combo_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="active">0</property>
+ <items>
+ <item>GTK+</item>
+ <item>Metacity</item>
+ </items>
+ <signal name="changed" handler="type_combo_box_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="theme_combo_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <signal name="changed" handler="theme_combo_box_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -109,11 +82,12 @@
</packing>
</child>
<child>
- <object class="GtkSwitch" id="dark_theme">
+ <object class="GtkButton" id="reload_button">
+ <property name="label" translatable="yes">Reload</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="halign">start</property>
- <signal name="state-set" handler="dark_theme_state_set_cb" swapped="no"/>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="reload_button_clicked_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -129,17 +103,43 @@
</packing>
</child>
<child>
- <object class="GtkBox">
+ <object class="GtkBox" id="sidebar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <property name="spacing">3</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Frame Type:</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Dark Theme:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="dark_theme">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">start</property>
+ <signal name="state-set" handler="dark_theme_state_set_cb" swapped="no"/>
+ </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>
@@ -148,20 +148,46 @@
</packing>
</child>
<child>
- <object class="GtkComboBoxText" id="frame_type_combo_box">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="active">0</property>
- <items>
- <item translatable="yes">Normal</item>
- <item translatable="yes">Dialog</item>
- <item translatable="yes">Modal Dialog</item>
- <item translatable="yes">Utility</item>
- <item translatable="yes">Menu</item>
- <item translatable="yes">Border</item>
- <item translatable="yes">Attached</item>
- </items>
- <signal name="changed" handler="frame_type_combo_box_changed_cb" swapped="no"/>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Frame Type:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="frame_type_combo_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="active">0</property>
+ <items>
+ <item translatable="yes">Normal</item>
+ <item translatable="yes">Dialog</item>
+ <item translatable="yes">Modal Dialog</item>
+ <item translatable="yes">Utility</item>
+ <item translatable="yes">Menu</item>
+ <item translatable="yes">Border</item>
+ <item translatable="yes">Attached</item>
+ </items>
+ <signal name="changed" handler="frame_type_combo_box_changed_cb"
swapped="no"/>
+ </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>
@@ -169,242 +195,243 @@
<property name="position">1</property>
</packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">3</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Frame Flags:</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Frame Flags:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="has_focus">
+ <property name="label" translatable="yes">Has Focus</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="shaded">
+ <property name="label" translatable="yes">Shaded</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="maximized">
+ <property name="label" translatable="yes">Maximized</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="fullscreen">
+ <property name="label" translatable="yes">Fullscreen</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="tiled">
+ <property name="label" translatable="yes">Tiled</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </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>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <object class="GtkGrid">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="column_spacing">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
<child>
- <object class="GtkCheckButton" id="has_focus">
- <property name="label" translatable="yes">Has Focus</property>
+ <object class="GtkLabel">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="shaded">
- <property name="label" translatable="yes">Shaded</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Button Layout:</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="maximized">
- <property name="label" translatable="yes">Maximized</property>
+ <object class="GtkEntry" id="button_layout_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ <property name="text">appmenu:minimize,maximize,close</property>
+ <signal name="changed" handler="button_layout_entry_changed_cb"
swapped="no"/>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <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">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
<child>
- <object class="GtkCheckButton" id="fullscreen">
- <property name="label" translatable="yes">Fullscreen</property>
+ <object class="GtkLabel">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Composited:</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="tiled">
- <property name="label" translatable="yes">Tiled</property>
+ <object class="GtkSwitch" id="composited">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="flags_toggled_cb" swapped="no"/>
+ <property name="halign">start</property>
+ <property name="active">True</property>
+ <signal name="state-set" handler="composited_state_set_cb" swapped="no"/>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
- </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">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Button Layout:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="button_layout_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text">appmenu:minimize,maximize,close</property>
- <signal name="changed" handler="button_layout_entry_changed_cb" swapped="no"/>
- </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">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Composited:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
- <object class="GtkSwitch" id="composited">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">start</property>
- <property name="active">True</property>
- <signal name="state-set" handler="composited_state_set_cb" swapped="no"/>
- </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">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">3</property>
- <child>
- <object class="GtkLabel">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Scale:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="scale_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">scale_adjustment</property>
- <property name="value">1</property>
- <signal name="value-changed" handler="scale_changed_cb" swapped="no"/>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Scale:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="scale_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">1</property>
+ <property name="adjustment">scale_adjustment</property>
+ <property name="value">1</property>
+ <signal name="value-changed" handler="scale_changed_cb" swapped="no"/>
+ </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">1</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
@@ -619,7 +646,12 @@
</object>
</child>
<child type="titlebar">
- <placeholder/>
+ <object class="GtkHeaderBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Metacity Theme Viewer</property>
+ <property name="show_close_button">True</property>
+ </object>
</child>
</template>
</interface>
diff --git a/theme-viewer/theme-viewer-window.c b/theme-viewer/theme-viewer-window.c
index 5ceb452..de37191 100644
--- a/theme-viewer/theme-viewer-window.c
+++ b/theme-viewer/theme-viewer-window.c
@@ -32,7 +32,6 @@ struct _ThemeViewerWindow
{
GtkWindow parent;
- GtkWidget *header_bar;
GtkWidget *type_combo_box;
GtkWidget *theme_combo_box;
GtkWidget *reload_button;
@@ -909,8 +908,6 @@ theme_viewer_window_class_init (ThemeViewerWindowClass *window_class)
resource = "/org/gnome/metacity/ui/theme-viewer-window.ui";
gtk_widget_class_set_template_from_resource (widget_class, resource);
- gtk_widget_class_bind_template_child (widget_class, ThemeViewerWindow, header_bar);
-
gtk_widget_class_bind_template_child (widget_class, ThemeViewerWindow, type_combo_box);
gtk_widget_class_bind_template_callback (widget_class, type_combo_box_changed_cb);
@@ -966,7 +963,6 @@ theme_viewer_window_init (ThemeViewerWindow *window)
window->scale = gtk_widget_get_scale_factor (GTK_WIDGET (window));
gtk_widget_init_template (GTK_WIDGET (window));
- gtk_window_set_titlebar (GTK_WINDOW (window), window->header_bar);
gtk_widget_add_events (window->theme_box, GDK_POINTER_MOTION_MASK);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]