Merge lp:~victored/pantheon-files/lp-1418653 into lp:~elementary-apps/pantheon-files/trunk

Proposed by Victor Martinez
Status: Merged
Approved by: Cody Garver
Approved revision: 1879
Merged at revision: 1879
Proposed branch: lp:~victored/pantheon-files/lp-1418653
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 180 lines (+5/-120)
4 files modified
libwidgets/CMakeLists.txt (+0/-1)
libwidgets/PoofWindow.vala (+0/-117)
src/CMakeLists.txt (+3/-0)
src/View/Sidebar.vala (+2/-2)
To merge this branch: bzr merge lp:~victored/pantheon-files/lp-1418653
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+264496@code.launchpad.net

Commit message

Use PoofWindow from LibPlank

Description of the change

Use PoofWindow from LibPlank

This implies adding libplank-dev as a build dependency and libplank0 as a runtime dependency

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libwidgets/CMakeLists.txt'
2--- libwidgets/CMakeLists.txt 2014-08-05 23:34:45 +0000
3+++ libwidgets/CMakeLists.txt 2015-07-12 16:24:24 +0000
4@@ -39,7 +39,6 @@
5 vala_precompile(VALA_C ${PKGNAME}
6 Animations.vala
7 LocationBar.vala
8- PoofWindow.vala
9 BreadcrumbsElements.vala
10 PACKAGES
11 gtk+-3.0
12
13=== removed file 'libwidgets/PoofWindow.vala'
14--- libwidgets/PoofWindow.vala 2015-05-03 06:44:42 +0000
15+++ libwidgets/PoofWindow.vala 1970-01-01 00:00:00 +0000
16@@ -1,117 +0,0 @@
17-/***
18- Copyright (C) 2011-2012 Robert Dyer, Rico Tzschichholz
19-
20- This program is free software: you can redistribute it and/or modify
21- it under the terms of the GNU General Public License as published by
22- the Free Software Foundation, either version 3 of the License, or
23- (at your option) any later version.
24-
25- This program is distributed in the hope that it will be useful,
26- but WITHOUT ANY WARRANTY; without even the implied warranty of
27- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28- GNU General Public License for more details.
29-
30- You should have received a copy of the GNU General Public License
31- along with this program. If not, see <http://www.gnu.org/licenses/>.
32-***/
33-
34-namespace Marlin.Animation
35-{
36- /**
37- * An animated window that draws a 'poof' animation.
38- * Used when dragging items off the dock.
39- */
40- public class PoofWindow : Gtk.Window {
41- const int POOF_SIZE = 128;
42- const int POOF_FRAMES = 5;
43- const int MSEC_PER_FRAME = 60;
44- int frame_number = 0;
45-
46- static PoofWindow? instance = null;
47-
48- public static unowned PoofWindow get_default () {
49- if (instance == null)
50- instance = new PoofWindow ();
51-
52- return instance;
53- }
54-
55- Gdk.Pixbuf poof_image;
56-
57- uint animation_timer = 0;
58-
59- /**
60- * Creates a new poof window at the screen-relative coordinates specified.
61- */
62- public PoofWindow () {
63- GLib.Object (type: Gtk.WindowType.TOPLEVEL, type_hint: Gdk.WindowTypeHint.DOCK);
64- }
65-
66- construct {
67- app_paintable = true;
68- decorated = false;
69- resizable = false;
70- double_buffered = false;
71-
72- unowned Gdk.Screen screen = get_screen ();
73- set_visual (screen.get_rgba_visual () ?? screen.get_system_visual ());
74- accept_focus = false;
75- can_focus = false;
76- set_keep_above (true);
77-
78- try {
79- poof_image = new Gdk.Pixbuf.from_file ("%s/poof.png".printf (Config.PIXMAP_DIR));
80- } catch {
81- poof_image = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8, 128, 640);
82- warning ("Unable to load poof animation image");
83- }
84-
85- set_size_request (POOF_SIZE, POOF_SIZE);
86- }
87-
88- ~PoofWindow () {
89- if (animation_timer > 0) {
90- GLib.Source.remove (animation_timer);
91- animation_timer = 0;
92- }
93- }
94-
95- /**
96- * Show the animated poof-window at the given coordinates
97- *
98- * @param x the x position of the poof window
99- * @param y the y position of the poof window
100- */
101- public void show_at (int x, int y) {
102- if (animation_timer > 0)
103- GLib.Source.remove (animation_timer);
104-
105- frame_number = 0;
106-
107- show ();
108- move (x - (POOF_SIZE / 2), y - (POOF_SIZE / 2));
109-
110- animation_timer = Gdk.threads_add_timeout (MSEC_PER_FRAME, () => {
111- if (frame_number++ < POOF_FRAMES) {
112- queue_draw ();
113- return true;
114- }
115-
116- animation_timer = 0;
117- hide ();
118- return false;
119- });
120- }
121-
122- public override bool draw (Cairo.Context cr) {
123- cr.set_operator (Cairo.Operator.SOURCE);
124- Gdk.cairo_set_source_pixbuf (cr,
125- poof_image,
126- 0,
127- -POOF_SIZE * frame_number);
128- cr.paint ();
129-
130- return true;
131- }
132- }
133-}
134
135=== modified file 'src/CMakeLists.txt'
136--- src/CMakeLists.txt 2015-01-18 20:46:03 +0000
137+++ src/CMakeLists.txt 2015-07-12 16:24:24 +0000
138@@ -26,6 +26,7 @@
139 sqlite3
140 dbus-glib-1
141 libnotify>=0.7.2
142+ plank
143 zeitgeist-2.0)
144
145 set (CFLAGS
146@@ -98,6 +99,7 @@
147 pantheon-files-widgets
148 marlin
149 zeitgeist-2.0
150+ plank
151 GENERATE_HEADER
152 marlin-vala
153 OPTIONS
154@@ -163,6 +165,7 @@
155 pantheon-files-widgets
156 marlin
157 zeitgeist-2.0
158+ plank
159 GENERATE_HEADER
160 marlin-vala
161 OPTIONS
162
163=== modified file 'src/View/Sidebar.vala'
164--- src/View/Sidebar.vala 2015-06-24 07:49:31 +0000
165+++ src/View/Sidebar.vala 2015-07-12 16:24:24 +0000
166@@ -717,12 +717,12 @@
167 private bool drag_failed_callback (Gdk.DragContext context, Gtk.DragResult result) {
168 int x, y;
169 Gdk.Device device;
170- Marlin.Animation.PoofWindow poof_window;
171+ Plank.Widgets.PoofWindow poof_window;
172
173 if (internal_drag_started && dragged_out_of_window) {
174 device = context.get_device ();
175 device.get_position (null, out x, out y);
176- poof_window = Marlin.Animation.PoofWindow.get_default ();
177+ poof_window = Plank.Widgets.PoofWindow.get_default ();
178 poof_window.show_at (x, y);
179 remove_selected_bookmarks ();
180 return true;

Subscribers

People subscribed via source and target branches

to all changes: