def _headerbar(bar):
children = [] + bar.get_children()
pack_start = []
pack_end = []
for c in children:
if child_get_property(bar, c, 'pack-type') == Gtk.PackType.END:
bar.remove(c)
pack_start.append(c)
else:
bar.remove(c)
pack_end.append(c)
if len(pack_end) > 1:
c, pack_end = pack_end[0], pack_end[1:]
pack_end.append(c)
if (Gtk.get_major_version(), Gtk.get_minor_version()) > (3, 10):
# Old ubuntu has this in order, new Ubuntu has it reversed
pack_end = reversed(pack_end)
for c in pack_start: bar.pack_start(c)
for c in pack_end: bar.pack_end(c)
评论列表
文章目录