File: fakerevealer.py

package info (click to toggle)
syncthing-gtk 0.9.4.4%2Bds%2Bgit20201209%2Bc46fbd8-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,260 kB
  • sloc: python: 7,592; sh: 259; xml: 115; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 893 bytes parent folder | download
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

from gi.repository import Gtk
import logging
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... """
		pass
	
	def get_transition_type(self):
		return Gtk.Revealer.TransitionType.NONE
	
	def set_transition_type(self, t):
		""" Nobody gives orders to ME! """
		pass