File: fakerevealer.py

package info (click to toggle)
syncthing-gtk 0.9.4.4%2Bds%2Bgit20221205%2B12a9702d29ab-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,888 kB
  • sloc: python: 8,077; sh: 259; xml: 134; makefile: 6
file content (45 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

import logging

from gi.repository import Gtk


log = logging.getLogger("FakeRevealer")


class FakeRevealer(Gtk.HBox):
    """
    Gtk.Revealer compatible widget that will not cause window border
    disappearing bug on Windows.
    """

    def __init__(self):
        Gtk.HBox.__init__(self)
        self._reveal = True

    def add(self, child):
        Gtk.HBox.add(self, child)
        child.set_visible(self._reveal)

    def get_reveal_child(self):
        return self._reveal

    def set_reveal_child(self, b):
        self._reveal = b
        if len(self.get_children()) > 0:
            self.get_children()[0].set_visible(b)

    def get_child_revealed(self):
        return self._reveal

    def get_transition_duration(self):
        return 1

    def set_transition_duration(self, d):
        """ You wish... """

    def get_transition_type(self):
        return Gtk.Revealer.TransitionType.NONE

    def set_transition_type(self, t):
        """ Nobody gives orders to ME! """