Merge lp:~tintou/noise/fix-interface into lp:~elementary-apps/noise/trunk

Proposed by Corentin Noël
Status: Merged
Approved by: Danielle Foré
Approved revision: 1573
Merged at revision: 1563
Proposed branch: lp:~tintou/noise/fix-interface
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 473 lines (+77/-104)
7 files modified
CMakeLists.txt (+5/-5)
plugins/LastFM/PreferencesSection.vala (+3/-3)
src/Dialogs/MediaEditor.vala (+25/-46)
src/Dialogs/PreferencesWindow.vala (+20/-20)
src/Dialogs/SmartPlaylistEditor.vala (+22/-22)
src/LibraryWindow.vala (+2/-2)
src/Widgets/StatusBar.vala (+0/-6)
To merge this branch: bzr merge lp:~tintou/noise/fix-interface
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Victor Martinez (community) Needs Information
Review via email: mp+211080@code.launchpad.net

Commit message

Fixed some problems with the interface:
 * English strings in the preference dialog
 * Lastfm string being expanded…
 * Luna padding on the statusbar
 * Media Editor dialog now uses Gtk.Dialog
 * Preference Dialog and Media Editor Dialog now uses Gtk.HeaderBar
 * Smart Playlist editor dialog now uses Gtk.HeaderBar
 * Gtk.Dialog.get_action_area has been replaced with ButtonBox
 * Set suggested action style class on "Save" buttons

Description of the change

Fixed some problems with the interface:
 * English strings in the preference dialog
 * Lastfm string being expanded…
 * Luna padding on the statusbar
 * Media Editor dialog now uses Gtk.Dialog
 * Preference Dialog and Media Editor Dialog now uses Gtk.HeaderBar

To post a comment you must log in.
Revision history for this message
Victor Martinez (victored) wrote :

This branch looks great.

I have some questions:

1. Where is the code that uses Gtk.Popover?

2. What about using the "use-header-bar" property for Gtk.Dialog? Only for GTK >= 3.12: https://developer.gnome.org/gtk3/unstable/GtkDialog.html#GtkDialog--use-header-bar

3. Gtk.Label supports text wrapping. Granite.Widgets.WrapLabel shouldn't be necessary.

4. Cast the value of Gtk.Dialog.get_content_area to Gtk.Container instead of the implementation-specific Gtk.Box.

review: Needs Information
lp:~tintou/noise/fix-interface updated
1565. By Corentin Noël

media editor: Now uses a Gtk.Dialog with HeaderBar.

1566. By Corentin Noël

preference dialog: use Headerbar for better looking and consistency

1567. By Corentin Noël

dependencies: Now required gtk+ >= 3.11.6 and vala >= 0.23.2

1568. By Corentin Noël

media editor: Using Gtk+ 3.12 integrated HeaderBar

Revision history for this message
Corentin Noël (tintou) wrote :

Thanks for the review!

1. Indeed, I wanted to say Gtk.Dialog instead of Gtk.Popover, it's fixed in trunk.

2. I didn't know that this property existed, I've pushed some revisions to use this property instead.

3. I tried with Gtk.Label but as the dialog has no size limit it doesn't wrap the label, Granite WrapLabel is needed.

4. Indeed, fixed.

Revision history for this message
Danielle Foré (danrabbit) wrote :

Hrm, I'm not sure I like removing the close button from the bottom right of dialogs. I think this creates an inconsistency since gtk.dialog retains the explicit buttons, but removes the close window decoration instead. I would agree that it's better to retain the label button since it an give a more explicit explanation of what closing the dialog does (maybe not applicable in this particular dialog, but in the scheme of platform consistency it is important in other dialogs).

I think we should:
1. revert the window decoration/close button situation in the prefs dialog
2. consider adding a "Cancel" button to the media editor and use the standard gtk dialog without a window decoration.

Revision history for this message
Victor Martinez (victored) wrote :

The code looks good at this point.

I believe you will implement Dan's suggestions before merging. If so please consider this as well:

1. Leave a single space after casts: (TypeName)var => (TypeName) var
2. Allocate the parent container size before packing the label or setting the text to avoid issues with text wrapping: https://developer.gnome.org/gtk3/unstable/GtkLabel.html#gtk-label-set-line-wrap
3. Gtk.Dialog.get_action_area has been deprecated since GTK 3.12: https://developer.gnome.org/gtk3/unstable/GtkDialog.html#gtk-dialog-get-action-area

lp:~tintou/noise/fix-interface updated
1569. By Corentin Noël

media editor and preferences dialog: reverted close button deletion

1570. By Corentin Noël

smartplaylisteditor: removed decorated window

1571. By Corentin Noël

Gtk 3.12 does pack_end on headerbar on an other way than previously, switched back to the original disposition.

1572. By Corentin Noël

fixed style

Revision history for this message
Corentin Noël (tintou) wrote :

Daniel:
 I reverted the changes, there is now a close button allowing consistency, I also added SUGGESTED_ACTION for button with a "Save" label.

Victor:
 1. Okay, changed.
 2. Hmm, it's something that could be investigated in a next branch.
 3. Yes, I replaced this with a ButtonBox in the content_area.

lp:~tintou/noise/fix-interface updated
1573. By Corentin Noël

Sync with trunk, resolved conflicts

Revision history for this message
Danielle Foré (danrabbit) wrote :

I think I'd still prefer using the regular gtk.dialog csd instead of adding a headerbar, but I'll approve this merge :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-03-07 15:52:49 +0000
+++ CMakeLists.txt 2014-03-16 21:07:17 +0000
@@ -1,7 +1,7 @@
1# check http://elementaryos.org/docs/developer-guide/cmake/simple-project1# check http://elementaryos.org/docs/developer-guide/cmake/simple-project
22
3cmake_minimum_required (VERSION 2.6)3cmake_minimum_required (VERSION 2.8)
4cmake_policy (VERSION 2.6)4cmake_policy (VERSION 2.8)
5project (noise C)5project (noise C)
6list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)6list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
77
@@ -74,7 +74,7 @@
74 gee-0.874 gee-0.8
75 libpeas-1.075 libpeas-1.0
76 libpeas-gtk-1.076 libpeas-gtk-1.0
77 gtk+-3.0>=3.1077 gtk+-3.0>=3.11.6
78 granite78 granite
79 gstreamer-1.079 gstreamer-1.0
80 gstreamer-tag-1.080 gstreamer-tag-1.0
@@ -150,7 +150,7 @@
150150
151find_package (Vala REQUIRED)151find_package (Vala REQUIRED)
152include (ValaVersion)152include (ValaVersion)
153ensure_vala_version ("0.22.0" MINIMUM)153ensure_vala_version ("0.23.2" MINIMUM)
154include (ValaPrecompile)154include (ValaPrecompile)
155155
156set (DEPS_LIBRARIES ${DEPS_LIBRARIES} -lm)156set (DEPS_LIBRARIES ${DEPS_LIBRARIES} -lm)
@@ -165,4 +165,4 @@
165add_subdirectory (plugins)165add_subdirectory (plugins)
166add_subdirectory (po)166add_subdirectory (po)
167add_subdirectory (data)167add_subdirectory (data)
168add_subdirectory (images)
169\ No newline at end of file168\ No newline at end of file
169add_subdirectory (images)
170170
=== modified file 'plugins/LastFM/PreferencesSection.vala'
--- plugins/LastFM/PreferencesSection.vala 2013-12-01 14:35:04 +0000
+++ plugins/LastFM/PreferencesSection.vala 2014-03-16 21:07:17 +0000
@@ -55,10 +55,10 @@
55 login_button.set_tooltip_text(_("Click to redo the Last.fm login process"));55 login_button.set_tooltip_text(_("Click to redo the Last.fm login process"));
56 }56 }
57 57
58 var label = new Gtk.Label (_("To allow for Last.fm integration, you must give permission to %s. You only need to do this once.").printf(program_name));58 var label = new Granite.Widgets.WrapLabel (_("To allow for Last.fm integration, you must give permission to %s. You only need to do this once.").printf(program_name));
59 label.xalign = 0.0f;59 label.xalign = 0.0f;
60 label.halign = Gtk.Align.START;60 label.halign = Gtk.Align.START;
61 label.set_line_wrap (true);61 label.expand = false;
62 62
63 page.add_full_option (label, ref row);63 page.add_full_option (label, ref row);
64 page.add_full_option (login_button, ref row);64 page.add_full_option (login_button, ref row);
@@ -107,4 +107,4 @@
107 }107 }
108 }108 }
109 }109 }
110}110}
111\ No newline at end of file111\ No newline at end of file
112112
=== modified file 'src/Dialogs/MediaEditor.vala'
--- src/Dialogs/MediaEditor.vala 2014-03-07 13:43:48 +0000
+++ src/Dialogs/MediaEditor.vala 2014-03-16 21:07:17 +0000
@@ -35,11 +35,7 @@
35 * CDs before importing their media to the library).35 * CDs before importing their media to the library).
36 */36 */
3737
38#if USE_GRANITE_DECORATED_WINDOW38public class Noise.MediaEditor : Gtk.Dialog {
39public class Noise.MediaEditor : Granite.Widgets.LightWindow {
40#else
41public class Noise.MediaEditor : Gtk.Window {
42#endif
43 LyricFetcher lf;39 LyricFetcher lf;
44 40
45 Gee.LinkedList<int> _allMedias;41 Gee.LinkedList<int> _allMedias;
@@ -51,7 +47,8 @@
51 private Gee.HashMap<string, FieldEditor> fields;// a hashmap with each property and corresponding editor47 private Gee.HashMap<string, FieldEditor> fields;// a hashmap with each property and corresponding editor
52 private Gtk.TextView lyricsText;48 private Gtk.TextView lyricsText;
53 49
54 private Gtk.Button _save;50 private Gtk.Button save_button;
51 private Gtk.Button close_button;
55 52
56 private Gtk.Label lyricsInfobarLabel;53 private Gtk.Label lyricsInfobarLabel;
57 private Library library;54 private Library library;
@@ -59,6 +56,7 @@
59 public signal void medias_saved (Gee.LinkedList<int> medias);56 public signal void medias_saved (Gee.LinkedList<int> medias);
60 57
61 public MediaEditor (Gee.LinkedList<int> allMedias, Gee.LinkedList<int> medias, Library library) {58 public MediaEditor (Gee.LinkedList<int> allMedias, Gee.LinkedList<int> medias, Library library) {
59 Object (use_header_bar: 1);
62 this.library = library;60 this.library = library;
63 this.window_position = Gtk.WindowPosition.CENTER;61 this.window_position = Gtk.WindowPosition.CENTER;
64 this.type_hint = Gdk.WindowTypeHint.DIALOG;62 this.type_hint = Gdk.WindowTypeHint.DIALOG;
@@ -75,9 +73,12 @@
75 _medias = medias;73 _medias = medias;
76 74
77 stack = new Gtk.Stack ();75 stack = new Gtk.Stack ();
76
78 var stack_switcher = new Gtk.StackSwitcher ();77 var stack_switcher = new Gtk.StackSwitcher ();
79 stack_switcher.set_stack (stack);78 stack_switcher.set_stack (stack);
80 stack_switcher.halign = Gtk.Align.CENTER;79 stack_switcher.halign = Gtk.Align.CENTER;
80
81 ((Gtk.HeaderBar) get_header_bar ()).set_custom_title (stack_switcher);
8182
82 stack.add_titled (createBasicContent (), "metadata", _("Metadata"));83 stack.add_titled (createBasicContent (), "metadata", _("Metadata"));
83 if(_medias.size == 1)84 if(_medias.size == 1)
@@ -87,29 +88,27 @@
8788
88 var arrows = new Granite.Widgets.NavigationArrows ();89 var arrows = new Granite.Widgets.NavigationArrows ();
8990
90 _save = new Gtk.Button.with_label (_(STRING_SAVE));91 save_button = new Gtk.Button.with_label (_(STRING_SAVE));
91 _save.set_size_request (85, -1);92 save_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
9293
93 _save.valign = arrows.valign = Gtk.Align.END;94 close_button = new Gtk.Button.with_label (_("Close"));
9495
95 var buttons = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);96 var buttons = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
96 buttons.margin_top = 12;
97 buttons.set_layout (Gtk.ButtonBoxStyle.END);97 buttons.set_layout (Gtk.ButtonBoxStyle.END);
98 buttons.set_spacing (6);
9899
99 buttons.pack_start (arrows, false, false, 0);100 buttons.pack_start (arrows, false, false, 0);
100 buttons.pack_end (_save, false, false, 0);101 buttons.pack_end (close_button, false, false, 0);
101102 buttons.pack_end (save_button, false, false, 0);
102 buttons.set_child_secondary (arrows, true);103 buttons.set_child_secondary (arrows, true);
103104
104 var content = new Gtk.Grid ();105 var main_grid = new Gtk.Grid ();
105 content.orientation = Gtk.Orientation.VERTICAL;106 main_grid.attach (stack, 0, 0, 1, 1);
106 content.margin = 12;107 main_grid.attach (buttons, 0, 1, 1, 1);
107108
108 content.add (stack_switcher);109 var content = get_content_area () as Gtk.Container;
109 content.add (stack);110 content.margin_left = content.margin_right = 12;
110 content.add (buttons);111 content.add (main_grid);
111
112 this.add (content);
113112
114 this.show_all();113 this.show_all();
115114
@@ -122,9 +121,10 @@
122 fetch_lyrics.begin (false);121 fetch_lyrics.begin (false);
123 }122 }
124123
125 arrows.previous_clicked.connect(previousClicked);124 arrows.previous_clicked.connect (previousClicked);
126 arrows.next_clicked.connect(nextClicked);125 arrows.next_clicked.connect (nextClicked);
127 _save.clicked.connect(saveClicked);126 save_button.clicked.connect (saveClicked);
127 close_button.clicked.connect (() => {destroy ();});
128 }128 }
129 129
130 public Gtk.Box createBasicContent () {130 public Gtk.Box createBasicContent () {
@@ -719,25 +719,4 @@
719 719
720 info.set_markup(text);720 info.set_markup(text);
721 }721 }
722}
723
724/*public class Noise.DoubleSpinButton : HBox {
725 private SpinButton spin1;
726 private SpinButton spin2;
727
728 public DoubleSpinButton(double val1, double val2, double maxVal) {
729 spin1 = new SpinButton.with_range(0.0, maxVal, 1.0);
730 spin2 = new SpinButton.with_range(0.0, maxVal, 1.0);
731
732 spin1.set_value(val1);
733 spin2.set_value(val2);
734 }
735
736 public double getVal1() {
737 return spin1.get_value();
738 }
739
740 public double getVal2() {
741 return spin2.get_value();
742 }
743}*/
744\ No newline at end of file722\ No newline at end of file
723}
745\ No newline at end of file724\ No newline at end of file
746725
=== modified file 'src/Dialogs/PreferencesWindow.vala'
--- src/Dialogs/PreferencesWindow.vala 2014-03-07 13:43:48 +0000
+++ src/Dialogs/PreferencesWindow.vala 2014-03-16 21:07:17 +0000
@@ -39,6 +39,7 @@
39 private int index = 0;39 private int index = 0;
4040
41 public PreferencesWindow (LibraryWindow lw) {41 public PreferencesWindow (LibraryWindow lw) {
42 Object (use_header_bar: 1);
42 build_ui (lw);43 build_ui (lw);
4344
44 lw.add_preference_page.connect ((page) => {add_page (page);});45 lw.add_preference_page.connect ((page) => {add_page (page);});
@@ -71,34 +72,39 @@
71 return index;72 return index;
72 }73 }
7374
74
75 public void remove_section (int index) {75 public void remove_section (int index) {
76 var section = sections.get (index);76 var section = sections.get (index);
77 section.destroy ();77 section.destroy ();
78 sections.unset (index);78 sections.unset (index);
79 }79 }
8080
81
82 private void build_ui (Gtk.Window parent_window) {81 private void build_ui (Gtk.Window parent_window) {
83 set_size_request (MIN_WIDTH, MIN_HEIGHT);
84
85 // Window properties82 // Window properties
86 title = _("Preferences");83 title = _("Preferences");
84 set_size_request (MIN_WIDTH, MIN_HEIGHT);
87 resizable = false;85 resizable = false;
88 window_position = Gtk.WindowPosition.CENTER;86 window_position = Gtk.WindowPosition.CENTER;
89 type_hint = Gdk.WindowTypeHint.DIALOG;87 type_hint = Gdk.WindowTypeHint.DIALOG;
90 transient_for = parent_window;88 transient_for = parent_window;
91 var main_grid = new Gtk.Grid ();89
92 main_stack = new Gtk.Stack ();90 main_stack = new Gtk.Stack ();
93 main_stackswitcher = new Gtk.StackSwitcher ();91 main_stackswitcher = new Gtk.StackSwitcher ();
94 main_stackswitcher.set_stack (main_stack);92 main_stackswitcher.set_stack (main_stack);
95 main_stackswitcher.halign = Gtk.Align.CENTER;93
96 main_grid.attach (main_stackswitcher, 0, 0, 1, 1);94 var close_button = new Gtk.Button.with_label (_("Close"));
97 main_grid.attach (main_stack, 0, 1, 1, 1);95 close_button.clicked.connect (() => {this.destroy ();});
98 main_grid.hexpand = true;96
9997 var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
100 ((Gtk.Box)get_content_area()).add (main_grid);98 button_box.set_layout (Gtk.ButtonBoxStyle.END);
101 add_button (_("Close"), Gtk.ResponseType.ACCEPT);99 button_box.pack_end (close_button);
100 button_box.margin_right = 12;
101
102 var main_grid = new Gtk.Grid ();
103 main_grid.attach (main_stack, 0, 0, 1, 1);
104 main_grid.attach (button_box, 0, 1, 1, 1);
105
106 ((Gtk.HeaderBar) get_header_bar ()).set_custom_title (main_stackswitcher);
107 ((Gtk.Container) get_content_area ()).add (main_grid);
102 }108 }
103}109}
104110
@@ -157,18 +163,12 @@
157#if HAVE_LIBNOTIFY163#if HAVE_LIBNOTIFY
158 show_notifications_switch = new Gtk.Switch ();164 show_notifications_switch = new Gtk.Switch ();
159 main_settings.schema.bind("show-notifications", show_notifications_switch, "active", SettingsBindFlags.DEFAULT);165 main_settings.schema.bind("show-notifications", show_notifications_switch, "active", SettingsBindFlags.DEFAULT);
160 page.add_option (new Gtk.Label (_("Show notifications:")), show_notifications_switch, ref row);166 page.add_option (new Gtk.Label (_("Notifications:")), show_notifications_switch, ref row);
161#endif167#endif
162168
163 string hide_on_close_desc;
164 if (LibraryWindow.minimize_on_close ())
165 hide_on_close_desc = _("Minimize window when a song is being played:");
166 else
167 hide_on_close_desc = _("Hide window when a song is being played:");
168
169 hide_on_close_switch = new Gtk.Switch ();169 hide_on_close_switch = new Gtk.Switch ();
170 main_settings.schema.bind("close-while-playing", hide_on_close_switch, "active", SettingsBindFlags.INVERT_BOOLEAN);170 main_settings.schema.bind("close-while-playing", hide_on_close_switch, "active", SettingsBindFlags.INVERT_BOOLEAN);
171 page.add_option (new Gtk.Label (hide_on_close_desc), hide_on_close_switch, ref row);171 page.add_option (new Gtk.Label (_("Continue playback when closed:")), hide_on_close_switch, ref row);
172 172
173 }173 }
174}174}
175\ No newline at end of file175\ No newline at end of file
176176
=== modified file 'src/Dialogs/SmartPlaylistEditor.vala'
--- src/Dialogs/SmartPlaylistEditor.vala 2014-02-02 00:10:45 +0000
+++ src/Dialogs/SmartPlaylistEditor.vala 2014-03-16 21:07:17 +0000
@@ -17,11 +17,7 @@
17 * Corentin Noël <tintou@mailoo.org>17 * Corentin Noël <tintou@mailoo.org>
18 */18 */
1919
20#if USE_GRANITE_DECORATED_WINDOW20public class Noise.SmartPlaylistEditor : Gtk.Dialog {
21public class Noise.SmartPlaylistEditor : Granite.Widgets.LightWindow {
22#else
23public class Noise.SmartPlaylistEditor : Window {
24#endif
2521
26 SmartPlaylist sp;22 SmartPlaylist sp;
27 private bool is_new = false;23 private bool is_new = false;
@@ -32,13 +28,13 @@
32 private Gtk.Grid queries_grid;28 private Gtk.Grid queries_grid;
33 private Gtk.CheckButton limit_check;29 private Gtk.CheckButton limit_check;
34 private Gtk.SpinButton limit_spin;30 private Gtk.SpinButton limit_spin;
35 private Gtk.Button add_button;31 private Gtk.Button adding_button;
36 private Gee.ArrayList<SmartPlaylistEditorQuery> queries_list;32 private Gee.ArrayList<SmartPlaylistEditorQuery> queries_list;
37 private int row = 0;33 private int row = 0;
38 private Library library;34 private Library library;
3935
40 public SmartPlaylistEditor(SmartPlaylist? sp = null, Library library) {36 public SmartPlaylistEditor (SmartPlaylist? sp = null, Library library) {
41 37 Object (use_header_bar: 1);
42 this.title = _("Smart Playlist Editor");38 this.title = _("Smart Playlist Editor");
43 this.library = library;39 this.library = library;
44 40
@@ -68,6 +64,7 @@
68 name_entry.text = sp.name;64 name_entry.text = sp.name;
69 65
70 var match_grid = new Gtk.Grid ();66 var match_grid = new Gtk.Grid ();
67 match_grid.column_spacing = 12;
71 var match_label = new Gtk.Label (_("Match"));68 var match_label = new Gtk.Label (_("Match"));
72 match_combobox = new Gtk.ComboBoxText ();69 match_combobox = new Gtk.ComboBoxText ();
73 match_combobox.insert_text (0, _("any"));70 match_combobox.insert_text (0, _("any"));
@@ -85,12 +82,14 @@
85 queries_list = new Gee.ArrayList<SmartPlaylistEditorQuery> ();82 queries_list = new Gee.ArrayList<SmartPlaylistEditorQuery> ();
86 queries_grid = new Gtk.Grid ();83 queries_grid = new Gtk.Grid ();
87 queries_grid.column_spacing = 12;84 queries_grid.column_spacing = 12;
85 queries_grid.row_spacing = 6;
88 queries_grid.expand = true;86 queries_grid.expand = true;
89 87
90 add_button = new Gtk.Button.with_label (_("Add"));88 adding_button = new Gtk.Button.with_label (_("Add"));
91 89
92 /* create extra option: limiter */90 /* create extra option: limiter */
93 var limiter_grid = new Gtk.Grid ();91 var limiter_grid = new Gtk.Grid ();
92 limiter_grid.column_spacing = 12;
94 limit_check = new Gtk.CheckButton.with_label (_("Limit to"));93 limit_check = new Gtk.CheckButton.with_label (_("Limit to"));
95 limit_spin = new Gtk.SpinButton.with_range (0, 500, 10);94 limit_spin = new Gtk.SpinButton.with_range (0, 500, 10);
96 var limit_label = new Gtk.Label (_("items"));95 var limit_label = new Gtk.Label (_("items"));
@@ -114,6 +113,7 @@
114 var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);113 var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
115 button_box.spacing = 6;114 button_box.spacing = 6;
116 save_button = new Gtk.Button.with_label (_(STRING_SAVE));115 save_button = new Gtk.Button.with_label (_(STRING_SAVE));
116 save_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
117 var close_button = new Gtk.Button.with_label (_(STRING_CANCEL));117 var close_button = new Gtk.Button.with_label (_(STRING_CANCEL));
118 button_box.set_layout (Gtk.ButtonBoxStyle.END);118 button_box.set_layout (Gtk.ButtonBoxStyle.END);
119 button_box.pack_end (close_button, false, false, 0);119 button_box.pack_end (close_button, false, false, 0);
@@ -121,7 +121,7 @@
121 121
122 main_grid = new Gtk.Grid ();122 main_grid = new Gtk.Grid ();
123 main_grid.expand = true;123 main_grid.expand = true;
124 main_grid.margin = 12;124 main_grid.margin_left = main_grid.margin_right = 12;
125 main_grid.column_spacing = 12;125 main_grid.column_spacing = 12;
126 main_grid.row_spacing = 6;126 main_grid.row_spacing = 6;
127 main_grid.attach (name_label, 0, 0, 3, 1);127 main_grid.attach (name_label, 0, 0, 3, 1);
@@ -132,7 +132,7 @@
132 main_grid.attach (options_label, 0, 5, 3, 1);132 main_grid.attach (options_label, 0, 5, 3, 1);
133 main_grid.attach (limiter_grid, 0, 6, 3, 1);133 main_grid.attach (limiter_grid, 0, 6, 3, 1);
134 main_grid.attach (button_box, 0, 7, 3, 1);134 main_grid.attach (button_box, 0, 7, 3, 1);
135 add (main_grid);135 ((Gtk.Container) get_content_area ()).add (main_grid);
136 136
137 save_button.clicked.connect (save_click);137 save_button.clicked.connect (save_click);
138 close_button.clicked.connect (close_click);138 close_button.clicked.connect (close_click);
@@ -152,15 +152,15 @@
152 row++;152 row++;
153 }153 }
154 154
155 queries_grid.attach (add_button, 0, row, 1, 1);155 queries_grid.attach (adding_button, 0, row, 1, 1);
156 if(sp.queries ().size == 0) {156 if(sp.queries ().size == 0) {
157 add_row ();157 add_row ();
158 }158 }
159 foreach(SmartPlaylistEditorQuery speq in queries_list) {159 foreach(SmartPlaylistEditorQuery speq in queries_list) {
160 speq.field_changed (false);160 speq.field_changed (false);
161 }161 }
162 add_button.clicked.connect (add_button_click);162 adding_button.clicked.connect (add_button_click);
163 add_button.show ();163 adding_button.show ();
164 // Validate initial state164 // Validate initial state
165 name_changed ();165 name_changed ();
166 }166 }
@@ -183,15 +183,15 @@
183 }183 }
184184
185 public void add_row () {185 public void add_row () {
186 if (add_button.parent != null)186 if (adding_button.parent != null)
187 queries_grid.remove (add_button);187 queries_grid.remove (adding_button);
188 var editor_query = new SmartPlaylistEditorQuery (new SmartQuery());188 var editor_query = new SmartPlaylistEditorQuery (new SmartQuery());
189 editor_query.removed.connect (() => {queries_list.remove (editor_query);});189 editor_query.removed.connect (() => {queries_list.remove (editor_query);});
190 editor_query.changed.connect (() => {if (!queries_list.contains (editor_query)) queries_list.add (editor_query);});190 editor_query.changed.connect (() => {if (!queries_list.contains (editor_query)) queries_list.add (editor_query);});
191 queries_grid.attach (editor_query.grid, 0, row, 1, 1);191 queries_grid.attach (editor_query.grid, 0, row, 1, 1);
192 editor_query.grid.show ();192 editor_query.grid.show ();
193 row++;193 row++;
194 queries_grid.attach (add_button, 0, row, 1, 1);194 queries_grid.attach (adding_button, 0, row, 1, 1);
195 editor_query.field_changed (false);195 editor_query.field_changed (false);
196 }196 }
197 197
@@ -246,8 +246,7 @@
246 _q = q;246 _q = q;
247 247
248 comparators = new GLib.HashTable<int, SmartQuery.ComparatorType> (null, null);248 comparators = new GLib.HashTable<int, SmartQuery.ComparatorType> (null, null);
249 249
250 grid = new Gtk.Grid ();
251 field_combobox = new Gtk.ComboBoxText ();250 field_combobox = new Gtk.ComboBoxText ();
252 comparator_combobox = new Gtk.ComboBoxText();251 comparator_combobox = new Gtk.ComboBoxText();
253 value_entry = new Gtk.Entry ();252 value_entry = new Gtk.Entry ();
@@ -286,9 +285,10 @@
286 } else {285 } else {
287 _valueNumerical.set_value (int.parse (q.value));286 _valueNumerical.set_value (int.parse (q.value));
288 }287 }
289
290 _units = new Gtk.Label ("");288 _units = new Gtk.Label ("");
291 289
290 grid = new Gtk.Grid ();
291 grid.column_spacing = 12;
292 grid.hexpand = true;292 grid.hexpand = true;
293 grid.attach (field_combobox, 0, 0, 1, 1);293 grid.attach (field_combobox, 0, 0, 1, 1);
294 grid.attach (comparator_combobox, 1, 0, 1, 1);294 grid.attach (comparator_combobox, 1, 0, 1, 1);
@@ -441,4 +441,4 @@
441 return (compared == SmartQuery.FieldType.LAST_PLAYED || compared == SmartQuery.FieldType.DATE_ADDED441 return (compared == SmartQuery.FieldType.LAST_PLAYED || compared == SmartQuery.FieldType.DATE_ADDED
442 || compared == SmartQuery.FieldType.DATE_RELEASED);442 || compared == SmartQuery.FieldType.DATE_RELEASED);
443 }443 }
444}444}
445\ No newline at end of file445\ No newline at end of file
446446
=== modified file 'src/LibraryWindow.vala'
--- src/LibraryWindow.vala 2014-03-14 15:48:01 +0000
+++ src/LibraryWindow.vala 2014-03-16 21:07:17 +0000
@@ -285,8 +285,8 @@
285 headerbar.pack_start (nextButton);285 headerbar.pack_start (nextButton);
286 headerbar.pack_start (viewSelector);286 headerbar.pack_start (viewSelector);
287 headerbar.set_custom_title (topDisplayBin);287 headerbar.set_custom_title (topDisplayBin);
288 headerbar.pack_end (((Noise.App) GLib.Application.get_default ()).create_appmenu (settingsMenu));
288 headerbar.pack_end (searchField);289 headerbar.pack_end (searchField);
289 headerbar.pack_end (((Noise.App) GLib.Application.get_default ()).create_appmenu (settingsMenu));
290 headerbar.show_all ();290 headerbar.show_all ();
291291
292292
@@ -1130,7 +1130,7 @@
1130 preferences = new PreferencesWindow(this);1130 preferences = new PreferencesWindow(this);
1131 preferences.show_all ();1131 preferences.show_all ();
1132 preferences.run ();1132 preferences.run ();
1133 preferences.hide ();1133 preferences = null;
1134 }1134 }
11351135
1136 public void setMusicFolder(string folder) {1136 public void setMusicFolder(string folder) {
11371137
=== modified file 'src/Widgets/StatusBar.vala'
--- src/Widgets/StatusBar.vala 2014-02-02 11:47:19 +0000
+++ src/Widgets/StatusBar.vala 2014-03-16 21:07:17 +0000
@@ -218,12 +218,6 @@
218 private class InfoPanelChooser : SimpleOptionChooser {218 private class InfoPanelChooser : SimpleOptionChooser {
219219
220 public InfoPanelChooser () {220 public InfoPanelChooser () {
221 //To avoid the InfoPanelChooser to overlap with the window resize grip
222 //Get the grip width
223 int resize_grip_width;
224 App.main_window.style_get ("resize-grip-width", out resize_grip_width);
225 //Use the actual grip width as right margin
226 margin_right = resize_grip_width;
227 var info_panel_show = Icons.PANE_SHOW_SYMBOLIC.render_image (Gtk.IconSize.MENU);221 var info_panel_show = Icons.PANE_SHOW_SYMBOLIC.render_image (Gtk.IconSize.MENU);
228 var info_panel_hide = Icons.PANE_HIDE_SYMBOLIC.render_image (Gtk.IconSize.MENU);222 var info_panel_hide = Icons.PANE_HIDE_SYMBOLIC.render_image (Gtk.IconSize.MENU);
229223

Subscribers

People subscribed via source and target branches