9578053 Jan 22 2022 distfiles.gentoo.org/distfiles/gajim-1.3.3-2.tar.gz
This commit is contained in:
parent
a5b3822651
commit
4c1b226bff
1045 changed files with 753037 additions and 18 deletions
23
test/gtk/util.py
Normal file
23
test/gtk/util.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from pathlib import Path
|
||||
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
||||
def get_gajim_dir():
|
||||
gajim_path = Path(__file__) / '..' / '..' / '..' / 'gajim'
|
||||
return gajim_path.resolve()
|
||||
|
||||
def load_style(filename, priority):
|
||||
path = get_gajim_dir() / 'data' / 'style' / filename
|
||||
try:
|
||||
with open(str(path), "r") as file:
|
||||
css = file.read()
|
||||
except Exception as exc:
|
||||
print(exc)
|
||||
return
|
||||
provider = Gtk.CssProvider()
|
||||
provider.load_from_data(bytes(css.encode('utf-8')))
|
||||
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
|
||||
provider,
|
||||
priority)
|
||||
Loading…
Add table
Add a link
Reference in a new issue