[gnome-panel/wip/applets/clock] clock: make ClockPreferences subclass of GtkWindow not GtkDialog
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/applets/clock] clock: make ClockPreferences subclass of GtkWindow not GtkDialog
- Date: Tue, 18 Nov 2014 01:24:02 +0000 (UTC)
commit 1c370ec49de5612151180b24f04942bd73dc8526
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Nov 18 03:04:14 2014 +0200
clock: make ClockPreferences subclass of GtkWindow not GtkDialog
applets/clock/clock-location-edit.c | 1 -
applets/clock/clock-preferences.c | 3 +-
applets/clock/clock-preferences.h | 4 +-
applets/clock/clock-preferences.ui | 262 +++++++++++++++++------------------
4 files changed, 129 insertions(+), 141 deletions(-)
---
diff --git a/applets/clock/clock-location-edit.c b/applets/clock/clock-location-edit.c
index 5d6b89b..0d277c4 100644
--- a/applets/clock/clock-location-edit.c
+++ b/applets/clock/clock-location-edit.c
@@ -529,7 +529,6 @@ clock_location_edit_new (GSettings *settings,
NULL);
window = GTK_WINDOW (object);
- gtk_window_set_modal (window, TRUE);
gtk_window_set_transient_for (window, parent);
return GTK_WIDGET (object);
diff --git a/applets/clock/clock-preferences.c b/applets/clock/clock-preferences.c
index b9bb615..44fe85a 100644
--- a/applets/clock/clock-preferences.c
+++ b/applets/clock/clock-preferences.c
@@ -75,7 +75,7 @@ struct _ClockPreferencesPrivate
G_DEFINE_TYPE_WITH_PRIVATE (ClockPreferences,
clock_preferences,
- GTK_TYPE_DIALOG)
+ GTK_TYPE_WINDOW)
enum
{
@@ -847,7 +847,6 @@ clock_preferences_new (GSettings *applet_settings,
preferences = CLOCK_PREFERENCES (object);
window = GTK_WINDOW (object);
- gtk_window_set_transient_for (window, parent);
gtk_window_set_icon_name (window, CLOCK_ICON);
if (page_number > -1)
diff --git a/applets/clock/clock-preferences.h b/applets/clock/clock-preferences.h
index abefcbc..aa437d4 100644
--- a/applets/clock/clock-preferences.h
+++ b/applets/clock/clock-preferences.h
@@ -46,13 +46,13 @@ typedef struct _ClockPreferencesPrivate ClockPreferencesPrivate;
struct _ClockPreferences
{
- GtkDialog parent;
+ GtkWindow parent;
ClockPreferencesPrivate *priv;
};
struct _ClockPreferencesClass
{
- GtkDialogClass parent_class;
+ GtkWindowClass parent_class;
};
GType clock_preferences_get_type (void);
diff --git a/applets/clock/clock-preferences.ui b/applets/clock/clock-preferences.ui
index 600c9e4..d16367d 100644
--- a/applets/clock/clock-preferences.ui
+++ b/applets/clock/clock-preferences.ui
@@ -2,144 +2,20 @@
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.12"/>
- <object class="GtkListStore" id="liststore1">
- <columns>
- <!-- column-name name -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Default</col>
- </row>
- <row>
- <col id="0" translatable="yes">Kelvin</col>
- </row>
- <row>
- <col id="0" translatable="yes">Celsius</col>
- </row>
- <row>
- <col id="0" translatable="yes">Fahrenheit</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="liststore2">
- <columns>
- <!-- column-name name -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Default</col>
- </row>
- <row>
- <col id="0" translatable="yes">m/s</col>
- </row>
- <row>
- <col id="0" translatable="yes">km/h</col>
- </row>
- <row>
- <col id="0" translatable="yes">mph</col>
- </row>
- <row>
- <col id="0" translatable="yes">knots</col>
- </row>
- <row>
- <col id="0" translatable="yes">Beaufort scale</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="liststore3">
- <columns>
- <!-- column-name name -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">24 hour format</col>
- </row>
- <row>
- <col id="0" translatable="yes">12 hour format</col>
- </row>
- </data>
- </object>
- <template class="ClockPreferences" parent="GtkDialog">
+ <template class="ClockPreferences" parent="GtkWindow">
<property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Clock Preferences</property>
<property name="resizable">False</property>
- <property name="window_position">center</property>
- <property name="destroy_with_parent">True</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog_vbox">
+ <child>
+ <object class="GtkBox" id="window">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
<property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog_action_area">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="help_button">
- <property name="label" translatable="yes">_Help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="time_settings_button">
- <property name="label" translatable="yes">Time _Settings</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="close_button">
- <property name="label" translatable="yes">_Close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="gtk_widget_destroy" object="ClockPreferences" swapped="yes"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="spacing">12</property>
<child>
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="border_width">5</property>
<child>
<object class="GtkBox" id="general">
<property name="visible">True</property>
@@ -331,7 +207,7 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow10">
+ <object class="GtkScrolledWindow" id="scrolled_window">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
@@ -345,7 +221,7 @@
<property name="headers_visible">False</property>
<property name="hover_expand">True</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview_selection3"/>
+ <object class="GtkTreeSelection" id="treeview-selection"/>
</child>
</object>
</child>
@@ -573,15 +449,129 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButtonBox" id="button_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="help_button">
+ <property name="label" translatable="yes">_Help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="time_settings_button">
+ <property name="label" translatable="yes">Time _Settings</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close_button">
+ <property name="label" translatable="yes">_Close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="gtk_widget_destroy" object="ClockPreferences" swapped="yes"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-11">help_button</action-widget>
- <action-widget response="0">time_settings_button</action-widget>
- <action-widget response="-7">close_button</action-widget>
- </action-widgets>
</template>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name name -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Default</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Kelvin</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Celsius</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Fahrenheit</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="liststore2">
+ <columns>
+ <!-- column-name name -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Default</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">m/s</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">km/h</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">mph</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">knots</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Beaufort scale</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="liststore3">
+ <columns>
+ <!-- column-name name -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">24 hour format</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">12 hour format</col>
+ </row>
+ </data>
+ </object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]