~aleksandr-rakov/pantheon-dock/pantheon-dock

« back to all changes in this revision

Viewing changes to lib/DockRenderer.vala

  • Committer: Rico Tzschichholz
  • Date: 2013-05-28 17:43:01 UTC
  • Revision ID: ricotz@ubuntu.com-20130528174301-zqisobxkbm8j9gka
dockrenderer: Rename get_hide_offset() to get_hide_progress()

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
                uint reset_position_manager_timer = 0;
53
53
                
54
54
                /**
55
 
                 * Returns an offset (as a percent) based on the current hide animation state.
 
55
                 * Returns the current progress of the hide-animation of the dock.
56
56
                 *
57
 
                 * @return the offset (as a percent)
 
57
                 * @return the hide-animation progress [0.0..1.0]
58
58
                 */
59
 
                public double get_hide_offset ()
 
59
                public double get_hide_progress ()
60
60
                {
61
61
                        if (!screen_is_composited)
62
62
                                return 0;
68
68
                
69
69
                double get_opacity ()
70
70
                {
71
 
                        return double.min (1, (1 - get_hide_offset ()) + theme.FadeOpacity);
 
71
                        return double.min (1.0, (1.0 - get_hide_progress ()) + theme.FadeOpacity);
72
72
                }
73
73
                
74
74
                /**
318
318
                        cr.paint ();
319
319
                        
320
320
                        // draw urgent-glow if dock is completely hidden
321
 
                        if (get_hide_offset () == 1) {
 
321
                        if (get_hide_progress () == 1.0) {
322
322
                                foreach (var item in items)
323
323
                                        draw_urgent_glow (item, cr);
324
324
                        }
697
697
                                        return true;
698
698
                                if (render_time.difference (item.LastActive) <= theme.ActiveTime * 1000)
699
699
                                        return true;
700
 
                                if (render_time.difference (item.LastUrgent) <= (get_hide_offset () == 1.0 ? theme.GlowTime : theme.UrgentBounceTime) * 1000)
 
700
                                if (render_time.difference (item.LastUrgent) <= (get_hide_progress () == 1.0 ? theme.GlowTime : theme.UrgentBounceTime) * 1000)
701
701
                                        return true;
702
702
                        }
703
703