Exemple #1
0
    def __init__(self, owner, filter=None):
        HScrolledBox.__init__(self)

        self.owner = owner

        self.colors = owner.colors
        # TODO gtk3 no masks yet
        # self.blockMask = owner.blockMask

        self.filter = filter

        self.desktop = owner.getDesktop()

        self.pickerBox = Gtk.HBox()
        self.set_viewport(self.pickerBox)
        self.modify_bg(Gtk.StateType.NORMAL, self.colors["Picker_Bg"])

        # spacers
        self.pickerBox.pack_start(Gtk.Label(" "), True, True, 0)
        self.pickerBox.pack_end(Gtk.Label(" "), True, True, 0)

        self.show_all()
        self.scroll = {}
        self.scroll[filter] = 0

        self.blocks = []
Exemple #2
0
    def __init__(self, owner, filter=None):
        HScrolledBox.__init__(self)

        self.owner = owner

        self.colors = owner.colors
        # TODO gtk3 no masks yet
        #self.blockMask = owner.blockMask

        self.filter = filter

        self.desktop = owner.getDesktop()

        self.pickerBox = Gtk.HBox()
        self.set_viewport(self.pickerBox)
        self.modify_bg(Gtk.StateType.NORMAL, self.colors["Picker_Bg"])

        # spacers
        self.pickerBox.pack_start(Gtk.Label(" "), True, True, 0)
        self.pickerBox.pack_end(Gtk.Label(" "), True, True, 0)

        self.show_all()
        self.scroll = {}
        self.scroll[filter] = 0

        self.blocks = []
    def __init__(self, owner, filter=None):
        HScrolledBox.__init__(self)

        self.owner = owner

        # take drawing setup from owner
        self.gc = owner.gc
        self.colors = owner.colors
        self.blockMask = owner.blockMask

        self.filter = filter

        self.desktop = owner.getDesktop()

        self.pickerBox = gtk.HBox()
        self.set_viewport(self.pickerBox)
        self.modify_bg(gtk.STATE_NORMAL, self.colors["Picker_Bg"])

        # spacers
        self.pickerBox.pack_start(gtk.Label(" "), True, True)
        self.pickerBox.pack_end(gtk.Label(" "), True, True)

        self.show_all()
        self.scroll = {}
        self.scroll[filter] = 0

        self.blocks = []
Exemple #4
0
    def loadToolbar(self):
        self.toolbarBox = Gtk.HBox()

        scrollbox = HScrolledBox(scroll_policy=Gtk.PolicyType.NEVER)
        scrollbox.set_viewport(self.toolbarBox)
        scrollbox.modify_bg(Gtk.StateType.NORMAL,
                style.Color(Config.PANEL_BCK_COLOR).get_gdk_color())
        self.mainVBox.pack_start(scrollbox, False, False, 0)

        self.firstTbBtn = None

        for i in range(len(Config.CATEGORIES)):
            category = Config.CATEGORIES[i]

            btn = ImageRadioButton(self.firstTbBtn,
                    category + '.png', category + 'sel.png',
                    category + 'sel.png')

            if self.firstTbBtn == None:
                self.firstTbBtn = btn
            btn.connect('clicked',self.handleToolbarBtnPress,category)
            btn.set_tooltip_text(str(category))
            self.toolbarBox.pack_start(btn, False, False, 0)
    def loadToolbar( self, timeout = -1, loadStage = [0,0,0] ):
        if loadStage[1] == 0:
            self.toolbarBox = gtk.HBox()

            scrollbox = HScrolledBox(scroll_policy=gtk.POLICY_NEVER)
            scrollbox.set_viewport(self.toolbarBox)
            scrollbox.modify_bg(gtk.STATE_NORMAL, style.Color(Config.PANEL_BCK_COLOR).get_gdk_color())
            self.mainVBox.pack_start(scrollbox, False, False)

            self.firstTbBtn = None
            self.loadStage[1] = 1
            if timeout >= 0 and time.time() > timeout: return False

        for i in range(loadStage[1]-1, len(Config.CATEGORIES)):
            category = Config.CATEGORIES[i]
            if loadStage[2] == 0:
                self.loadData["btnBox"] = RoundVBox(fillcolor = Config.CATEGORY_BCK_COLOR, bordercolor = Config.PANEL_BCK_COLOR, radius = Config.PANEL_RADIUS)
                self.loadData["btnBox"].set_border_width(Config.PANEL_SPACING)
                loadStage[2] = 1
                if timeout >= 0 and time.time() > timeout: return False

            if loadStage[2] == 1:
                self.loadData["btn"] = ImageRadioButton(self.firstTbBtn,
                        category + '.png', category + 'sel.png',
                        category + 'sel.png')
                loadStage[2] = 2
                if timeout >= 0 and time.time() > timeout: return False

            if self.firstTbBtn == None:
                self.firstTbBtn = self.loadData["btn"]
            self.loadData["btn"].connect('clicked',self.handleToolbarBtnPress,category)
            self.tooltips.set_tip(self.loadData["btn"],str(category))
            self.loadData["btnBox"].add(self.loadData["btn"])
            self.toolbarBox.pack_start(self.loadData["btnBox"],True,True)

            loadStage[2] = 0
            loadStage[1] += 1
            if timeout >= 0 and time.time() > timeout: return False

        self.loadData.pop("btn")
        self.loadData.pop("btnBox")
        loadStage[1] = 0
        return True
Exemple #6
0
    def loadToolbar(self):
        self.toolbarBox = Gtk.HBox()

        scrollbox = HScrolledBox(scroll_policy=Gtk.PolicyType.NEVER)
        scrollbox.set_viewport(self.toolbarBox)
        scrollbox.modify_bg(
            Gtk.StateType.NORMAL,
            style.Color(Config.PANEL_BCK_COLOR).get_gdk_color())
        self.mainVBox.pack_start(scrollbox, False, False, 0)

        self.firstTbBtn = None

        for i in range(len(Config.CATEGORIES)):
            category = Config.CATEGORIES[i]

            btn = ImageRadioButton(self.firstTbBtn, category + '.png',
                                   category + 'sel.png', category + 'sel.png')

            if self.firstTbBtn == None:
                self.firstTbBtn = btn
            btn.connect('clicked', self.handleToolbarBtnPress, category)
            btn.set_tooltip_text(str(category))
            self.toolbarBox.pack_start(btn, False, False, 0)