[gthumb] filter editor: removed deprecated widgets, use headerbar
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] filter editor: removed deprecated widgets, use headerbar
- Date: Sun, 3 Jan 2016 16:07:02 +0000 (UTC)
commit b60d014e118903a6303c9c99f350d79929525f30
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Jan 3 16:45:37 2016 +0100
filter editor: removed deprecated widgets, use headerbar
data/ui/filter-editor.ui | 189 ++++++++++++++++++++++---------------
gthumb/gth-filter-editor-dialog.c | 19 ++--
2 files changed, 123 insertions(+), 85 deletions(-)
---
diff --git a/data/ui/filter-editor.ui b/data/ui/filter-editor.ui
index bc425b9..e3094bd 100644
--- a/data/ui/filter-editor.ui
+++ b/data/ui/filter-editor.ui
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.19.0 -->
<interface>
- <requires lib="gtk+" version="2.14"/>
- <object class="GtkVBox" id="filter_editor">
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkBox" id="filter_editor">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">6</property>
- <property name="spacing">12</property>
+ <property name="border_width">15</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">20</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -44,24 +46,23 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="box1">
+ <object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="spacing">15</property>
<child>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="match_checkbutton">
- <property name="label" translatable="yes">_Match</property>
+ <property name="label" translatable="yes">_Match:</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="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -73,7 +74,7 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="match_type_combobox_box">
+ <object class="GtkBox" id="match_type_combobox_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -94,71 +95,69 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment2">
+ <object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="left_padding">24</property>
+ <property name="margin_left">20</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkVBox" id="tests_box">
+ <object class="GtkBox" id="tests_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<placeholder/>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">15</property>
<child>
- <object class="GtkHBox" id="hbox5">
+ <object class="GtkBox" id="hbox5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="limit_to_checkbutton">
- <property name="label" translatable="yes">_Limit to</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>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="orientation">vertical</property>
+ <property name="spacing">15</property>
<child>
- <object class="GtkHBox" id="limit_options_hbox">
+ <object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkEntry" id="limit_size_entry">
+ <object class="GtkCheckButton" id="limit_to_checkbutton">
+ <property name="label" translatable="yes">_Limit to</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="width_chars">6</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -167,15 +166,39 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="limit_object_combobox_box">
+ <object class="GtkBox" id="limit_options_hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="spacing">6</property>
<child>
- <placeholder/>
+ <object class="GtkEntry" id="limit_size_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="width_chars">6</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="limit_object_combobox_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -184,59 +207,73 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="selection_box">
+ <object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="margin_left">20</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">selected by</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="selection_combobox_box">
+ <object class="GtkBox" id="selection_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="spacing">6</property>
<child>
- <placeholder/>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">selected by</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="selection_order_combobox_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child>
- <placeholder/>
+ <object class="GtkBox" id="selection_combobox_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="selection_order_combobox_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
diff --git a/gthumb/gth-filter-editor-dialog.c b/gthumb/gth-filter-editor-dialog.c
index 4c75613..ce07776 100644
--- a/gthumb/gth-filter-editor-dialog.c
+++ b/gthumb/gth-filter-editor-dialog.c
@@ -131,9 +131,7 @@ limit_to_checkbutton_toggled_cb (GtkToggleButton *button,
static void
-gth_filter_editor_dialog_construct (GthFilterEditorDialog *self,
- const char *title,
- GtkWindow *parent)
+gth_filter_editor_dialog_construct (GthFilterEditorDialog *self)
{
GtkWidget *content;
GList *sort_types;
@@ -141,10 +139,6 @@ gth_filter_editor_dialog_construct (GthFilterEditorDialog *self,
GtkListStore *selection_model;
GtkCellRenderer *renderer;
- if (title != NULL)
- gtk_window_set_title (GTK_WINDOW (self), title);
- if (parent != NULL)
- gtk_window_set_transient_for (GTK_WINDOW (self), parent);
gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), 5);
gtk_container_set_border_width (GTK_CONTAINER (self), 5);
@@ -152,6 +146,9 @@ gth_filter_editor_dialog_construct (GthFilterEditorDialog *self,
gtk_dialog_add_button (GTK_DIALOG (self), _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (self), _GTK_LABEL_SAVE, GTK_RESPONSE_OK);
+ gtk_style_context_add_class (gtk_widget_get_style_context (gtk_dialog_get_widget_for_response
(GTK_DIALOG (self), GTK_RESPONSE_OK)),
+ GTK_STYLE_CLASS_SUGGESTED_ACTION);
+
self->priv->builder = _gtk_builder_new_from_file ("filter-editor.ui", NULL);
content = _gtk_builder_get_widget (self->priv->builder, "filter_editor");
@@ -250,8 +247,12 @@ gth_filter_editor_dialog_new (const char *title,
{
GthFilterEditorDialog *self;
- self = g_object_new (GTH_TYPE_FILTER_EDITOR_DIALOG, NULL);
- gth_filter_editor_dialog_construct (self, title, parent);
+ self = g_object_new (GTH_TYPE_FILTER_EDITOR_DIALOG,
+ "title", title,
+ "transient-for", parent,
+ "use-header-bar", _gtk_settings_get_dialogs_use_header (),
+ NULL);
+ gth_filter_editor_dialog_construct (self);
return (GtkWidget *) self;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]