Merge lp:~tintou/noise/fix-interface into lp:~elementary-apps/noise/trunk
- fix-interface
- Merge into trunk
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 | ||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Danielle Foré | Approve | ||
Victor Martinez (community) | Needs Information | ||
Review via email:
|
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.
* 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
- 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
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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:/
3. Gtk.Dialog.
- 1569. By Corentin Noël
-
media editor and preferences dialog: reverted close button deletion
- 1570. By Corentin Noël
-
smartplaylisted
itor: 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
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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.
- 1573. By Corentin Noël
-
Sync with trunk, resolved conflicts
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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 :)
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-03-07 15:52:49 +0000 | |||
3 | +++ CMakeLists.txt 2014-03-16 21:07:17 +0000 | |||
4 | @@ -1,7 +1,7 @@ | |||
5 | 1 | # check http://elementaryos.org/docs/developer-guide/cmake/simple-project | 1 | # check http://elementaryos.org/docs/developer-guide/cmake/simple-project |
6 | 2 | 2 | ||
9 | 3 | cmake_minimum_required (VERSION 2.6) | 3 | cmake_minimum_required (VERSION 2.8) |
10 | 4 | cmake_policy (VERSION 2.6) | 4 | cmake_policy (VERSION 2.8) |
11 | 5 | project (noise C) | 5 | project (noise C) |
12 | 6 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) | 6 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
13 | 7 | 7 | ||
14 | @@ -74,7 +74,7 @@ | |||
15 | 74 | gee-0.8 | 74 | gee-0.8 |
16 | 75 | libpeas-1.0 | 75 | libpeas-1.0 |
17 | 76 | libpeas-gtk-1.0 | 76 | libpeas-gtk-1.0 |
19 | 77 | gtk+-3.0>=3.10 | 77 | gtk+-3.0>=3.11.6 |
20 | 78 | granite | 78 | granite |
21 | 79 | gstreamer-1.0 | 79 | gstreamer-1.0 |
22 | 80 | gstreamer-tag-1.0 | 80 | gstreamer-tag-1.0 |
23 | @@ -150,7 +150,7 @@ | |||
24 | 150 | 150 | ||
25 | 151 | find_package (Vala REQUIRED) | 151 | find_package (Vala REQUIRED) |
26 | 152 | include (ValaVersion) | 152 | include (ValaVersion) |
28 | 153 | ensure_vala_version ("0.22.0" MINIMUM) | 153 | ensure_vala_version ("0.23.2" MINIMUM) |
29 | 154 | include (ValaPrecompile) | 154 | include (ValaPrecompile) |
30 | 155 | 155 | ||
31 | 156 | set (DEPS_LIBRARIES ${DEPS_LIBRARIES} -lm) | 156 | set (DEPS_LIBRARIES ${DEPS_LIBRARIES} -lm) |
32 | @@ -165,4 +165,4 @@ | |||
33 | 165 | add_subdirectory (plugins) | 165 | add_subdirectory (plugins) |
34 | 166 | add_subdirectory (po) | 166 | add_subdirectory (po) |
35 | 167 | add_subdirectory (data) | 167 | add_subdirectory (data) |
36 | 168 | add_subdirectory (images) | ||
37 | 169 | \ No newline at end of file | 168 | \ No newline at end of file |
38 | 169 | add_subdirectory (images) | ||
39 | 170 | 170 | ||
40 | === modified file 'plugins/LastFM/PreferencesSection.vala' | |||
41 | --- plugins/LastFM/PreferencesSection.vala 2013-12-01 14:35:04 +0000 | |||
42 | +++ plugins/LastFM/PreferencesSection.vala 2014-03-16 21:07:17 +0000 | |||
43 | @@ -55,10 +55,10 @@ | |||
44 | 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")); |
45 | 56 | } | 56 | } |
46 | 57 | 57 | ||
48 | 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)); |
49 | 59 | label.xalign = 0.0f; | 59 | label.xalign = 0.0f; |
50 | 60 | label.halign = Gtk.Align.START; | 60 | label.halign = Gtk.Align.START; |
52 | 61 | label.set_line_wrap (true); | 61 | label.expand = false; |
53 | 62 | 62 | ||
54 | 63 | page.add_full_option (label, ref row); | 63 | page.add_full_option (label, ref row); |
55 | 64 | page.add_full_option (login_button, ref row); | 64 | page.add_full_option (login_button, ref row); |
56 | @@ -107,4 +107,4 @@ | |||
57 | 107 | } | 107 | } |
58 | 108 | } | 108 | } |
59 | 109 | } | 109 | } |
61 | 110 | } | 110 | } |
62 | 111 | \ No newline at end of file | 111 | \ No newline at end of file |
63 | 112 | 112 | ||
64 | === modified file 'src/Dialogs/MediaEditor.vala' | |||
65 | --- src/Dialogs/MediaEditor.vala 2014-03-07 13:43:48 +0000 | |||
66 | +++ src/Dialogs/MediaEditor.vala 2014-03-16 21:07:17 +0000 | |||
67 | @@ -35,11 +35,7 @@ | |||
68 | 35 | * CDs before importing their media to the library). | 35 | * CDs before importing their media to the library). |
69 | 36 | */ | 36 | */ |
70 | 37 | 37 | ||
76 | 38 | #if USE_GRANITE_DECORATED_WINDOW | 38 | public class Noise.MediaEditor : Gtk.Dialog { |
72 | 39 | public class Noise.MediaEditor : Granite.Widgets.LightWindow { | ||
73 | 40 | #else | ||
74 | 41 | public class Noise.MediaEditor : Gtk.Window { | ||
75 | 42 | #endif | ||
77 | 43 | LyricFetcher lf; | 39 | LyricFetcher lf; |
78 | 44 | 40 | ||
79 | 45 | Gee.LinkedList<int> _allMedias; | 41 | Gee.LinkedList<int> _allMedias; |
80 | @@ -51,7 +47,8 @@ | |||
81 | 51 | private Gee.HashMap<string, FieldEditor> fields;// a hashmap with each property and corresponding editor | 47 | private Gee.HashMap<string, FieldEditor> fields;// a hashmap with each property and corresponding editor |
82 | 52 | private Gtk.TextView lyricsText; | 48 | private Gtk.TextView lyricsText; |
83 | 53 | 49 | ||
85 | 54 | private Gtk.Button _save; | 50 | private Gtk.Button save_button; |
86 | 51 | private Gtk.Button close_button; | ||
87 | 55 | 52 | ||
88 | 56 | private Gtk.Label lyricsInfobarLabel; | 53 | private Gtk.Label lyricsInfobarLabel; |
89 | 57 | private Library library; | 54 | private Library library; |
90 | @@ -59,6 +56,7 @@ | |||
91 | 59 | public signal void medias_saved (Gee.LinkedList<int> medias); | 56 | public signal void medias_saved (Gee.LinkedList<int> medias); |
92 | 60 | 57 | ||
93 | 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) { |
94 | 59 | Object (use_header_bar: 1); | ||
95 | 62 | this.library = library; | 60 | this.library = library; |
96 | 63 | this.window_position = Gtk.WindowPosition.CENTER; | 61 | this.window_position = Gtk.WindowPosition.CENTER; |
97 | 64 | this.type_hint = Gdk.WindowTypeHint.DIALOG; | 62 | this.type_hint = Gdk.WindowTypeHint.DIALOG; |
98 | @@ -75,9 +73,12 @@ | |||
99 | 75 | _medias = medias; | 73 | _medias = medias; |
100 | 76 | 74 | ||
101 | 77 | stack = new Gtk.Stack (); | 75 | stack = new Gtk.Stack (); |
102 | 76 | |||
103 | 78 | var stack_switcher = new Gtk.StackSwitcher (); | 77 | var stack_switcher = new Gtk.StackSwitcher (); |
104 | 79 | stack_switcher.set_stack (stack); | 78 | stack_switcher.set_stack (stack); |
105 | 80 | stack_switcher.halign = Gtk.Align.CENTER; | 79 | stack_switcher.halign = Gtk.Align.CENTER; |
106 | 80 | |||
107 | 81 | ((Gtk.HeaderBar) get_header_bar ()).set_custom_title (stack_switcher); | ||
108 | 81 | 82 | ||
109 | 82 | stack.add_titled (createBasicContent (), "metadata", _("Metadata")); | 83 | stack.add_titled (createBasicContent (), "metadata", _("Metadata")); |
110 | 83 | if(_medias.size == 1) | 84 | if(_medias.size == 1) |
111 | @@ -87,29 +88,27 @@ | |||
112 | 87 | 88 | ||
113 | 88 | var arrows = new Granite.Widgets.NavigationArrows (); | 89 | var arrows = new Granite.Widgets.NavigationArrows (); |
114 | 89 | 90 | ||
117 | 90 | _save = new Gtk.Button.with_label (_(STRING_SAVE)); | 91 | save_button = new Gtk.Button.with_label (_(STRING_SAVE)); |
118 | 91 | _save.set_size_request (85, -1); | 92 | save_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); |
119 | 92 | 93 | ||
121 | 93 | _save.valign = arrows.valign = Gtk.Align.END; | 94 | close_button = new Gtk.Button.with_label (_("Close")); |
122 | 94 | 95 | ||
123 | 95 | var buttons = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); | 96 | var buttons = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); |
124 | 96 | buttons.margin_top = 12; | ||
125 | 97 | buttons.set_layout (Gtk.ButtonBoxStyle.END); | 97 | buttons.set_layout (Gtk.ButtonBoxStyle.END); |
126 | 98 | buttons.set_spacing (6); | ||
127 | 98 | 99 | ||
128 | 99 | buttons.pack_start (arrows, false, false, 0); | 100 | buttons.pack_start (arrows, false, false, 0); |
131 | 100 | buttons.pack_end (_save, false, false, 0); | 101 | buttons.pack_end (close_button, false, false, 0); |
132 | 101 | 102 | buttons.pack_end (save_button, false, false, 0); | |
133 | 102 | buttons.set_child_secondary (arrows, true); | 103 | buttons.set_child_secondary (arrows, true); |
134 | 103 | 104 | ||
144 | 104 | var content = new Gtk.Grid (); | 105 | var main_grid = new Gtk.Grid (); |
145 | 105 | content.orientation = Gtk.Orientation.VERTICAL; | 106 | main_grid.attach (stack, 0, 0, 1, 1); |
146 | 106 | content.margin = 12; | 107 | main_grid.attach (buttons, 0, 1, 1, 1); |
147 | 107 | 108 | ||
148 | 108 | content.add (stack_switcher); | 109 | var content = get_content_area () as Gtk.Container; |
149 | 109 | content.add (stack); | 110 | content.margin_left = content.margin_right = 12; |
150 | 110 | content.add (buttons); | 111 | content.add (main_grid); |
142 | 111 | |||
143 | 112 | this.add (content); | ||
151 | 113 | 112 | ||
152 | 114 | this.show_all(); | 113 | this.show_all(); |
153 | 115 | 114 | ||
154 | @@ -122,9 +121,10 @@ | |||
155 | 122 | fetch_lyrics.begin (false); | 121 | fetch_lyrics.begin (false); |
156 | 123 | } | 122 | } |
157 | 124 | 123 | ||
161 | 125 | arrows.previous_clicked.connect(previousClicked); | 124 | arrows.previous_clicked.connect (previousClicked); |
162 | 126 | arrows.next_clicked.connect(nextClicked); | 125 | arrows.next_clicked.connect (nextClicked); |
163 | 127 | _save.clicked.connect(saveClicked); | 126 | save_button.clicked.connect (saveClicked); |
164 | 127 | close_button.clicked.connect (() => {destroy ();}); | ||
165 | 128 | } | 128 | } |
166 | 129 | 129 | ||
167 | 130 | public Gtk.Box createBasicContent () { | 130 | public Gtk.Box createBasicContent () { |
168 | @@ -719,25 +719,4 @@ | |||
169 | 719 | 719 | ||
170 | 720 | info.set_markup(text); | 720 | info.set_markup(text); |
171 | 721 | } | 721 | } |
172 | 722 | } | ||
173 | 723 | |||
174 | 724 | /*public class Noise.DoubleSpinButton : HBox { | ||
175 | 725 | private SpinButton spin1; | ||
176 | 726 | private SpinButton spin2; | ||
177 | 727 | |||
178 | 728 | public DoubleSpinButton(double val1, double val2, double maxVal) { | ||
179 | 729 | spin1 = new SpinButton.with_range(0.0, maxVal, 1.0); | ||
180 | 730 | spin2 = new SpinButton.with_range(0.0, maxVal, 1.0); | ||
181 | 731 | |||
182 | 732 | spin1.set_value(val1); | ||
183 | 733 | spin2.set_value(val2); | ||
184 | 734 | } | ||
185 | 735 | |||
186 | 736 | public double getVal1() { | ||
187 | 737 | return spin1.get_value(); | ||
188 | 738 | } | ||
189 | 739 | |||
190 | 740 | public double getVal2() { | ||
191 | 741 | return spin2.get_value(); | ||
192 | 742 | } | ||
193 | 743 | }*/ | ||
194 | 744 | \ No newline at end of file | 722 | \ No newline at end of file |
195 | 723 | } | ||
196 | 745 | \ No newline at end of file | 724 | \ No newline at end of file |
197 | 746 | 725 | ||
198 | === modified file 'src/Dialogs/PreferencesWindow.vala' | |||
199 | --- src/Dialogs/PreferencesWindow.vala 2014-03-07 13:43:48 +0000 | |||
200 | +++ src/Dialogs/PreferencesWindow.vala 2014-03-16 21:07:17 +0000 | |||
201 | @@ -39,6 +39,7 @@ | |||
202 | 39 | private int index = 0; | 39 | private int index = 0; |
203 | 40 | 40 | ||
204 | 41 | public PreferencesWindow (LibraryWindow lw) { | 41 | public PreferencesWindow (LibraryWindow lw) { |
205 | 42 | Object (use_header_bar: 1); | ||
206 | 42 | build_ui (lw); | 43 | build_ui (lw); |
207 | 43 | 44 | ||
208 | 44 | lw.add_preference_page.connect ((page) => {add_page (page);}); | 45 | lw.add_preference_page.connect ((page) => {add_page (page);}); |
209 | @@ -71,34 +72,39 @@ | |||
210 | 71 | return index; | 72 | return index; |
211 | 72 | } | 73 | } |
212 | 73 | 74 | ||
213 | 74 | |||
214 | 75 | public void remove_section (int index) { | 75 | public void remove_section (int index) { |
215 | 76 | var section = sections.get (index); | 76 | var section = sections.get (index); |
216 | 77 | section.destroy (); | 77 | section.destroy (); |
217 | 78 | sections.unset (index); | 78 | sections.unset (index); |
218 | 79 | } | 79 | } |
219 | 80 | 80 | ||
220 | 81 | |||
221 | 82 | private void build_ui (Gtk.Window parent_window) { | 81 | private void build_ui (Gtk.Window parent_window) { |
222 | 83 | set_size_request (MIN_WIDTH, MIN_HEIGHT); | ||
223 | 84 | |||
224 | 85 | // Window properties | 82 | // Window properties |
225 | 86 | title = _("Preferences"); | 83 | title = _("Preferences"); |
226 | 84 | set_size_request (MIN_WIDTH, MIN_HEIGHT); | ||
227 | 87 | resizable = false; | 85 | resizable = false; |
228 | 88 | window_position = Gtk.WindowPosition.CENTER; | 86 | window_position = Gtk.WindowPosition.CENTER; |
229 | 89 | type_hint = Gdk.WindowTypeHint.DIALOG; | 87 | type_hint = Gdk.WindowTypeHint.DIALOG; |
230 | 90 | transient_for = parent_window; | 88 | transient_for = parent_window; |
232 | 91 | var main_grid = new Gtk.Grid (); | 89 | |
233 | 92 | main_stack = new Gtk.Stack (); | 90 | main_stack = new Gtk.Stack (); |
234 | 93 | main_stackswitcher = new Gtk.StackSwitcher (); | 91 | main_stackswitcher = new Gtk.StackSwitcher (); |
235 | 94 | main_stackswitcher.set_stack (main_stack); | 92 | main_stackswitcher.set_stack (main_stack); |
243 | 95 | main_stackswitcher.halign = Gtk.Align.CENTER; | 93 | |
244 | 96 | main_grid.attach (main_stackswitcher, 0, 0, 1, 1); | 94 | var close_button = new Gtk.Button.with_label (_("Close")); |
245 | 97 | main_grid.attach (main_stack, 0, 1, 1, 1); | 95 | close_button.clicked.connect (() => {this.destroy ();}); |
246 | 98 | main_grid.hexpand = true; | 96 | |
247 | 99 | 97 | var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); | |
248 | 100 | ((Gtk.Box)get_content_area()).add (main_grid); | 98 | button_box.set_layout (Gtk.ButtonBoxStyle.END); |
249 | 101 | add_button (_("Close"), Gtk.ResponseType.ACCEPT); | 99 | button_box.pack_end (close_button); |
250 | 100 | button_box.margin_right = 12; | ||
251 | 101 | |||
252 | 102 | var main_grid = new Gtk.Grid (); | ||
253 | 103 | main_grid.attach (main_stack, 0, 0, 1, 1); | ||
254 | 104 | main_grid.attach (button_box, 0, 1, 1, 1); | ||
255 | 105 | |||
256 | 106 | ((Gtk.HeaderBar) get_header_bar ()).set_custom_title (main_stackswitcher); | ||
257 | 107 | ((Gtk.Container) get_content_area ()).add (main_grid); | ||
258 | 102 | } | 108 | } |
259 | 103 | } | 109 | } |
260 | 104 | 110 | ||
261 | @@ -157,18 +163,12 @@ | |||
262 | 157 | #if HAVE_LIBNOTIFY | 163 | #if HAVE_LIBNOTIFY |
263 | 158 | show_notifications_switch = new Gtk.Switch (); | 164 | show_notifications_switch = new Gtk.Switch (); |
264 | 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); |
266 | 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); |
267 | 161 | #endif | 167 | #endif |
268 | 162 | 168 | ||
269 | 163 | string hide_on_close_desc; | ||
270 | 164 | if (LibraryWindow.minimize_on_close ()) | ||
271 | 165 | hide_on_close_desc = _("Minimize window when a song is being played:"); | ||
272 | 166 | else | ||
273 | 167 | hide_on_close_desc = _("Hide window when a song is being played:"); | ||
274 | 168 | |||
275 | 169 | hide_on_close_switch = new Gtk.Switch (); | 169 | hide_on_close_switch = new Gtk.Switch (); |
276 | 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); |
278 | 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); |
279 | 172 | 172 | ||
280 | 173 | } | 173 | } |
281 | 174 | } | 174 | } |
282 | 175 | \ No newline at end of file | 175 | \ No newline at end of file |
283 | 176 | 176 | ||
284 | === modified file 'src/Dialogs/SmartPlaylistEditor.vala' | |||
285 | --- src/Dialogs/SmartPlaylistEditor.vala 2014-02-02 00:10:45 +0000 | |||
286 | +++ src/Dialogs/SmartPlaylistEditor.vala 2014-03-16 21:07:17 +0000 | |||
287 | @@ -17,11 +17,7 @@ | |||
288 | 17 | * Corentin Noël <tintou@mailoo.org> | 17 | * Corentin Noël <tintou@mailoo.org> |
289 | 18 | */ | 18 | */ |
290 | 19 | 19 | ||
296 | 20 | #if USE_GRANITE_DECORATED_WINDOW | 20 | public class Noise.SmartPlaylistEditor : Gtk.Dialog { |
292 | 21 | public class Noise.SmartPlaylistEditor : Granite.Widgets.LightWindow { | ||
293 | 22 | #else | ||
294 | 23 | public class Noise.SmartPlaylistEditor : Window { | ||
295 | 24 | #endif | ||
297 | 25 | 21 | ||
298 | 26 | SmartPlaylist sp; | 22 | SmartPlaylist sp; |
299 | 27 | private bool is_new = false; | 23 | private bool is_new = false; |
300 | @@ -32,13 +28,13 @@ | |||
301 | 32 | private Gtk.Grid queries_grid; | 28 | private Gtk.Grid queries_grid; |
302 | 33 | private Gtk.CheckButton limit_check; | 29 | private Gtk.CheckButton limit_check; |
303 | 34 | private Gtk.SpinButton limit_spin; | 30 | private Gtk.SpinButton limit_spin; |
305 | 35 | private Gtk.Button add_button; | 31 | private Gtk.Button adding_button; |
306 | 36 | private Gee.ArrayList<SmartPlaylistEditorQuery> queries_list; | 32 | private Gee.ArrayList<SmartPlaylistEditorQuery> queries_list; |
307 | 37 | private int row = 0; | 33 | private int row = 0; |
308 | 38 | private Library library; | 34 | private Library library; |
309 | 39 | 35 | ||
312 | 40 | public SmartPlaylistEditor(SmartPlaylist? sp = null, Library library) { | 36 | public SmartPlaylistEditor (SmartPlaylist? sp = null, Library library) { |
313 | 41 | 37 | Object (use_header_bar: 1); | |
314 | 42 | this.title = _("Smart Playlist Editor"); | 38 | this.title = _("Smart Playlist Editor"); |
315 | 43 | this.library = library; | 39 | this.library = library; |
316 | 44 | 40 | ||
317 | @@ -68,6 +64,7 @@ | |||
318 | 68 | name_entry.text = sp.name; | 64 | name_entry.text = sp.name; |
319 | 69 | 65 | ||
320 | 70 | var match_grid = new Gtk.Grid (); | 66 | var match_grid = new Gtk.Grid (); |
321 | 67 | match_grid.column_spacing = 12; | ||
322 | 71 | var match_label = new Gtk.Label (_("Match")); | 68 | var match_label = new Gtk.Label (_("Match")); |
323 | 72 | match_combobox = new Gtk.ComboBoxText (); | 69 | match_combobox = new Gtk.ComboBoxText (); |
324 | 73 | match_combobox.insert_text (0, _("any")); | 70 | match_combobox.insert_text (0, _("any")); |
325 | @@ -85,12 +82,14 @@ | |||
326 | 85 | queries_list = new Gee.ArrayList<SmartPlaylistEditorQuery> (); | 82 | queries_list = new Gee.ArrayList<SmartPlaylistEditorQuery> (); |
327 | 86 | queries_grid = new Gtk.Grid (); | 83 | queries_grid = new Gtk.Grid (); |
328 | 87 | queries_grid.column_spacing = 12; | 84 | queries_grid.column_spacing = 12; |
329 | 85 | queries_grid.row_spacing = 6; | ||
330 | 88 | queries_grid.expand = true; | 86 | queries_grid.expand = true; |
331 | 89 | 87 | ||
333 | 90 | add_button = new Gtk.Button.with_label (_("Add")); | 88 | adding_button = new Gtk.Button.with_label (_("Add")); |
334 | 91 | 89 | ||
335 | 92 | /* create extra option: limiter */ | 90 | /* create extra option: limiter */ |
336 | 93 | var limiter_grid = new Gtk.Grid (); | 91 | var limiter_grid = new Gtk.Grid (); |
337 | 92 | limiter_grid.column_spacing = 12; | ||
338 | 94 | limit_check = new Gtk.CheckButton.with_label (_("Limit to")); | 93 | limit_check = new Gtk.CheckButton.with_label (_("Limit to")); |
339 | 95 | limit_spin = new Gtk.SpinButton.with_range (0, 500, 10); | 94 | limit_spin = new Gtk.SpinButton.with_range (0, 500, 10); |
340 | 96 | var limit_label = new Gtk.Label (_("items")); | 95 | var limit_label = new Gtk.Label (_("items")); |
341 | @@ -114,6 +113,7 @@ | |||
342 | 114 | var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); | 113 | var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); |
343 | 115 | button_box.spacing = 6; | 114 | button_box.spacing = 6; |
344 | 116 | save_button = new Gtk.Button.with_label (_(STRING_SAVE)); | 115 | save_button = new Gtk.Button.with_label (_(STRING_SAVE)); |
345 | 116 | save_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); | ||
346 | 117 | var close_button = new Gtk.Button.with_label (_(STRING_CANCEL)); | 117 | var close_button = new Gtk.Button.with_label (_(STRING_CANCEL)); |
347 | 118 | button_box.set_layout (Gtk.ButtonBoxStyle.END); | 118 | button_box.set_layout (Gtk.ButtonBoxStyle.END); |
348 | 119 | button_box.pack_end (close_button, false, false, 0); | 119 | button_box.pack_end (close_button, false, false, 0); |
349 | @@ -121,7 +121,7 @@ | |||
350 | 121 | 121 | ||
351 | 122 | main_grid = new Gtk.Grid (); | 122 | main_grid = new Gtk.Grid (); |
352 | 123 | main_grid.expand = true; | 123 | main_grid.expand = true; |
354 | 124 | main_grid.margin = 12; | 124 | main_grid.margin_left = main_grid.margin_right = 12; |
355 | 125 | main_grid.column_spacing = 12; | 125 | main_grid.column_spacing = 12; |
356 | 126 | main_grid.row_spacing = 6; | 126 | main_grid.row_spacing = 6; |
357 | 127 | main_grid.attach (name_label, 0, 0, 3, 1); | 127 | main_grid.attach (name_label, 0, 0, 3, 1); |
358 | @@ -132,7 +132,7 @@ | |||
359 | 132 | main_grid.attach (options_label, 0, 5, 3, 1); | 132 | main_grid.attach (options_label, 0, 5, 3, 1); |
360 | 133 | main_grid.attach (limiter_grid, 0, 6, 3, 1); | 133 | main_grid.attach (limiter_grid, 0, 6, 3, 1); |
361 | 134 | main_grid.attach (button_box, 0, 7, 3, 1); | 134 | main_grid.attach (button_box, 0, 7, 3, 1); |
363 | 135 | add (main_grid); | 135 | ((Gtk.Container) get_content_area ()).add (main_grid); |
364 | 136 | 136 | ||
365 | 137 | save_button.clicked.connect (save_click); | 137 | save_button.clicked.connect (save_click); |
366 | 138 | close_button.clicked.connect (close_click); | 138 | close_button.clicked.connect (close_click); |
367 | @@ -152,15 +152,15 @@ | |||
368 | 152 | row++; | 152 | row++; |
369 | 153 | } | 153 | } |
370 | 154 | 154 | ||
372 | 155 | queries_grid.attach (add_button, 0, row, 1, 1); | 155 | queries_grid.attach (adding_button, 0, row, 1, 1); |
373 | 156 | if(sp.queries ().size == 0) { | 156 | if(sp.queries ().size == 0) { |
374 | 157 | add_row (); | 157 | add_row (); |
375 | 158 | } | 158 | } |
376 | 159 | foreach(SmartPlaylistEditorQuery speq in queries_list) { | 159 | foreach(SmartPlaylistEditorQuery speq in queries_list) { |
377 | 160 | speq.field_changed (false); | 160 | speq.field_changed (false); |
378 | 161 | } | 161 | } |
381 | 162 | add_button.clicked.connect (add_button_click); | 162 | adding_button.clicked.connect (add_button_click); |
382 | 163 | add_button.show (); | 163 | adding_button.show (); |
383 | 164 | // Validate initial state | 164 | // Validate initial state |
384 | 165 | name_changed (); | 165 | name_changed (); |
385 | 166 | } | 166 | } |
386 | @@ -183,15 +183,15 @@ | |||
387 | 183 | } | 183 | } |
388 | 184 | 184 | ||
389 | 185 | public void add_row () { | 185 | public void add_row () { |
392 | 186 | if (add_button.parent != null) | 186 | if (adding_button.parent != null) |
393 | 187 | queries_grid.remove (add_button); | 187 | queries_grid.remove (adding_button); |
394 | 188 | var editor_query = new SmartPlaylistEditorQuery (new SmartQuery()); | 188 | var editor_query = new SmartPlaylistEditorQuery (new SmartQuery()); |
395 | 189 | editor_query.removed.connect (() => {queries_list.remove (editor_query);}); | 189 | editor_query.removed.connect (() => {queries_list.remove (editor_query);}); |
396 | 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);}); |
397 | 191 | queries_grid.attach (editor_query.grid, 0, row, 1, 1); | 191 | queries_grid.attach (editor_query.grid, 0, row, 1, 1); |
398 | 192 | editor_query.grid.show (); | 192 | editor_query.grid.show (); |
399 | 193 | row++; | 193 | row++; |
401 | 194 | queries_grid.attach (add_button, 0, row, 1, 1); | 194 | queries_grid.attach (adding_button, 0, row, 1, 1); |
402 | 195 | editor_query.field_changed (false); | 195 | editor_query.field_changed (false); |
403 | 196 | } | 196 | } |
404 | 197 | 197 | ||
405 | @@ -246,8 +246,7 @@ | |||
406 | 246 | _q = q; | 246 | _q = q; |
407 | 247 | 247 | ||
408 | 248 | comparators = new GLib.HashTable<int, SmartQuery.ComparatorType> (null, null); | 248 | comparators = new GLib.HashTable<int, SmartQuery.ComparatorType> (null, null); |
411 | 249 | 249 | ||
410 | 250 | grid = new Gtk.Grid (); | ||
412 | 251 | field_combobox = new Gtk.ComboBoxText (); | 250 | field_combobox = new Gtk.ComboBoxText (); |
413 | 252 | comparator_combobox = new Gtk.ComboBoxText(); | 251 | comparator_combobox = new Gtk.ComboBoxText(); |
414 | 253 | value_entry = new Gtk.Entry (); | 252 | value_entry = new Gtk.Entry (); |
415 | @@ -286,9 +285,10 @@ | |||
416 | 286 | } else { | 285 | } else { |
417 | 287 | _valueNumerical.set_value (int.parse (q.value)); | 286 | _valueNumerical.set_value (int.parse (q.value)); |
418 | 288 | } | 287 | } |
419 | 289 | |||
420 | 290 | _units = new Gtk.Label (""); | 288 | _units = new Gtk.Label (""); |
422 | 291 | 289 | ||
423 | 290 | grid = new Gtk.Grid (); | ||
424 | 291 | grid.column_spacing = 12; | ||
425 | 292 | grid.hexpand = true; | 292 | grid.hexpand = true; |
426 | 293 | grid.attach (field_combobox, 0, 0, 1, 1); | 293 | grid.attach (field_combobox, 0, 0, 1, 1); |
427 | 294 | grid.attach (comparator_combobox, 1, 0, 1, 1); | 294 | grid.attach (comparator_combobox, 1, 0, 1, 1); |
428 | @@ -441,4 +441,4 @@ | |||
429 | 441 | return (compared == SmartQuery.FieldType.LAST_PLAYED || compared == SmartQuery.FieldType.DATE_ADDED | 441 | return (compared == SmartQuery.FieldType.LAST_PLAYED || compared == SmartQuery.FieldType.DATE_ADDED |
430 | 442 | || compared == SmartQuery.FieldType.DATE_RELEASED); | 442 | || compared == SmartQuery.FieldType.DATE_RELEASED); |
431 | 443 | } | 443 | } |
433 | 444 | } | 444 | } |
434 | 445 | \ No newline at end of file | 445 | \ No newline at end of file |
435 | 446 | 446 | ||
436 | === modified file 'src/LibraryWindow.vala' | |||
437 | --- src/LibraryWindow.vala 2014-03-14 15:48:01 +0000 | |||
438 | +++ src/LibraryWindow.vala 2014-03-16 21:07:17 +0000 | |||
439 | @@ -285,8 +285,8 @@ | |||
440 | 285 | headerbar.pack_start (nextButton); | 285 | headerbar.pack_start (nextButton); |
441 | 286 | headerbar.pack_start (viewSelector); | 286 | headerbar.pack_start (viewSelector); |
442 | 287 | headerbar.set_custom_title (topDisplayBin); | 287 | headerbar.set_custom_title (topDisplayBin); |
443 | 288 | headerbar.pack_end (((Noise.App) GLib.Application.get_default ()).create_appmenu (settingsMenu)); | ||
444 | 288 | headerbar.pack_end (searchField); | 289 | headerbar.pack_end (searchField); |
445 | 289 | headerbar.pack_end (((Noise.App) GLib.Application.get_default ()).create_appmenu (settingsMenu)); | ||
446 | 290 | headerbar.show_all (); | 290 | headerbar.show_all (); |
447 | 291 | 291 | ||
448 | 292 | 292 | ||
449 | @@ -1130,7 +1130,7 @@ | |||
450 | 1130 | preferences = new PreferencesWindow(this); | 1130 | preferences = new PreferencesWindow(this); |
451 | 1131 | preferences.show_all (); | 1131 | preferences.show_all (); |
452 | 1132 | preferences.run (); | 1132 | preferences.run (); |
454 | 1133 | preferences.hide (); | 1133 | preferences = null; |
455 | 1134 | } | 1134 | } |
456 | 1135 | 1135 | ||
457 | 1136 | public void setMusicFolder(string folder) { | 1136 | public void setMusicFolder(string folder) { |
458 | 1137 | 1137 | ||
459 | === modified file 'src/Widgets/StatusBar.vala' | |||
460 | --- src/Widgets/StatusBar.vala 2014-02-02 11:47:19 +0000 | |||
461 | +++ src/Widgets/StatusBar.vala 2014-03-16 21:07:17 +0000 | |||
462 | @@ -218,12 +218,6 @@ | |||
463 | 218 | private class InfoPanelChooser : SimpleOptionChooser { | 218 | private class InfoPanelChooser : SimpleOptionChooser { |
464 | 219 | 219 | ||
465 | 220 | public InfoPanelChooser () { | 220 | public InfoPanelChooser () { |
466 | 221 | //To avoid the InfoPanelChooser to overlap with the window resize grip | ||
467 | 222 | //Get the grip width | ||
468 | 223 | int resize_grip_width; | ||
469 | 224 | App.main_window.style_get ("resize-grip-width", out resize_grip_width); | ||
470 | 225 | //Use the actual grip width as right margin | ||
471 | 226 | margin_right = resize_grip_width; | ||
472 | 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); |
473 | 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); |
474 | 229 | 223 |
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.