def do_get_size(self, widget, cell_area): if self._details_callback: details = self._details_callback(self.data) mark_up = '%s\n%s' color = gdk_color_to_string(widget.style.fg[Gtk.StateType.NORMAL]) text = mark_up % (self.label, color, self._escape(details)) else: text = self._escape(self.label) self._label_layout.set_markup(text) width, height = self._label_layout.get_pixel_size() return 0, 0, width, height + 2
def on_get_size(self, widget, cell_area): text = quote(self.label) if self._details_callback: details = self._details_callback(self.data) mark_up = '%s\n<span foreground="%s">%s</span>' color = gdk_color_to_string(widget.style.fg[gtk.STATE_NORMAL]) text = mark_up % (self.label, color, details) self._label_layout.set_markup(text) width, height = self._label_layout.get_pixel_size() return 0, 0, width, height + 2
def do_get_size(self, widget, cell_area): if self._details_callback: details = self._details_callback(self.data) mark_up = '%s\n%s' color = gdk_color_to_string(widget.style.fg[gtk.STATE_NORMAL]) text = mark_up % (self.label, color, self._escape(details)) else: text = self._escape(self.label) self._label_layout.set_markup(text) width, height = self._label_layout.get_pixel_size() return 0, 0, width, height + 2
def read(self): col = super(CleverProxyColorButton, self).read() return gdk_color_to_string(col)