def __init__(self, pixbuf, label): gtk.EventBox.__init__(self) self.hovering = False pad = gtk.Alignment() self.pad_size = pixbuf.get_width() / 10 pad.set_padding(self.pad_size, self.pad_size, self.pad_size, self.pad_size) vbox = gtk.VBox() vbox.set_spacing(12) self.img = awn.Image() self.img.set_from_pixbuf(pixbuf) self.text = awn.Label() self.text.set_markup('<span font-size="x-large" weight="bold">'+label+'</span>') vbox.add(self.img) vbox.add(self.text) pad.add(vbox) self.add(pad) # Init transparent colormap cm = self.get_screen().get_rgba_colormap() if cm != None: self.set_colormap(cm) awn.utils_ensure_transparent_bg(self) self.init_dnd()
def __init__(self, pixbuf, label): gtk.EventBox.__init__(self) self.hovering = False pad = gtk.Alignment() self.pad_size = pixbuf.get_width() / 10 pad.set_padding(self.pad_size, self.pad_size, self.pad_size, self.pad_size) vbox = gtk.VBox() vbox.set_spacing(12) self.img = awn.Image() self.img.set_from_pixbuf(pixbuf) self.text = awn.Label() self.text.set_markup('<span font-size="x-large" weight="bold">' + label + '</span>') vbox.add(self.img) vbox.add(self.text) pad.add(vbox) self.add(pad) # Init transparent colormap cm = self.get_screen().get_rgba_colormap() if cm != None: self.set_colormap(cm) awn.utils_ensure_transparent_bg(self) self.init_dnd()
def __init__(self, uid): gtk.Window.__init__(self, gtk.WINDOW_POPUP) # Init transparent colormap cm = self.get_screen().get_rgba_colormap() if cm != None: self.set_colormap(cm) screen = self.get_screen() mon_num = screen.get_monitor_at_point(0,0) rect = screen.get_monitor_geometry(mon_num) self.screen_w = rect.width self.screen_h = rect.height screen.connect("size-changed", self.screen_changed) awn.utils_ensure_transparent_bg(self) # Connect to signals we need self.drag_dest_set(gtk.DEST_DEFAULT_DROP | gtk.DEST_DEFAULT_MOTION, [("text/uri-list", 0, 0), ("text/plain", 0, 1)], gtk.gdk.ACTION_COPY) self.connect("drag-data-received", self.no_target_drop) # We will use this themed icon to get the hi-res pixbufs self.icon_cache = awn.ThemedIcon() self.icon_cache.set_applet_info("dropper", uid) self.icon_cache.set_info_append("icon-1", "stock_internet") self.icon_cache.set_info_append("icon-2", "stock_open") self.init_components()
def __init__(self, uid): gtk.Window.__init__(self, gtk.WINDOW_POPUP) # Init transparent colormap cm = self.get_screen().get_rgba_colormap() if cm != None: self.set_colormap(cm) screen = self.get_screen() mon_num = screen.get_monitor_at_point(0, 0) rect = screen.get_monitor_geometry(mon_num) self.screen_w = rect.width self.screen_h = rect.height screen.connect("size-changed", self.screen_changed) awn.utils_ensure_transparent_bg(self) # Connect to signals we need self.drag_dest_set(gtk.DEST_DEFAULT_DROP | gtk.DEST_DEFAULT_MOTION, [("text/uri-list", 0, 0), ("text/plain", 0, 1)], gtk.gdk.ACTION_COPY) self.connect("drag-data-received", self.no_target_drop) # We will use this themed icon to get the hi-res pixbufs self.icon_cache = awn.ThemedIcon() self.icon_cache.set_applet_info("dropper", uid) self.icon_cache.set_info_append("icon-1", "stock_internet") self.icon_cache.set_info_append("icon-2", "stock_open") self.init_components()