gtk-stream 0.13.6__py3-none-any.whl → 0.14.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gtk_stream/_version.py +2 -2
- gtk_stream/application.py +1 -1
- gtk_stream/documents/classes/Box.py +5 -3
- gtk_stream/documents/classes/Button.py +2 -2
- gtk_stream/documents/classes/Document.py +4 -0
- gtk_stream/documents/classes/Dropdown.py +10 -10
- gtk_stream/documents/classes/FlowBox.py +3 -2
- gtk_stream/documents/classes/Frame.py +3 -2
- gtk_stream/documents/classes/Grid.py +1 -1
- gtk_stream/documents/classes/ScrolledWindow.py +1 -1
- gtk_stream/documents/classes/Stack.py +1 -1
- {gtk_stream-0.13.6.dist-info → gtk_stream-0.14.1.dist-info}/METADATA +1 -1
- {gtk_stream-0.13.6.dist-info → gtk_stream-0.14.1.dist-info}/RECORD +16 -16
- {gtk_stream-0.13.6.dist-info → gtk_stream-0.14.1.dist-info}/WHEEL +0 -0
- {gtk_stream-0.13.6.dist-info → gtk_stream-0.14.1.dist-info}/entry_points.txt +0 -0
- {gtk_stream-0.13.6.dist-info → gtk_stream-0.14.1.dist-info}/top_level.txt +0 -0
gtk_stream/_version.py
CHANGED
gtk_stream/application.py
CHANGED
@@ -141,7 +141,7 @@ class GtkStreamApp(Gtk.Application):
|
|
141
141
|
@app_message('remove')
|
142
142
|
def remove_widget(self, id):
|
143
143
|
w = self.named_widgets[id]
|
144
|
-
w.
|
144
|
+
w.remove_self()
|
145
145
|
|
146
146
|
@app_message('insert', multiple_store)
|
147
147
|
def insert_widgets(self, documents, into):
|
@@ -29,10 +29,12 @@ class Box(Document):
|
|
29
29
|
def render_raw(self):
|
30
30
|
return Gtk.Box()
|
31
31
|
def insert_child(self, w, d):
|
32
|
+
child = d.render_in(w)
|
32
33
|
if isinstance(d, BoxPrepend):
|
33
34
|
if d.after != None:
|
34
|
-
w.insert_child_after(
|
35
|
+
w.insert_child_after(child, self.app.named_widgets[d.after])
|
35
36
|
else:
|
36
|
-
w.prepend(
|
37
|
+
w.prepend(child)
|
37
38
|
else:
|
38
|
-
w.append(
|
39
|
+
w.append(child)
|
40
|
+
|
@@ -26,7 +26,7 @@ class Button(Document):
|
|
26
26
|
self.connect_event(button, 'clicked', 'clicked')
|
27
27
|
return button
|
28
28
|
def insert_child(self, w, d):
|
29
|
-
w.set_child(d.
|
29
|
+
w.set_child(d.render_in(w))
|
30
30
|
|
31
31
|
class LinkButton(Button):
|
32
32
|
__g_class__ = Gtk.LinkButton
|
@@ -39,4 +39,4 @@ class LinkButton(Button):
|
|
39
39
|
retval = True)
|
40
40
|
return button
|
41
41
|
def insert_child(self, w, d):
|
42
|
-
w.set_child(d.
|
42
|
+
w.set_child(d.render_in(w))
|
@@ -51,6 +51,10 @@ class Document:
|
|
51
51
|
for child in self.children:
|
52
52
|
self.insert_child(w, child)
|
53
53
|
return w
|
54
|
+
def render_in(self, w):
|
55
|
+
ret = self.render()
|
56
|
+
ret.remove_self = lambda: w.remove(ret)
|
57
|
+
return ret
|
54
58
|
|
55
59
|
def insert_child(self, w, child):
|
56
60
|
raise Exception("Unimplemented method 'insert_child'")
|
@@ -18,10 +18,11 @@ from ... import Gtk, Gio, GObject
|
|
18
18
|
from .. import Document
|
19
19
|
|
20
20
|
class Item(Document):
|
21
|
-
def __init__(self, app, value, **kwargs):
|
21
|
+
def __init__(self, app, value, key = None, **kwargs):
|
22
22
|
super().__init__(app, **kwargs)
|
23
23
|
self.child = None
|
24
24
|
self.value = value
|
25
|
+
self.key = key if key != None else value
|
25
26
|
def add_child(self, child):
|
26
27
|
self.child = child
|
27
28
|
def render(self):
|
@@ -31,6 +32,7 @@ class _ItemObject(GObject.Object):
|
|
31
32
|
super().__init__()
|
32
33
|
self.doc = doc
|
33
34
|
self.value = doc.value
|
35
|
+
self.key = doc.key
|
34
36
|
|
35
37
|
@GObject.Property(type=str)
|
36
38
|
def item_value(self):
|
@@ -41,29 +43,27 @@ class Dropdown(Document):
|
|
41
43
|
def __init__(self, app, id, **kwargs):
|
42
44
|
super().__init__(app, id=id, **kwargs)
|
43
45
|
def render_raw(self):
|
44
|
-
model = Gio.ListStore(item_type=_ItemObject)
|
45
|
-
for item in self.children:
|
46
|
-
model.append(_ItemObject(item))
|
46
|
+
self.model = Gio.ListStore(item_type=_ItemObject)
|
47
47
|
|
48
48
|
factory = Gtk.SignalListItemFactory()
|
49
49
|
def on_list_setup(_, list_item):
|
50
|
-
list_item.
|
50
|
+
list_item.item_key = None
|
51
51
|
def on_list_bind(_, list_item):
|
52
52
|
item = list_item.get_item()
|
53
|
-
if list_item.
|
54
|
-
list_item.
|
53
|
+
if list_item.item_key != item.key:
|
54
|
+
list_item.item_key = item.key
|
55
55
|
list_item.set_child(item.doc.render())
|
56
56
|
factory.connect("setup", on_list_setup)
|
57
57
|
factory.connect("bind", on_list_bind)
|
58
58
|
|
59
59
|
ret = Gtk.DropDown(
|
60
|
-
model=model,
|
60
|
+
model=self.model,
|
61
61
|
expression=Gtk.PropertyExpression.new(_ItemObject, None, 'item_value'),
|
62
62
|
factory=factory)
|
63
63
|
|
64
64
|
self.connect_event(
|
65
65
|
ret, 'notify::selected-item', 'selected',
|
66
|
-
get_data = lambda w,_: w.get_selected_item().
|
66
|
+
get_data = lambda w,_: w.get_selected_item().key)
|
67
67
|
return ret
|
68
68
|
def insert_child(self, w, d):
|
69
|
-
|
69
|
+
self.model.append(_ItemObject(d))
|
@@ -28,7 +28,8 @@ class FlowBox(Document):
|
|
28
28
|
def render_raw(self):
|
29
29
|
return Gtk.FlowBox()
|
30
30
|
def insert_child(self, w, d):
|
31
|
+
child = d.render_in(w)
|
31
32
|
if isinstance(d, FlowBoxPrepend):
|
32
|
-
w.prepend(
|
33
|
+
w.prepend(child)
|
33
34
|
else:
|
34
|
-
w.append(
|
35
|
+
w.append(child)
|
@@ -28,7 +28,8 @@ class Frame(Document):
|
|
28
28
|
def render_raw(self):
|
29
29
|
return Gtk.Frame()
|
30
30
|
def insert_child(self, w, d):
|
31
|
+
child = d.render_in(w)
|
31
32
|
if isinstance(d, FrameLabel):
|
32
|
-
w.set_label_widget(
|
33
|
+
w.set_label_widget(child)
|
33
34
|
else:
|
34
|
-
w.set_child(
|
35
|
+
w.set_child(child)
|
@@ -1,31 +1,31 @@
|
|
1
1
|
gtk_stream/__init__.py,sha256=y6JLknVFexWrSo_Zl7-TXrPR6EQ5XVMeFO1bUzLN9Lg,98
|
2
|
-
gtk_stream/_version.py,sha256=
|
3
|
-
gtk_stream/application.py,sha256=
|
2
|
+
gtk_stream/_version.py,sha256=2Ctgubb5b_lxFG2ixV07ZYKw5eto45wRlKsBIObkGsg,413
|
3
|
+
gtk_stream/application.py,sha256=1C0AsqemyV2VX_z7C7PWH6eYlQ0Q5jo7PAFjolaO0HM,5562
|
4
4
|
gtk_stream/command_line.py,sha256=57slfbV-EUWVI8bsA50IzmCLqNjN9aZpz8J8Gtituro,3105
|
5
5
|
gtk_stream/common.py,sha256=2USRh42DmmxtPO1y8gpeU0hMuHfhcqJBPuxtvd46YHg,2112
|
6
6
|
gtk_stream/parser.py,sha256=lt1cHYwhrd0SwSQfbxtbK6NdwbnFmgeBDIeNY0eepwc,5709
|
7
7
|
gtk_stream/properties.py,sha256=DCcRCP3REdfWDkPEVUsNHi1b2XxXU5toL3pf_SxmqQ4,4039
|
8
8
|
gtk_stream/documents/__init__.py,sha256=cMWSmjD2_5oJ2EoSk3Jy9-LPeAGKDIidYNRJvqUzdU8,856
|
9
|
-
gtk_stream/documents/classes/Box.py,sha256=
|
10
|
-
gtk_stream/documents/classes/Button.py,sha256=
|
11
|
-
gtk_stream/documents/classes/Document.py,sha256=
|
12
|
-
gtk_stream/documents/classes/Dropdown.py,sha256=
|
9
|
+
gtk_stream/documents/classes/Box.py,sha256=3GUaeG4kZks0NPUJT4JmwVCAJJ3aXtNvtG3b1xv2-iE,1411
|
10
|
+
gtk_stream/documents/classes/Button.py,sha256=UbFi3FeJzpfBCAArtlnmmkcB24kpEyCmpCORnGuKJsc,1520
|
11
|
+
gtk_stream/documents/classes/Document.py,sha256=MnKQs3L9yANSOPaYv3hRfocsRZjsK_Kl4epmIIqF97s,2548
|
12
|
+
gtk_stream/documents/classes/Dropdown.py,sha256=yMK1f-Jko36nILPlpgH9-bAlaBRXORGFn4Tk5Z7RzTM,2482
|
13
13
|
gtk_stream/documents/classes/Entry.py,sha256=KcBwjSu4tI30bQxPlSFSLPxFEUbTaqAdoAzd0XSQciY,1112
|
14
|
-
gtk_stream/documents/classes/FlowBox.py,sha256=
|
15
|
-
gtk_stream/documents/classes/Frame.py,sha256=
|
16
|
-
gtk_stream/documents/classes/Grid.py,sha256=
|
14
|
+
gtk_stream/documents/classes/FlowBox.py,sha256=R6HOf_k2Dgl43JDk_ErA-jK-YM8EsPnu3T46-fXoEic,1246
|
15
|
+
gtk_stream/documents/classes/Frame.py,sha256=2clm6-Ww7aYWHlSEMmAU6zB1mvi0KJtXV9zWft1NSJ0,1243
|
16
|
+
gtk_stream/documents/classes/Grid.py,sha256=QgEGnPXecHg0E7Sb5d1aMPNyf319u6z0wYtnLlcqLTM,1253
|
17
17
|
gtk_stream/documents/classes/Label.py,sha256=bBNBTvGs6fM8uLf4EDb2Ro8FmCeS27cnU1Ao-44nRYs,1023
|
18
18
|
gtk_stream/documents/classes/Paned.py,sha256=q1goKJMWBg1d3hS0eanPBxzBqLB-Pz5hUnH9N-RXXh8,1392
|
19
19
|
gtk_stream/documents/classes/Picture.py,sha256=p84N1ntCHu47O84m48zC8uKFgso3-38yXpPlAjr4IKU,1153
|
20
20
|
gtk_stream/documents/classes/ProgressBar.py,sha256=NPJtP3qaKiZUEAYEHZk4FEoWSFn2KVorI2SVb8cDnW0,966
|
21
21
|
gtk_stream/documents/classes/Scale.py,sha256=6rW6sBCdpPaqgDEGUPZi5UR8CT3bPmaZQqXXhnl-oaw,1124
|
22
|
-
gtk_stream/documents/classes/ScrolledWindow.py,sha256=
|
22
|
+
gtk_stream/documents/classes/ScrolledWindow.py,sha256=SIn_AWtE96QcbTHwNAgYqB0qO_KAjxQlZVkqpJjqypE,1045
|
23
23
|
gtk_stream/documents/classes/Separator.py,sha256=uw_EgAKs_6pNA8nrOLzruIlJfk4uaogB0p_jeoY0PHM,960
|
24
|
-
gtk_stream/documents/classes/Stack.py,sha256=
|
24
|
+
gtk_stream/documents/classes/Stack.py,sha256=diZyuBLwuCjn_WE3wx5MBgHN_ty6WXSsyIFRVAbe8yI,1572
|
25
25
|
gtk_stream/documents/classes/Switch.py,sha256=jQVuxqS9Pmpp1ymB_dbJPxasJNpm4e35ry0JYPHdAsk,1275
|
26
26
|
gtk_stream/documents/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
-
gtk_stream-0.
|
28
|
-
gtk_stream-0.
|
29
|
-
gtk_stream-0.
|
30
|
-
gtk_stream-0.
|
31
|
-
gtk_stream-0.
|
27
|
+
gtk_stream-0.14.1.dist-info/METADATA,sha256=B4eL7_HTd7ln0PsJXOL1-DY8nHs6OdHQH7frU0Bhi-8,807
|
28
|
+
gtk_stream-0.14.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
29
|
+
gtk_stream-0.14.1.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
30
|
+
gtk_stream-0.14.1.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
31
|
+
gtk_stream-0.14.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|