def __init__(self): gtk.EventBox.__init__(self) self.connect("button-release-event", self.__button_release_cb) self.connect("motion-notify-event", self.__motion_cb) button = borderless_button(stock_id=gtk.STOCK_COLOR_PICKER, tooltip=_("Pick a color from the screen")) button.connect("clicked", self.__clicked_cb) self.add(button)
def __init__(self): gtk.EventBox.__init__(self) self.connect("button-release-event", self.__button_release_cb) self.connect("motion-notify-event", self.__motion_cb) button = borderless_button(icon_name="mypaint-pick-color-symbolic", tooltip=_("Pick a color from the screen")) button.connect("clicked", self.__clicked_cb) self.add(button)
def __init__(self): import hcywheel import hsvtriangle import hsvcube import hsvwheel import sliders import paletteview palette_class = paletteview.PalettePage palette_page = None page_classes = (hcywheel.HCYAdjusterPage, hsvwheel.HSVAdjusterPage, palette_class, hsvtriangle.HSVTrianglePage, hsvcube.HSVCubePage, sliders.ComponentSlidersAdjusterPage, ) gtk.VBox.__init__(self) self.__adjusters = [] nb = self.__notebook = gtk.Notebook() nb.set_property("scrollable", True) page_index = 0 for page_class in page_classes: icon_name = page_class.get_page_icon_name() icon_img = gtk.Image() icon_img.set_from_icon_name(icon_name, gtk.ICON_SIZE_SMALL_TOOLBAR) icon_img.connect("query-tooltip", self.__tab_tooltip_query_cb, page_class) icon_img.set_property("has-tooltip", True) page_title = page_class.get_page_title() page = page_class() page_table = page.get_page_widget() picker = ColorPickerButton() comparator = PreviousCurrentColorAdjuster() bookmark_btn = borderless_button( icon_name="bookmark-new", tooltip=_("Add color to Palette")) bookmark_btn.connect("clicked", self.__bookmark_button_clicked_cb) properties_desc = page_class.get_properties_description() if properties_desc is not None: properties_btn = borderless_button( stock_id=gtk.STOCK_PROPERTIES, tooltip=properties_desc) properties_btn.connect("clicked", self.__properties_button_clicked_cb, page) else: properties_btn = borderless_button( stock_id=gtk.STOCK_PROPERTIES) properties_btn.set_sensitive(False) # Common footer hbox = gtk.HBox() hbox.set_spacing(3) hbox.pack_start(picker, False, False) hbox.pack_start(comparator, True, True) hbox.pack_start(bookmark_btn, False, False) hbox.pack_start(properties_btn, False, False) # Full page layout vbox = gtk.VBox() vbox.set_spacing(3) vbox.set_border_width(3) vbox.pack_start(page_table, True, True) vbox.pack_start(hbox, False, False) vbox.__page = page nb.append_page(vbox, icon_img) self.__adjusters.append(page) self.__adjusters.append(comparator) self.__adjusters.append(picker) # Bookmark button writes colours here if page_class is palette_class: self.__palette_page = page self.__palette_page_index = page_index page_index += 1 self.__shown = False self.connect("show", self.__first_show_cb) self.pack_start(nb, True, True)