~ricotz/plank/consolidate-api

« back to all changes in this revision

Viewing changes to lib/Widgets/DockWindow.vala

  • Committer: Rico Tzschichholz
  • Date: 2015-07-30 09:23:44 UTC
  • Revision ID: ricotz@ubuntu.com-20150730092344-n4mrkqhga9jnit53
lib: Commonize naming of fields which are holding handler/timer-ids

Adjust some explictly typed assignments too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
         */
30
30
        public class DockWindow : CompositedWindow
31
31
        {
32
 
                const uint LONG_PRESS_TIME = 750;
33
 
                const uint HOVER_DELAY_TIME = 200;
 
32
                const uint LONG_PRESS_TIME = 750U;
 
33
                const uint HOVER_DELAY_TIME = 200U;
34
34
                
35
35
                /**
36
36
                 * The controller for this dock.
64
64
                 */
65
65
                HoverWindow hover;
66
66
                
67
 
                uint hover_reposition_timer = 0;
 
67
                uint hover_reposition_timer_id = 0U;
68
68
                
69
 
                uint long_press_timer = 0;
 
69
                uint long_press_timer_id = 0U;
70
70
                bool long_press_active = false;
71
 
                uint long_press_button = 0;
 
71
                uint long_press_button = 0U;
72
72
 
73
73
                Gdk.Rectangle input_rect;
74
74
                int requested_x;
112
112
                        
113
113
                        controller.prefs.notify["HideMode"].disconnect (set_struts);
114
114
                        
115
 
                        if (hover_reposition_timer > 0) {
116
 
                                GLib.Source.remove (hover_reposition_timer);
117
 
                                hover_reposition_timer = 0;
 
115
                        if (hover_reposition_timer_id > 0U) {
 
116
                                GLib.Source.remove (hover_reposition_timer_id);
 
117
                                hover_reposition_timer_id = 0U;
118
118
                        }
119
119
                }
120
120
                
150
150
                        
151
151
                        long_press_active = false;
152
152
                        long_press_button = event.button;
153
 
                        if (long_press_timer > 0)
154
 
                                Source.remove (long_press_timer);
155
 
                        long_press_timer = Gdk.threads_add_timeout (LONG_PRESS_TIME, () => {
 
153
                        if (long_press_timer_id > 0U)
 
154
                                Source.remove (long_press_timer_id);
 
155
                        long_press_timer_id = Gdk.threads_add_timeout (LONG_PRESS_TIME, () => {
156
156
                                long_press_active = true;
157
 
                                long_press_timer = 0;
 
157
                                long_press_timer_id = 0U;
158
158
                                return false;
159
159
                        });
160
160
                        
170
170
                        if (controller.hide_manager.Hidden)
171
171
                                return Gdk.EVENT_STOP;
172
172
                        
173
 
                        if (long_press_timer > 0) {
174
 
                                Source.remove (long_press_timer);
175
 
                                long_press_timer = 0;
 
173
                        if (long_press_timer_id > 0U) {
 
174
                                Source.remove (long_press_timer_id);
 
175
                                long_press_timer_id = 0U;
176
176
                        }
177
177
                        
178
178
                        if (long_press_active && long_press_button == event.button) {
247
247
                public override void drag_begin (Gdk.DragContext context)
248
248
                {
249
249
                        long_press_active = false;
250
 
                        if (long_press_timer > 0) {
251
 
                                Source.remove (long_press_timer);
252
 
                                long_press_timer = 0;
 
250
                        if (long_press_timer_id > 0U) {
 
251
                                Source.remove (long_press_timer_id);
 
252
                                long_press_timer_id = 0U;
253
253
                        }
254
254
                }
255
255
 
338
338
                        HoveredItem = item;
339
339
                        
340
340
                        // if HoveredItem changed always stop scheduled popup and hide the tooltip
341
 
                        if (hover_reposition_timer > 0) {
342
 
                                Source.remove (hover_reposition_timer);
343
 
                                hover_reposition_timer = 0;
 
341
                        if (hover_reposition_timer_id > 0U) {
 
342
                                Source.remove (hover_reposition_timer_id);
 
343
                                hover_reposition_timer_id = 0U;
344
344
                        }
345
345
                        
346
346
                        hover.hide ();
349
349
                                return;
350
350
                        
351
351
                        // don't be that demanding this delay is still fast enough
352
 
                        hover_reposition_timer = Gdk.threads_add_timeout (HOVER_DELAY_TIME, () => {
 
352
                        hover_reposition_timer_id = Gdk.threads_add_timeout (HOVER_DELAY_TIME, () => {
353
353
                                if (HoveredItem == null) {
354
 
                                        hover_reposition_timer = 0;
 
354
                                        hover_reposition_timer_id = 0U;
355
355
                                        return false;
356
356
                                }
357
357
                                
360
360
                                        && controller.renderer.hide_progress > 0.0)
361
361
                                        return true;
362
362
                                
363
 
                                hover_reposition_timer = 0;
 
363
                                hover_reposition_timer_id = 0U;
364
364
                                
365
365
                                int x, y;
366
366
                                hover.set_text (HoveredItem.Text);