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
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2014-08-05 22:25:44 +0000
3+++ src/CMakeLists.txt 2014-09-27 22:37:33 +0000
4@@ -78,7 +78,6 @@
5
6 set (CLIENT_VALAC_OPTIONS
7 ${GLOBAL_VALAC_OPTIONS}
8- --define=USE_GRANITE_DECORATED_WINDOW
9 #--define=HAVE_ADD_PLAYLIST_AS_BUTTON
10 #--define=HAVE_SMART_ALBUM_COLUMN
11 #--define=ENABLE_EXPERIMENTAL
12@@ -106,4 +105,4 @@
13
14 target_link_libraries (${EXEC_NAME} ${DEPS_LIBRARIES})
15
16-install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
17+install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
18\ No newline at end of file
19
20=== modified file 'src/Views/GridView/PopupListView.vala'
21--- src/Views/GridView/PopupListView.vala 2014-04-27 19:34:14 +0000
22+++ src/Views/GridView/PopupListView.vala 2014-09-27 22:37:33 +0000
23@@ -17,13 +17,9 @@
24 * Scott Ringwelski <sgringwe@mtu.edu>
25 */
26
27-#if USE_GRANITE_DECORATED_WINDOW
28-public class Noise.PopupListView : Granite.Widgets.DecoratedWindow {
29-#else
30-public class Noise.PopupListView : Window {
31-#endif
32+public class Noise.PopupListView : Gtk.Dialog {
33
34- public const int MIN_SIZE = 400;
35+ public const int MIN_SIZE = 500;
36
37 ViewWrapper view_wrapper;
38
39@@ -36,38 +32,13 @@
40 Gee.Collection<Media> media_list;
41
42 public PopupListView (GridView grid_view) {
43-#if USE_GRANITE_DECORATED_WINDOW
44- base ("", "album-list-view", "album-list-view");
45-
46- // Don't destroy the window
47 this.delete_event.connect (hide_on_delete);
48-
49- // Hide titlebar (we want to set a title, but not showing it!)
50- this.show_title = false;
51- // We have to fullscreen it otherwise it's not shown on fullscreen mode
52- fullscreen ();
53-#else
54 window_position = Gtk.WindowPosition.CENTER_ON_PARENT;
55
56 // window stuff
57- decorated = false;
58 has_resize_grip = false;
59 resizable = false;
60
61- // close button
62- var close = new Gtk.Button ();
63- get_style_context ().add_class ("album-list-view");
64- close.get_style_context().add_class("close-button");
65- close.set_image (Icons.render_image ("window-close-symbolic", Gtk.IconSize.MENU));
66- close.hexpand = close.vexpand = false;
67- close.halign = Gtk.Align.START;
68- close.set_relief(Gtk.ReliefStyle.NONE);
69- close.clicked.connect( () => { this.hide(); });
70-
71- /* Make window draggable */
72- UI.make_window_draggable (this);
73-#endif
74-
75 this.view_wrapper = grid_view.parent_view_wrapper;
76
77 set_transient_for (App.main_window);
78@@ -79,8 +50,7 @@
79 album_label = new Gtk.Label ("");
80 artist_label = new Gtk.Label ("");
81
82- // Apply special style: Level-2 header
83- Granite.Widgets.Utils.apply_text_style_to_label (Granite.TextStyle.H2, album_label);
84+ album_label.get_style_context ().add_class ("h2");
85
86 album_label.ellipsize = Pango.EllipsizeMode.END;
87 artist_label.ellipsize = Pango.EllipsizeMode.END;
88@@ -111,16 +81,11 @@
89 rating.margin_top = rating.margin_bottom = 16;
90
91 // Add everything
92- var vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
93-#if !USE_GRANITE_DECORATED_WINDOW
94- vbox.pack_start (close, false, false, 0);
95-#endif
96- vbox.pack_start (album_label, false, true, 0);
97- vbox.pack_start (artist_label, false, true, 0);
98- vbox.pack_start (list_view_scrolled, true, true, 0);
99- vbox.pack_start(rating, false, true, 0);
100-
101- add(vbox);
102+ Gtk.Box content = get_content_area () as Gtk.Box;
103+ content.pack_start (album_label, false, true, 0);
104+ content.pack_start (artist_label, false, true, 0);
105+ content.pack_start (list_view_scrolled, true, true, 0);
106+ content.pack_start(rating, false, true, 0);
107
108 rating.rating_changed.connect(rating_changed);
109 }
110@@ -266,4 +231,4 @@
111 {
112 minimum_height = natural_height = width;
113 }
114-}
115+}
116\ No newline at end of file

Subscribers

People subscribed via source and target branches