~ricotz/plank/consolidate-api

« back to all changes in this revision

Viewing changes to lib/Items/ApplicationDockItem.vala

  • Committer: Rico Tzschichholz
  • Date: 2015-11-03 10:37:19 UTC
  • Revision ID: ricotz@ubuntu.com-20151103103719-s2gik7a9cnove1tg
Drop nested namespaces

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
//
19
19
 
20
 
using Plank.Drawing;
21
 
using Plank.Services;
22
 
using Plank.Services.Windows;
23
 
 
24
 
namespace Plank.Items
 
20
namespace Plank
25
21
{
26
22
        /**
27
23
         * A dock item for applications (with .desktop launchers).
316
312
                
317
313
                void launch ()
318
314
                {
319
 
                        Services.System.launch (File.new_for_uri (Prefs.Launcher));
 
315
                        System.launch (File.new_for_uri (Prefs.Launcher));
320
316
                }
321
317
                
322
318
                /**
323
319
                 * {@inheritDoc}
324
320
                 */
325
 
                protected override Animation on_clicked (PopupButton button, Gdk.ModifierType mod, uint32 event_time)
 
321
                protected override AnimationType on_clicked (PopupButton button, Gdk.ModifierType mod, uint32 event_time)
326
322
                {
327
323
                        if (!is_window ())
328
324
                                if (button == PopupButton.MIDDLE
329
325
                                        || (button == PopupButton.LEFT && (App == null || WindowControl.get_num_windows (App) == 0
330
326
                                        || (mod & Gdk.ModifierType.CONTROL_MASK) == Gdk.ModifierType.CONTROL_MASK))) {
331
327
                                        launch ();
332
 
                                        return Animation.BOUNCE;
 
328
                                        return AnimationType.BOUNCE;
333
329
                                }
334
330
                        
335
331
                        if (button == PopupButton.LEFT && App != null && WindowControl.get_num_windows (App) > 0) {
336
332
                                WindowControl.smart_focus (App, event_time);
337
 
                                return Animation.DARKEN;
 
333
                                return AnimationType.DARKEN;
338
334
                        }
339
335
                        
340
 
                        return Animation.NONE;
 
336
                        return AnimationType.NONE;
341
337
                }
342
338
                
343
339
                /**
344
340
                 * {@inheritDoc}
345
341
                 */
346
 
                protected override Animation on_scrolled (Gdk.ScrollDirection direction, Gdk.ModifierType mod, uint32 event_time)
 
342
                protected override AnimationType on_scrolled (Gdk.ScrollDirection direction, Gdk.ModifierType mod, uint32 event_time)
347
343
                {
348
344
                        if (App == null || WindowControl.get_num_windows (App) == 0)
349
 
                                return Animation.NONE;
 
345
                                return AnimationType.NONE;
350
346
                        
351
347
                        if (GLib.get_monotonic_time () - LastScrolled < ITEM_SCROLL_DURATION * 1000)
352
 
                                return Animation.DARKEN;
 
348
                                return AnimationType.DARKEN;
353
349
                        
354
350
                        LastScrolled = GLib.get_monotonic_time ();
355
351
                        
358
354
                        else
359
355
                                WindowControl.focus_next (App, event_time);
360
356
                        
361
 
                        return Animation.DARKEN;
 
357
                        return AnimationType.DARKEN;
362
358
                }
363
359
                
364
360
                static void combine_strings (ref string[] result, string delimiter, int n, int i)
561
557
                        foreach (var uri in uris)
562
558
                                files.add (File.new_for_uri (uri));
563
559
                        
564
 
                        Services.System.launch_with_files (File.new_for_uri (Prefs.Launcher), files.to_array ());
 
560
                        System.launch_with_files (File.new_for_uri (Prefs.Launcher), files.to_array ());
565
561
                        
566
562
                        return true;
567
563
                }