Merge lp:~elementary-apps/noise/popuplistdialog into lp:~elementary-apps/noise/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: Cody Garver
Approved revision: 1684
Merged at revision: 1689
Proposed branch: lp:~elementary-apps/noise/popuplistdialog
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 116 lines (+10/-46)
2 files modified
src/CMakeLists.txt (+1/-2)
src/Views/GridView/PopupListView.vala (+9/-44)
To merge this branch: bzr merge lp:~elementary-apps/noise/popuplistdialog
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+236239@code.launchpad.net

Commit message

Port PopUpListView from Granite decorated window to Gtk.Dialog

Description of the change

Port PopUpListView from Granite decorated window to Gtk.Dialog

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

There's no close button

Revision history for this message
Cody Garver (codygarver) wrote :

My bad, had CSD disabled

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2014-08-05 22:25:44 +0000
+++ src/CMakeLists.txt 2014-09-27 22:37:33 +0000
@@ -78,7 +78,6 @@
7878
79set (CLIENT_VALAC_OPTIONS79set (CLIENT_VALAC_OPTIONS
80 ${GLOBAL_VALAC_OPTIONS}80 ${GLOBAL_VALAC_OPTIONS}
81 --define=USE_GRANITE_DECORATED_WINDOW
82 #--define=HAVE_ADD_PLAYLIST_AS_BUTTON81 #--define=HAVE_ADD_PLAYLIST_AS_BUTTON
83 #--define=HAVE_SMART_ALBUM_COLUMN82 #--define=HAVE_SMART_ALBUM_COLUMN
84 #--define=ENABLE_EXPERIMENTAL83 #--define=ENABLE_EXPERIMENTAL
@@ -106,4 +105,4 @@
106105
107target_link_libraries (${EXEC_NAME} ${DEPS_LIBRARIES})106target_link_libraries (${EXEC_NAME} ${DEPS_LIBRARIES})
108107
109install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})108install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
110\ No newline at end of file109\ No newline at end of file
111110
=== modified file 'src/Views/GridView/PopupListView.vala'
--- src/Views/GridView/PopupListView.vala 2014-04-27 19:34:14 +0000
+++ src/Views/GridView/PopupListView.vala 2014-09-27 22:37:33 +0000
@@ -17,13 +17,9 @@
17 * Scott Ringwelski <sgringwe@mtu.edu>17 * Scott Ringwelski <sgringwe@mtu.edu>
18 */18 */
1919
20#if USE_GRANITE_DECORATED_WINDOW20public class Noise.PopupListView : Gtk.Dialog {
21public class Noise.PopupListView : Granite.Widgets.DecoratedWindow {
22#else
23public class Noise.PopupListView : Window {
24#endif
2521
26 public const int MIN_SIZE = 400;22 public const int MIN_SIZE = 500;
2723
28 ViewWrapper view_wrapper;24 ViewWrapper view_wrapper;
2925
@@ -36,38 +32,13 @@
36 Gee.Collection<Media> media_list;32 Gee.Collection<Media> media_list;
3733
38 public PopupListView (GridView grid_view) {34 public PopupListView (GridView grid_view) {
39#if USE_GRANITE_DECORATED_WINDOW
40 base ("", "album-list-view", "album-list-view");
41
42 // Don't destroy the window
43 this.delete_event.connect (hide_on_delete);35 this.delete_event.connect (hide_on_delete);
44
45 // Hide titlebar (we want to set a title, but not showing it!)
46 this.show_title = false;
47 // We have to fullscreen it otherwise it's not shown on fullscreen mode
48 fullscreen ();
49#else
50 window_position = Gtk.WindowPosition.CENTER_ON_PARENT;36 window_position = Gtk.WindowPosition.CENTER_ON_PARENT;
5137
52 // window stuff38 // window stuff
53 decorated = false;
54 has_resize_grip = false;39 has_resize_grip = false;
55 resizable = false;40 resizable = false;
5641
57 // close button
58 var close = new Gtk.Button ();
59 get_style_context ().add_class ("album-list-view");
60 close.get_style_context().add_class("close-button");
61 close.set_image (Icons.render_image ("window-close-symbolic", Gtk.IconSize.MENU));
62 close.hexpand = close.vexpand = false;
63 close.halign = Gtk.Align.START;
64 close.set_relief(Gtk.ReliefStyle.NONE);
65 close.clicked.connect( () => { this.hide(); });
66
67 /* Make window draggable */
68 UI.make_window_draggable (this);
69#endif
70
71 this.view_wrapper = grid_view.parent_view_wrapper;42 this.view_wrapper = grid_view.parent_view_wrapper;
72 43
73 set_transient_for (App.main_window);44 set_transient_for (App.main_window);
@@ -79,8 +50,7 @@
79 album_label = new Gtk.Label ("");50 album_label = new Gtk.Label ("");
80 artist_label = new Gtk.Label ("");51 artist_label = new Gtk.Label ("");
8152
82 // Apply special style: Level-2 header53 album_label.get_style_context ().add_class ("h2");
83 Granite.Widgets.Utils.apply_text_style_to_label (Granite.TextStyle.H2, album_label);
8454
85 album_label.ellipsize = Pango.EllipsizeMode.END;55 album_label.ellipsize = Pango.EllipsizeMode.END;
86 artist_label.ellipsize = Pango.EllipsizeMode.END;56 artist_label.ellipsize = Pango.EllipsizeMode.END;
@@ -111,16 +81,11 @@
111 rating.margin_top = rating.margin_bottom = 16;81 rating.margin_top = rating.margin_bottom = 16;
11282
113 // Add everything83 // Add everything
114 var vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);84 Gtk.Box content = get_content_area () as Gtk.Box;
115#if !USE_GRANITE_DECORATED_WINDOW85 content.pack_start (album_label, false, true, 0);
116 vbox.pack_start (close, false, false, 0);86 content.pack_start (artist_label, false, true, 0);
117#endif87 content.pack_start (list_view_scrolled, true, true, 0);
118 vbox.pack_start (album_label, false, true, 0);88 content.pack_start(rating, false, true, 0);
119 vbox.pack_start (artist_label, false, true, 0);
120 vbox.pack_start (list_view_scrolled, true, true, 0);
121 vbox.pack_start(rating, false, true, 0);
122
123 add(vbox);
12489
125 rating.rating_changed.connect(rating_changed);90 rating.rating_changed.connect(rating_changed);
126 }91 }
@@ -266,4 +231,4 @@
266 {231 {
267 minimum_height = natural_height = width;232 minimum_height = natural_height = width;
268 }233 }
269}234}
270\ No newline at end of file235\ No newline at end of file

Subscribers

People subscribed via source and target branches