Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 461930
Collapse All | Expand All

(-)guake-0.4.4/src/guake (-25 / +39 lines)
Lines 301-333 class GConfHandler(object): Link Here
301
        will set the transparent flag to false if an image is set in
301
        will set the transparent flag to false if an image is set in
302
        all terminals open.
302
        all terminals open.
303
        """
303
        """
304
        image = entry.value.get_string()
304
        self.guake.set_background_image(entry.value.get_string())
305
        for i in self.guake.term_list:
306
            if image and os.path.exists(image):
307
                i.set_background_image_file(image)
308
                i.set_background_transparent(False)
309
            else:
310
                """We need to clear the image if it's not set but there is
311
                a bug in vte python bidnings which doesn't allow None to be
312
                passed to set_background_image (C GTK function expects NULL).
313
                The user will need to restart Guake after clearing the image.
314
                i.set_background_image(None)
315
                """
316
                if self.guake.has_argb:
317
                    i.set_background_transparent(False)
318
                else:
319
                    i.set_background_transparent(True)
320
305
321
    def bgtransparency_changed(self, client, connection_id, entry, data):
306
    def bgtransparency_changed(self, client, connection_id, entry, data):
322
        """If the gconf var style/background/transparency be changed, this
307
        """If the gconf var style/background/transparency be changed, this
323
        method will be called and will set the saturation and transparency
308
        method will be called and will set the saturation and transparency
324
        properties in all terminals open.
309
        properties in all terminals open.
325
        """
310
        """
326
        transparency = entry.value.get_int()
311
        self.guake.set_background_transparency(entry.value.get_int())
327
        for i in self.guake.term_list:
328
            i.set_background_saturation(transparency / 100.0)
329
            if self.guake.has_argb:
330
                i.set_opacity(int((100 - transparency) / 100.0 * 65535))
331
312
332
    def backspace_changed(self, client, connection_id, entry, data):
313
    def backspace_changed(self, client, connection_id, entry, data):
333
        """If the gconf var compat_backspace be changed, this method
314
        """If the gconf var compat_backspace be changed, this method
Lines 560-570 class Guake(SimpleGladeApp): Link Here
560
        # check and set ARGB for real transparency
541
        # check and set ARGB for real transparency
561
        screen = self.window.get_screen()
542
        screen = self.window.get_screen()
562
        colormap = screen.get_rgba_colormap()
543
        colormap = screen.get_rgba_colormap()
563
        if colormap != None and screen.is_composited():
544
        if colormap == None:
564
            self.window.set_colormap(colormap)
565
            self.has_argb = True
566
        else:
567
            self.has_argb = False
545
            self.has_argb = False
546
        else:
547
            self.window.set_colormap(colormap)
548
            self.has_argb = self.window.get_screen().is_composited()
549
550
            def composited_changed(screen):
551
                self.has_argb = screen.is_composited()
552
                self.set_background_transparency(
553
                    self.client.get_int(KEY('/style/background/transparency')))
554
                self.set_background_image(
555
                    self.client.get_string(KEY('/style/background/image')))
556
557
            self.window.get_screen().connect("composited-changed",
558
                                              composited_changed);
568
559
569
        # List of vte.Terminal widgets, it will be useful when needed
560
        # List of vte.Terminal widgets, it will be useful when needed
570
        # to get a widget by the current page in self.notebook
561
        # to get a widget by the current page in self.notebook
Lines 659-664 class Guake(SimpleGladeApp): Link Here
659
                  'press <b>%s</b> to use it.') % label, filename)
650
                  'press <b>%s</b> to use it.') % label, filename)
660
            notification.show()
651
            notification.show()
661
652
653
    def set_background_transparency(self, transparency):
654
        for i in self.term_list:
655
            i.set_background_saturation(transparency / 100.0)
656
            if self.has_argb:
657
                i.set_opacity(int((100 - transparency) / 100.0 * 65535))
658
659
    def set_background_image(self, image):
660
        for i in self.term_list:
661
            if image and os.path.exists(image):
662
                i.set_background_image_file(image)
663
                i.set_background_transparent(False)
664
            else:
665
                """We need to clear the image if it's not set but there is
666
                a bug in vte python bidnings which doesn't allow None to be
667
                passed to set_background_image (C GTK function expects NULL).
668
                The user will need to restart Guake after clearing the image.
669
                i.set_background_image(None)
670
                """
671
                if self.has_argb:
672
                    i.set_background_transparent(False)
673
                else:
674
                    i.set_background_transparent(True)
675
662
    def execute_command(self, command, tab=None):
676
    def execute_command(self, command, tab=None):
663
        """Execute the `command' in the `tab'. If tab is None, the
677
        """Execute the `command' in the `tab'. If tab is None, the
664
        command will be executed in the currently selected
678
        command will be executed in the currently selected

Return to bug 461930