[shotwell] Refine saved search dialog (missed in prior commit): Bug #742443
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Refine saved search dialog (missed in prior commit): Bug #742443
- Date: Tue, 6 Jan 2015 20:38:06 +0000 (UTC)
commit aa67bf207f06ae82f28f9d88cc61f2cce9859062
Author: Trinh Anh Ngoc <atw1990 gmail com>
Date: Tue Jan 6 12:37:51 2015 -0800
Refine saved search dialog (missed in prior commit): Bug #742443
src/searches/SavedSearchDialog.vala | 49 +++---
ui/shotwell.glade | 309 ++++++++++++++++-------------------
2 files changed, 165 insertions(+), 193 deletions(-)
---
diff --git a/src/searches/SavedSearchDialog.vala b/src/searches/SavedSearchDialog.vala
index da7f7db..95f6345 100644
--- a/src/searches/SavedSearchDialog.vala
+++ b/src/searches/SavedSearchDialog.vala
@@ -48,13 +48,12 @@ public class SavedSearchDialog {
set_type_combo_box(SearchCondition.SearchType.ANY_TEXT); // Sets default.
type_combo.changed.connect(on_type_changed);
- remove_button = new Gtk.Button();
- remove_button.set_label(" – ");
+ remove_button = new Gtk.Button.from_icon_name("list-remove-symbolic");
remove_button.button_press_event.connect(on_removed);
align = new Gtk.Alignment(0,0,0,0);
- box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
box.pack_start(type_combo, false, false, 0);
box.pack_start(align, false, false, 0);
box.pack_start(new Gtk.Alignment(0,0,0,0), true, true, 0); // Fill space.
@@ -180,7 +179,7 @@ public class SavedSearchDialog {
entry.set_activates_default(true);
entry.changed.connect(on_changed);
- box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
box.pack_start(text_context, false, false, 0);
box.pack_start(entry, false, false, 0);
box.show_all();
@@ -255,7 +254,7 @@ public class SavedSearchDialog {
media_type.set_active(0);
media_type.changed.connect(on_changed);
- box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
box.pack_start(media_context, false, false, 0);
box.pack_start(media_type, false, false, 0);
box.show_all();
@@ -317,7 +316,7 @@ public class SavedSearchDialog {
modified_state.set_active(0);
modified_state.changed.connect(on_changed);
- box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
box.pack_start(modified_context, false, false, 0);
box.pack_start(modified_state, false, false, 0);
box.show_all();
@@ -372,7 +371,7 @@ public class SavedSearchDialog {
flagged_state.set_active(0);
flagged_state.changed.connect(on_changed);
- box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
box.pack_start(new Gtk.Label(_("is")), false, false, 0);
box.pack_start(flagged_state, false, false, 0);
box.show_all();
@@ -437,7 +436,7 @@ public class SavedSearchDialog {
context.set_active(0);
context.changed.connect(on_changed);
- box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
box.pack_start(new Gtk.Label(_("is")), false, false, 0);
box.pack_start(rating, false, false, 0);
box.pack_start(context, false, false, 0);
@@ -512,7 +511,7 @@ public class SavedSearchDialog {
and = new Gtk.Label(_("and"));
- box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
+ box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 3);
box.pack_start(context, false, false, 0);
box.pack_start(label_one, false, false, 0);
box.pack_start(and, false, false, 0);
@@ -656,14 +655,7 @@ public class SavedSearchDialog {
// Default is text search.
add_text_search();
row_list.get(0).allow_removal(false);
-
- // Add buttons for new search.
- dialog.add_action_widget(new Gtk.Button.from_stock(Gtk.Stock.CANCEL), Gtk.ResponseType.CANCEL);
- Gtk.Button ok_button = new Gtk.Button.from_stock(Gtk.Stock.OK);
- ok_button.can_default = true;
- dialog.add_action_widget(ok_button, Gtk.ResponseType.OK);
- dialog.set_default_response(Gtk.ResponseType.OK);
-
+
dialog.show_all();
set_valid(false);
}
@@ -673,12 +665,6 @@ public class SavedSearchDialog {
edit_mode = true;
setup_dialog();
- // Add close button.
- Gtk.Button close_button = new Gtk.Button.from_stock(Gtk.Stock.CLOSE);
- close_button.can_default = true;
- dialog.add_action_widget(close_button, Gtk.ResponseType.OK);
- dialog.set_default_response(Gtk.ResponseType.OK);
-
dialog.show_all();
// Load existing search into dialog.
@@ -701,12 +687,21 @@ public class SavedSearchDialog {
// Builds the dialog UI. Doesn't add buttons to the dialog or call dialog.show().
private void setup_dialog() {
builder = AppWindow.create_builder();
-
- dialog = builder.get_object("Search criteria") as Gtk.Dialog;
- dialog.set_parent_window(AppWindow.get_instance().get_parent_window());
+
+ dialog = new Gtk.Dialog.with_buttons(_("Search"),
+ (Gtk.Window) AppWindow.get_instance().get_parent_window(),
+ Gtk.DialogFlags.MODAL |
+ Gtk.DialogFlags.DESTROY_WITH_PARENT |
+ Gtk.DialogFlags.USE_HEADER_BAR,
+ _("Cancel"), Gtk.ResponseType.CANCEL,
+ _("OK"), Gtk.ResponseType.OK,
+ null);
+ dialog.set_resizable(false);
dialog.set_transient_for(AppWindow.get_instance());
+ dialog.set_default_response(Gtk.ResponseType.OK);
dialog.response.connect(on_response);
-
+ dialog.get_content_area().add(builder.get_object("criteria") as Gtk.Widget);
+
add_criteria = builder.get_object("Add search button") as Gtk.Button;
add_criteria.button_press_event.connect(on_add_criteria);
diff --git a/ui/shotwell.glade b/ui/shotwell.glade
index 7c223bc..4429c6e 100644
--- a/ui/shotwell.glade
+++ b/ui/shotwell.glade
@@ -1,202 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!-- interface-requires gtk+ 3.0 -->
- <object class="GtkDialog" id="Search criteria">
+ <!-- interface-requires gtk+ 3.12 -->
+ <object class="GtkBox" id="criteria">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Search</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="destroy_with_parent">True</property>
- <property name="type_hint">dialog</property>
- <property name="skip_taskbar_hint">True</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox6">
+ <property name="orientation">vertical</property>
+ <property name="spacing">5</property>
+ <property name="border_width">3</property>
+ <child>
+ <object class="GtkAlignment" id="title_aln">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="search dialog buttons">
+ <child>
+ <object class="GtkBox" id="hbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="spacing">3</property>
<child>
- <placeholder/>
+ <object class="GtkLabel" id="Name of search:">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Name of search:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">Search title</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="Search title">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="width_chars">20</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ </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>
- <property name="fill">True</property>
- <property name="pack_type">end</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="GtkHSeparator" id="hseparator1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
- <object class="GtkAlignment" id="title_aln">
+ <object class="GtkBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="spacing">3</property>
<child>
- <object class="GtkBox" id="hbox3">
+ <object class="GtkLabel" id="Match">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="Name of search:">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Name of search:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">Search title</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="Search title">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- <property name="width_chars">20</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes">_Match</property>
+ <property name="use_underline">True</property>
+ <property name="justify">right</property>
+ <property name="mnemonic_widget">Type of search criteria</property>
</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="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHSeparator" id="hseparator1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<child>
- <object class="GtkBox" id="hbox2">
+ <object class="GtkComboBoxText" id="Type of search criteria">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">10</property>
- <child>
- <object class="GtkLabel" id="Match">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Match</property>
- <property name="use_underline">True</property>
- <property name="justify">right</property>
- <property name="mnemonic_widget">Type of search criteria</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBoxText" id="Type of search criteria">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">1</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="of the following:">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="ypad">3</property>
- <property name="label" translatable="yes">of the following:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">1</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="of the following:">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">of the following:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="Add search button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <style>
+ <class name="image-button"/>
+ </style>
<child>
- <object class="GtkButton" id="Add search button">
- <property name="label"> + </property>
+ <object class="GtkImage">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="icon-name">list-add-symbolic</property>
+ <property name="icon-size">1</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">4</property>
- </packing>
</child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">4</property>
+ </packing>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkHSeparator" id="hseparator2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">8</property>
- <property name="position">4</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHSeparator" id="hseparator2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="row_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
<child>
- <object class="GtkBox" id="row_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- </packing>
+ <placeholder/>
</child>
</object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
</child>
</object>
<object class="GtkAdjustment" id="bg_color_adjustment">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]