~eviltwin1/feedreader/trunk-1

« back to all changes in this revision

Viewing changes to src/Widgets/ColorCircle.vala

  • Committer: JeanLuc
  • Date: 2016-05-06 20:21:09 UTC
  • Revision ID: jangernert@gmail.com-20160506202109-u9i53qtn6y2djv36
git sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
                if(clickable)
42
42
                {
43
 
                        this.enter_notify_event.connect(() => {IconEnter(); return true;});
44
 
                        this.leave_notify_event.connect(() => {IconLeave(); return true;});
45
 
                        this.button_press_event.connect(() => {IconClicked(); return true;});
 
43
                        this.enter_notify_event.connect(IconEnter);
 
44
                        this.leave_notify_event.connect(IconLeave);
 
45
                        this.button_press_event.connect(IconClicked);
46
46
                }
47
47
 
48
48
                this.add(m_icon);
64
64
        }
65
65
 
66
66
 
67
 
        private void IconEnter()
 
67
        private bool IconEnter()
68
68
        {
69
69
                this.remove(m_icon);
70
70
                this.add(m_icon_light);
71
71
                this.show_all();
 
72
                return true;
72
73
        }
73
74
 
74
 
        private void IconLeave()
 
75
        private bool IconLeave()
75
76
        {
76
77
                this.remove(m_icon_light);
77
78
                this.add(m_icon);
78
79
                this.show_all();
 
80
                return true;
79
81
        }
80
82
 
81
 
        private void IconClicked()
 
83
        private bool IconClicked(Gdk.EventButton event)
82
84
        {
 
85
                if(event.button != 1)
 
86
                        return false;
 
87
 
 
88
                switch(event.type)
 
89
                {
 
90
                        case Gdk.EventType.BUTTON_RELEASE:
 
91
                        case Gdk.EventType.@2BUTTON_PRESS:
 
92
                        case Gdk.EventType.@3BUTTON_PRESS:
 
93
                                return false;
 
94
                }
 
95
 
83
96
                logger.print(LogMessage.DEBUG, "ColorCircle: click");
84
97
                clicked(m_color);
 
98
                return true;
85
99
        }
86
100
 
87
101