Subversion Repositories basico

Rev

Rev 232 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
232 t00m 1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
# File: about.py
4
# Author: Tomás Vírseda
5
# License: GPL v3
6
# Description: About Widget
7
 
8
from os.path import sep as SEP
9
from cgi import escape
10
import gi
11
gi.require_version('Gtk', '3.0')
12
gi.require_version('Gdk', '3.0')
13
from gi.repository import Gtk
14
from gi.repository import Gdk
15
from gi.repository import Pango
16
 
233 t00m 17
from basico.core.env import ROOT, USER_DIR, APP, LPATH, GPATH, FILE
18
from basico.core.service import Service
232 t00m 19
 
20
class About(Gtk.ScrolledWindow):
21
    def __init__(self):
22
        Gtk.ScrolledWindow.__init__(self)
23
        self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
24
        self.set_hexpand(True)
25
        self.set_vexpand(True)
26
 
27
        viewport = Gtk.Viewport()
28
        widget = Gtk.VBox()
29
        viewport.add(widget)
30
        widget.set_hexpand(True)
31
        widget.set_vexpand(True)
32
 
33
        # Set logo
34
        label = Gtk.Label()
35
        # ~ label.set_markup("🙇")
36
        label.set_markup("")
37
        label.modify_font(Pango.FontDescription('Monospace 92'))
38
        widget.pack_start(label, False, False, 6)
39
 
40
        # Set App name
41
        label = Gtk.Label()
42
        label.set_markup("<b>%s %s</b>" % (APP['short'].capitalize(), APP['version']))
43
        label.modify_font(Pango.FontDescription('Monospace 48'))
44
        widget.pack_start(label, False, False, 6)
45
 
46
        # Set App desc
47
        label = Gtk.Label()
48
        label.set_markup("%s" % APP['name'])
49
        label.modify_font(Pango.FontDescription('Arial 24'))
50
        widget.pack_start(label, False, False, 6)
51
 
52
        # Set App license
53
        label = Gtk.Label()
54
        label.set_markup("<i>\n\n%s\n\n</i>" % APP['license'])
55
        label.modify_font(Pango.FontDescription('Monospace 10'))
56
        label.set_justify(Gtk.Justification.CENTER)
57
        label.set_line_wrap(True)
58
        widget.pack_start(label, False, False, 6)
59
 
60
        # Set Link button
61
        linkbutton = Gtk.LinkButton(uri="http://t00mlabs.net", label="t00mlabs.net")
62
        widget.pack_start(linkbutton, False, False, 6)
63
 
64
        # Set Copyright holders
65
        label = Gtk.Label()
66
        label.set_markup("Copyright \xa9 2016-2018 Tomás Vírseda")
67
        label.modify_font(Pango.FontDescription('Monospace 10'))
68
        label.set_justify(Gtk.Justification.CENTER)
69
        label.set_line_wrap(True)
70
        widget.pack_start(label, False, False, 6)
71
 
72
        # Authors
73
        label = Gtk.Label()
74
        label.set_markup("\n%s" % escape(APP['authors'][0]))
75
        label.modify_font(Pango.FontDescription('Monospace 10'))
76
        label.set_justify(Gtk.Justification.CENTER)
77
        label.set_line_wrap(True)
78
        label.set_selectable(True)
79
        widget.pack_start(label, False, False, 6)
80
 
81
        self.add(viewport)
82
        self.show_all()