[gnome-applets] window-title: port to GtkGrid
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] window-title: port to GtkGrid
- Date: Fri, 3 Apr 2020 20:14:16 +0000 (UTC)
commit e109fb23c548772a98b4ebb73147c1ca5fd92b8e
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Apr 3 21:06:40 2020 +0300
window-title: port to GtkGrid
gnome-applets/window-title/preferences.c | 6 +-
gnome-applets/window-title/window-title.ui | 116 +++++++++++++++--------------
2 files changed, 62 insertions(+), 60 deletions(-)
---
diff --git a/gnome-applets/window-title/preferences.c b/gnome-applets/window-title/preferences.c
index 2a8d4ca7a..13e8409bf 100755
--- a/gnome-applets/window-title/preferences.c
+++ b/gnome-applets/window-title/preferences.c
@@ -144,7 +144,7 @@ static void
cb_custom_style (GtkButton *button,
WTApplet *wtapplet)
{
- GtkTable *parent = GTK_TABLE(gtk_builder_get_object(wtapplet->prefbuilder, "table_custom_style"));
+ GtkGrid *parent = GTK_GRID (gtk_builder_get_object (wtapplet->prefbuilder, "grid_custom_style"));
gtk_widget_set_sensitive(GTK_WIDGET(parent), gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON(button)));
wtapplet->prefs->custom_style = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button));
savePreferences(wtapplet->prefs, wtapplet);
@@ -232,7 +232,7 @@ wt_applet_properties_cb (GSimpleAction *action,
GtkColorButton *btn_color_inactive = GTK_COLOR_BUTTON (gtk_builder_get_object(wtapplet->prefbuilder,
"btn_color_inactive"));
GtkFontButton *btn_font_inactive = GTK_FONT_BUTTON (gtk_builder_get_object(wtapplet->prefbuilder,
"btn_font_inactive"));
GtkButton *btn_close = GTK_BUTTON (gtk_builder_get_object(wtapplet->prefbuilder, "btn_close"));
- GtkTable *table_custom_style = GTK_TABLE(gtk_builder_get_object(wtapplet->prefbuilder,
"table_custom_style"));
+ GtkGrid *grid_custom_style = GTK_GRID (gtk_builder_get_object (wtapplet->prefbuilder,
"grid_custom_style"));
// set widgets according to preferences
gtk_toggle_button_set_active (chkb_only_maximized, wtapplet->prefs->only_maximized);
@@ -251,7 +251,7 @@ wt_applet_properties_cb (GSimpleAction *action,
gtk_color_button_set_color(btn_color_inactive, &btn_color_color);
gtk_font_button_set_font_name(btn_font_active, wtapplet->prefs->title_active_font);
gtk_font_button_set_font_name(btn_font_inactive, wtapplet->prefs->title_inactive_font);
- gtk_widget_set_sensitive(GTK_WIDGET(table_custom_style), gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON(chkb_custom_style)));
+ gtk_widget_set_sensitive (GTK_WIDGET (grid_custom_style), gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (chkb_custom_style)));
g_signal_connect(G_OBJECT(chkb_only_maximized), "clicked", G_CALLBACK (cb_only_maximized), wtapplet);
g_signal_connect(G_OBJECT(chkb_hide_on_unmaximized), "clicked", G_CALLBACK (cb_hide_on_unmaximized),
wtapplet);
diff --git a/gnome-applets/window-title/window-title.ui b/gnome-applets/window-title/window-title.ui
index 6a1da9013..cdc3aa6f5 100644
--- a/gnome-applets/window-title/window-title.ui
+++ b/gnome-applets/window-title/window-title.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.2 -->
<interface>
- <requires lib="gtk+" version="2.16"/>
+ <requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="properties">
<property name="can_focus">False</property>
<property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK |
GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK |
GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK</property>
@@ -9,6 +10,9 @@
<property name="destroy_with_parent">True</property>
<property name="icon_name">document-properties</property>
<property name="type_hint">dialog</property>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog_vbox">
<property name="visible">True</property>
@@ -22,12 +26,12 @@
<child>
<object class="GtkButton" id="btn_close">
<property name="label">gtk-close</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK |
GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK |
GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -81,10 +85,10 @@
<child>
<object class="GtkCheckButton" id="swap-order">
<property name="label" translatable="yes">Swap icon/title
_order</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -97,13 +101,13 @@
<child>
<object class="GtkCheckButton" id="expand-applet">
<property name="label" translatable="yes">Expand applet</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Disabled until GTK+
developers fix the various bugs.
You may change it using gconf-editor, but then you also need to set a fixed size.</property>
- <property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -151,10 +155,10 @@ You may change it using gconf-editor, but then you also need to set a fixed size
<child>
<object class="GtkCheckButton" id="hide-icon">
<property name="label" translatable="yes">Hide _icon</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -204,10 +208,10 @@ You may change it using gconf-editor, but then you also need to set a fixed size
<child>
<object class="GtkCheckButton" id="hide-title">
<property name="label" translatable="yes">Hide title</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -225,8 +229,8 @@ You may change it using gconf-editor, but then you also need to set a fixed size
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Alignment:</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -271,10 +275,10 @@ Note: only has effect when "Expand applet" is active.</property>
<child>
<object class="GtkCheckButton" id="custom-style">
<property name="label" translatable="yes">Custom _style</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -290,113 +294,111 @@ Note: only has effect when "Expand applet" is active.</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkTable" id="table_custom_style">
+ <object class="GtkGrid" id="grid_custom_style">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">3</property>
- <property name="n_columns">3</property>
<child>
- <object class="GtkLabel" id="label7">
+ <object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Font color:</property>
+ <property name="label" translatable="yes">Active</property>
</object>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Inactive</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
+ <property name="hexpand">True</property>
<property name="label" translatable="yes">Font style:</property>
+ <property name="xalign">0</property>
</object>
<packing>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkColorButton" id="btn_color_active">
+ <object class="GtkLabel" id="label7">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="color">#000000000000</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="label" translatable="yes">Font color:</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkFontButton" id="btn_font_active">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
+ <property name="hexpand">True</property>
+ <property name="font">Sans 12</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="right_attach">2</property>
<property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Active</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label10">
+ <object class="GtkFontButton" id="btn_font_inactive">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Inactive</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="hexpand">True</property>
+ <property name="font">Sans 12</property>
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkFontButton" id="btn_font_inactive">
+ <object class="GtkColorButton" id="btn_color_active">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
+ <property name="hexpand">True</property>
+ <property name="color">#000000000000</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkColorButton" id="btn_color_inactive">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
+ <property name="hexpand">True</property>
<property name="color">#000000000000</property>
</object>
<packing>
<property name="left_attach">2</property>
- <property name="right_attach">3</property>
<property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
</packing>
</child>
<child>
@@ -460,10 +462,10 @@ Note: only has effect when "Expand applet" is active.</property>
<child>
<object class="GtkCheckButton" id="only-maximized">
<property name="label" translatable="yes">Control _maximized windows only</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -476,10 +478,10 @@ Note: only has effect when "Expand applet" is active.</property>
<child>
<object class="GtkCheckButton" id="hide-on-unmaximized">
<property name="label" translatable="yes">_Hide when no active maximized
windows</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -492,12 +494,12 @@ Note: only has effect when "Expand applet" is active.</property>
<child>
<object class="GtkCheckButton" id="show-window-menu">
<property name="label" translatable="yes">Show window _action menu on
right-click</property>
+ <property name="use_action_appearance">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Will cause the window action menu
to appear when the title is right-clicked.
This experimental feature is still under development!
Warning! In current feature state you will be unable to access the applet action menu via title-right click
when this option is enabled! You may still do so by right-clicking the icon if it is not hidden. You may
always change this setting from gconf-editor.</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -510,10 +512,10 @@ Warning! In current feature state you will be unable to access the applet action
<child>
<object class="GtkCheckButton" id="show-tooltips">
<property name="label" translatable="yes">Show _tooltips</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]