mirror of https://github.com/tuhiproject/tuhi.git
gui: add an expanding label to the end, but don't expand flowboxes
pack_end, introduced inpull/260/head29761204a9
means they align to the bottom of the window. Where there aren't enough drawings to fill the window, everything is bottom aligned. Hack around this by adding an empty label to the bottom that expands to the maximum available size and stop expanding the rest. This new label thus pushes everything up to the top position. Fixes29761204a9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
parent
29761204a9
commit
59dfce5b8d
|
@ -74,6 +74,11 @@ class DrawingPerspective(Gtk.Stack):
|
|||
super().__init__(*args, **kwargs)
|
||||
self.known_drawings = {} # type {timestamp: Drawing()}
|
||||
self.flowboxes = {}
|
||||
# Add an expanding emtpy label to the bottom - this pushes all the
|
||||
# real stuff up to the top, forcing a nice alignment
|
||||
l = Gtk.Label("")
|
||||
l.show()
|
||||
self.box_all_drawings.pack_end(l, expand=True, fill=True, padding=100)
|
||||
self._zoom = 0
|
||||
self._want_listen = True
|
||||
|
||||
|
@ -102,7 +107,7 @@ class DrawingPerspective(Gtk.Stack):
|
|||
except KeyError:
|
||||
fb = Flowbox(time.gmtime(drawing.timestamp))
|
||||
self.flowboxes[key] = fb
|
||||
self.box_all_drawings.pack_end(fb, expand=True, fill=True, padding=0)
|
||||
self.box_all_drawings.pack_end(fb, expand=False, fill=True, padding=0)
|
||||
finally:
|
||||
fb.insert(drawing)
|
||||
|
||||
|
|
Loading…
Reference in New Issue