equal
deleted
inserted
replaced
42 w = len(value) + len(self.prefix) + len(self.suffix) + 2 * self.padding |
42 w = len(value) + len(self.prefix) + len(self.suffix) + 2 * self.padding |
43 self.sizereq.update(w, 1) |
43 self.sizereq.update(w, 1) |
44 |
44 |
45 def set_theme(self, theme): |
45 def set_theme(self, theme): |
46 Widget.set_theme(self, theme) |
46 Widget.set_theme(self, theme) |
47 self.color = theme.button |
47 self.color = theme.clr_button |
48 self.color_active = theme.button_active |
48 self.color_active = theme.clr_button_active |
49 |
49 |
50 def _get_color(self): |
50 def _get_color(self): |
51 if self.highlight: |
51 if self.highlight: |
52 return self.color_highlight |
52 return self.color_highlight |
53 if self.has_focus(): |
53 if self.has_focus(): |
74 # suffix |
74 # suffix |
75 buffer.puts(self.suffix, pos) |
75 buffer.puts(self.suffix, pos) |
76 |
76 |
77 def mousedown_event(self, ev): |
77 def mousedown_event(self, ev): |
78 self.highlight = True |
78 self.highlight = True |
79 #self.redraw() |
79 self.redraw() |
80 |
80 |
81 def mouseup_event(self, ev): |
81 def mouseup_event(self, ev): |
82 self.highlight = False |
82 self.highlight = False |
83 #self.redraw() |
83 self.redraw() |
84 self.sig_clicked() |
84 self.sig_clicked() |
85 |
85 |
86 def keypress_event(self, ev): |
86 def keypress_event(self, ev): |
87 if ev.keyname == 'enter': |
87 if ev.keyname == 'enter': |
88 self.sig_clicked() |
88 self.sig_clicked() |