Merge lp:~ricotz/plank/dock-hovertext into lp:plank
- dock-hovertext
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1461 | ||||
Proposed branch: | lp:~ricotz/plank/dock-hovertext | ||||
Merge into: | lp:plank | ||||
Diff against target: |
253 lines (+97/-1) 11 files modified
docklets/Trash/TrashDockItem.vala (+5/-0) lib/DragManager.vala (+23/-0) lib/Items/ApplicationDockItem.vala (+8/-0) lib/Items/DockElement.vala (+10/-0) lib/Items/PlaceholderDockItem.vala (+5/-0) lib/PositionManager.vala (+29/-0) lib/Widgets/DockWindow.vala (+3/-0) lib/libplank.symbols (+2/-0) po/POTFILES.in (+1/-0) po/POTFILES.skip (+1/-0) po/plank.pot (+10/-1) |
||||
To merge this branch: | bzr merge lp:~ricotz/plank/dock-hovertext | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Docky Core | Pending | ||
Review via email: mp+276844@code.launchpad.net |
Commit message
Description of the change
- 1430. By Rico Tzschichholz
-
settings: Use unowned var and avoid ref'ing in loop
- 1431. By Rico Tzschichholz
-
docklets: Move to public API
- 1432. By Rico Tzschichholz
-
docklets: Make Docklet an interface and do follow up changes
- 1433. By Rico Tzschichholz
-
Add non-functional docklets-gui
- 1434. By Rico Tzschichholz
-
docs: Fix build
- 1435. By Rico Tzschichholz
-
build: Fix make distcheck
- 1436. By Rico Tzschichholz
-
tests: Set PLANK_DOCKLET_DIRS to docklets builddir for test-environment
- 1437. By Rico Tzschichholz
-
build: Add "run" target for conveniently running plank uninstalled
So running "make run" from the top_builddir will start the just built
plank with the required environment variables to actually pick things up
from the current builddir. - 1438. By Rico Tzschichholz
-
services: Don't leak array-container of ObjectClass.
list_properties () ObjectClass.
list_properties () transfers the container which needs to be
freed. If valac 0.26 is availble this can be managed. - 1439. By Rico Tzschichholz
-
preferences: Cache various strings to avoid retrieving them several times
- 1440. By Rico Tzschichholz
-
settings: Cache class-type-name string
- 1441. By Rico Tzschichholz
-
tests: Make sure to use "test1" as dock-name
- 1442. By Rico Tzschichholz
-
dockitem: Don't leak array-container of ObjectClass.
list_properties () - 1443. By Rico Tzschichholz
-
Add methods to check some desktop environment types
- 1444. By Rico Tzschichholz
-
trash: Implement perform_
empty_trash( ) Only try using Nautilus on "GNOME" and "Unity" enviroments
- 1445. By Rico Tzschichholz
-
theme: Add "CascadeHide" option
If true it will cause background and icons to unhide/hide with different
speeds so they will leave/hit the screen-edge at the same time. - 1446. By Rico Tzschichholz
-
po: Update translations
- 1447. By Rico Tzschichholz
-
dragmanager: Don't grab input and abort this drag if DragItem is null
- 1448. By Rico Tzschichholz
-
dockwindow: Be more persuasive to get the window where is should be
- 1449. By Rico Tzschichholz
-
po: Update translations
- 1450. By Rico Tzschichholz
-
Use fixed ObjectClass.
list_properties () of valac 0.31/32 if available - 1451. By Rico Tzschichholz
-
dockitem: Actually use internal constant ITEM_INVALID_
DURATION - 1452. By Rico Tzschichholz
-
po: Make use of "translator-
credits" for Gtk.AboutDialog - 1453. By Rico Tzschichholz
-
po: Update translations
- 1454. By Rico Tzschichholz
-
lib: Add internal compatibility wrapper for gtk+ 3.19.1+
- 1455. By Rico Tzschichholz
-
widgets: Adjust custom widgets for gtk+ 3.19.1+
- 1456. By Rico Tzschichholz
-
theme: Create and use custom Gtk.StyleContext
- 1457. By Rico Tzschichholz
-
dragmanager: Better handling if the actual selection-data is null
- 1458. By Rico Tzschichholz
-
dockitem: Only use file-monitor for "file:/
/"-icon- files - 1459. By Rico Tzschichholz
-
build: Add "run-debug" target for running plank uninstalled within gdb
- 1460. By Rico Tzschichholz
-
lib: Move HoverWindow instance into DockController
- 1461. By Rico Tzschichholz
-
dragmanager: Show descriptive tooltip on external-dnd actions
Preview Diff
1 | === modified file 'docklets/Trash/TrashDockItem.vala' |
2 | --- docklets/Trash/TrashDockItem.vala 2015-11-14 15:42:41 +0000 |
3 | +++ docklets/Trash/TrashDockItem.vala 2015-12-09 09:31:24 +0000 |
4 | @@ -117,6 +117,11 @@ |
5 | return AnimationType.NONE; |
6 | } |
7 | |
8 | + public override string get_drop_text () |
9 | + { |
10 | + return _("Drop to move to Trash"); |
11 | + } |
12 | + |
13 | protected override bool can_accept_drop (Gee.ArrayList<string> uris) |
14 | { |
15 | bool accepted = false; |
16 | |
17 | === modified file 'lib/DragManager.vala' |
18 | --- lib/DragManager.vala 2015-12-07 12:47:09 +0000 |
19 | +++ lib/DragManager.vala 2015-12-09 09:31:24 +0000 |
20 | @@ -359,6 +359,8 @@ |
21 | // Perform persistent write of dock-preference |
22 | controller.prefs.apply (); |
23 | |
24 | + controller.hover.hide (); |
25 | + |
26 | // Force last redraw for InternalDrag |
27 | controller.renderer.animated_draw (); |
28 | |
29 | @@ -386,6 +388,8 @@ |
30 | Gdk.threads_add_idle (() => { |
31 | ExternalDragActive = false; |
32 | |
33 | + controller.hover.hide (); |
34 | + |
35 | // If an item was hovered we need it in drag_drop, |
36 | // so reset HoveredItem here not earlier. |
37 | controller.window.update_hovered (-1, -1); |
38 | @@ -451,6 +455,25 @@ |
39 | Gdk.drag_status (context, Gdk.DragAction.COPY, time_); |
40 | } |
41 | |
42 | + if (ExternalDragActive) { |
43 | + unowned PositionManager position_manager = controller.position_manager; |
44 | + unowned DockItem hovered_item = window.HoveredItem; |
45 | + unowned HoverWindow hover = controller.hover; |
46 | + if (hovered_item != null && hovered_item.can_accept_drop (drag_data)) { |
47 | + int hx, hy; |
48 | + position_manager.get_hover_position (hovered_item, out hx, out hy); |
49 | + hover.set_text (hovered_item.get_drop_text ()); |
50 | + hover.show_at (hx, hy, position_manager.Position); |
51 | + } else if (hide_manager.Hovered) { |
52 | + int hx = x, hy = y; |
53 | + position_manager.get_hover_position_at (ref hx, ref hy); |
54 | + hover.set_text (_("Drop to add to dock")); |
55 | + hover.show_at (hx, hy, position_manager.Position); |
56 | + } else { |
57 | + hover.hide (); |
58 | + } |
59 | + } |
60 | + |
61 | controller.renderer.update_local_cursor (x, y); |
62 | hide_manager.update_hovered_with_coords (x, y); |
63 | window.update_hovered (x, y); |
64 | |
65 | === modified file 'lib/Items/ApplicationDockItem.vala' |
66 | --- lib/Items/ApplicationDockItem.vala 2015-01-19 13:06:17 +0000 |
67 | +++ lib/Items/ApplicationDockItem.vala 2015-12-09 09:31:24 +0000 |
68 | @@ -525,6 +525,14 @@ |
69 | /** |
70 | * {@inheritDoc} |
71 | */ |
72 | + public override string get_drop_text () |
73 | + { |
74 | + return _("Drop to open with %s").printf (Text); |
75 | + } |
76 | + |
77 | + /** |
78 | + * {@inheritDoc} |
79 | + */ |
80 | public override bool can_accept_drop (Gee.ArrayList<string> uris) |
81 | { |
82 | if (uris == null || is_window ()) |
83 | |
84 | === modified file 'lib/Items/DockElement.vala' |
85 | --- lib/Items/DockElement.vala 2015-11-03 10:37:19 +0000 |
86 | +++ lib/Items/DockElement.vala 2015-12-09 09:31:24 +0000 |
87 | @@ -219,6 +219,16 @@ |
88 | } |
89 | |
90 | /** |
91 | + * The item's text for drop actions. |
92 | + * |
93 | + * @return the item's drop-text |
94 | + */ |
95 | + public virtual string get_drop_text () |
96 | + { |
97 | + return ""; |
98 | + } |
99 | + |
100 | + /** |
101 | * Returns if this item can be removed from the dock. |
102 | * |
103 | * @return if this item can be removed from the dock |
104 | |
105 | === modified file 'lib/Items/PlaceholderDockItem.vala' |
106 | --- lib/Items/PlaceholderDockItem.vala 2015-11-03 10:37:19 +0000 |
107 | +++ lib/Items/PlaceholderDockItem.vala 2015-12-09 09:31:24 +0000 |
108 | @@ -46,6 +46,11 @@ |
109 | return AnimationType.NONE; |
110 | } |
111 | |
112 | + public override string get_drop_text () |
113 | + { |
114 | + return _("Drop to add to dock"); |
115 | + } |
116 | + |
117 | /** |
118 | * {@inheritDoc} |
119 | */ |
120 | |
121 | === modified file 'lib/PositionManager.vala' |
122 | --- lib/PositionManager.vala 2015-11-16 20:45:10 +0000 |
123 | +++ lib/PositionManager.vala 2015-12-09 09:31:24 +0000 |
124 | @@ -1273,6 +1273,35 @@ |
125 | } |
126 | |
127 | /** |
128 | + * Get's the x and y position to display a hover window for the given coordinates. |
129 | + * |
130 | + * @param x the resulting x position |
131 | + * @param y the resulting y position |
132 | + */ |
133 | + public void get_hover_position_at (ref int x, ref int y) |
134 | + { |
135 | + // Any element will suffice since only the constant coordinate of center is used |
136 | + var center = get_draw_value_for_item (controller.VisibleItems.first ()).static_center; |
137 | + var offset = (ZoomIconSize - IconSize / 2.0); |
138 | + |
139 | + switch (Position) { |
140 | + default: |
141 | + case Gtk.PositionType.BOTTOM: |
142 | + y = (int) Math.round (center.y + win_y - offset); |
143 | + break; |
144 | + case Gtk.PositionType.TOP: |
145 | + y = (int) Math.round (center.y + win_y + offset); |
146 | + break; |
147 | + case Gtk.PositionType.LEFT: |
148 | + x = (int) Math.round (center.x + win_x + offset); |
149 | + break; |
150 | + case Gtk.PositionType.RIGHT: |
151 | + x = (int) Math.round (center.x + win_x - offset); |
152 | + break; |
153 | + } |
154 | + } |
155 | + |
156 | + /** |
157 | * Get's the x and y position to display the urgent-glow for a dock item. |
158 | * |
159 | * @param item the item to show urgent-glow for |
160 | |
161 | === modified file 'lib/Widgets/DockWindow.vala' |
162 | --- lib/Widgets/DockWindow.vala 2015-12-08 09:57:47 +0000 |
163 | +++ lib/Widgets/DockWindow.vala 2015-12-09 09:31:24 +0000 |
164 | @@ -354,6 +354,9 @@ |
165 | hover_reposition_timer_id = 0U; |
166 | } |
167 | |
168 | + if (controller.drag_manager.ExternalDragActive) |
169 | + return; |
170 | + |
171 | controller.hover.hide (); |
172 | |
173 | if (HoveredItem == null || controller.drag_manager.InternalDragActive) |
174 | |
175 | === modified file 'lib/libplank.symbols' |
176 | --- lib/libplank.symbols 2015-12-08 09:57:47 +0000 |
177 | +++ lib/libplank.symbols 2015-12-09 09:31:24 +0000 |
178 | @@ -158,6 +158,7 @@ |
179 | plank_dock_element_get_ClickedAnimation |
180 | plank_dock_element_get_Container |
181 | plank_dock_element_get_dock |
182 | +plank_dock_element_get_drop_text |
183 | plank_dock_element_get_HoveredAnimation |
184 | plank_dock_element_get_IsAttached |
185 | plank_dock_element_get_IsVisible |
186 | @@ -527,6 +528,7 @@ |
187 | plank_position_manager_get_GlowSize |
188 | plank_position_manager_get_HorizPadding |
189 | plank_position_manager_get_hover_position |
190 | +plank_position_manager_get_hover_position_at |
191 | plank_position_manager_get_hover_region_for_element |
192 | plank_position_manager_get_icon_geometry |
193 | plank_position_manager_get_IconShadowSize |
194 | |
195 | === modified file 'po/POTFILES.in' |
196 | --- po/POTFILES.in 2015-12-05 16:23:35 +0000 |
197 | +++ po/POTFILES.in 2015-12-09 09:31:24 +0000 |
198 | @@ -1,6 +1,7 @@ |
199 | data/plank.appdata.xml.in |
200 | data/plank.desktop.in |
201 | [type: gettext/glade]data/ui/preferences.ui |
202 | +lib/DragManager.vala |
203 | lib/Factories/AbstractMain.vala |
204 | lib/Items/ApplicationDockItem.vala |
205 | lib/Items/FileDockItem.vala |
206 | |
207 | === modified file 'po/POTFILES.skip' |
208 | --- po/POTFILES.skip 2015-12-05 16:23:35 +0000 |
209 | +++ po/POTFILES.skip 2015-12-09 09:31:24 +0000 |
210 | @@ -8,6 +8,7 @@ |
211 | docklets/Desktop/DesktopDocklet.c |
212 | docklets/Trash/TrashDockItem.c |
213 | docklets/Trash/TrashDocklet.c |
214 | +lib/DragManager.c |
215 | lib/Factories/AbstractMain.c |
216 | lib/Items/ApplicationDockItem.c |
217 | lib/Items/FileDockItem.c |
218 | |
219 | === modified file 'po/plank.pot' |
220 | --- po/plank.pot 2015-12-05 16:23:35 +0000 |
221 | +++ po/plank.pot 2015-12-09 09:31:24 +0000 |
222 | @@ -8,7 +8,7 @@ |
223 | msgstr "" |
224 | "Project-Id-Version: PACKAGE VERSION\n" |
225 | "Report-Msgid-Bugs-To: \n" |
226 | -"POT-Creation-Date: 2015-12-05 17:20+0100\n" |
227 | +"POT-Creation-Date: 2015-12-08 12:05+0100\n" |
228 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
229 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
230 | "Language-Team: LANGUAGE <LL@li.org>\n" |
231 | @@ -180,6 +180,10 @@ |
232 | msgid "Docklets" |
233 | msgstr "" |
234 | |
235 | +#: ../lib/DragManager.vala:470 ../lib/Items/PlaceholderDockItem.vala:51 |
236 | +msgid "Drop to add to dock" |
237 | +msgstr "" |
238 | + |
239 | #: ../lib/Factories/AbstractMain.vala:388 ../src/Main.vala:75 |
240 | msgid "translator-credits" |
241 | msgstr "" |
242 | @@ -197,6 +201,11 @@ |
243 | msgid "_Close" |
244 | msgstr "" |
245 | |
246 | +#: ../lib/Items/ApplicationDockItem.vala:530 |
247 | +#, c-format |
248 | +msgid "Drop to open with %s" |
249 | +msgstr "" |
250 | + |
251 | #: ../lib/Items/FileDockItem.vala:332 |
252 | msgid "_Open in File Browser" |
253 | msgstr "" |