formatting widgets

This commit is contained in:
Piotr Miller
2021-02-03 16:01:41 +01:00
parent f8582848c1
commit 9c89ddcf31
2 changed files with 13 additions and 14 deletions

View File

@@ -46,7 +46,7 @@ class PanelSelector(Gtk.Window):
row = 0 row = 0
for path in configs: for path in configs:
label = Gtk.Label() label = Gtk.Label()
label.set_text("File: {}".format(path)) label.set_text("File: '{}'".format(path))
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 0, row, 3, 1) grid.attach(label, 0, row, 3, 1)
row += 1 row += 1
@@ -54,39 +54,39 @@ class PanelSelector(Gtk.Window):
panels = configs[path] panels = configs[path]
label = Gtk.Label() label = Gtk.Label()
label.set_text("PANEL NAME") label.set_text("Name:")
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 0, row, 1, 1) grid.attach(label, 0, row, 1, 1)
label = Gtk.Label() label = Gtk.Label()
label.set_text("OUTPUT") label.set_text("Output:")
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 1, row, 1, 1) grid.attach(label, 1, row, 1, 1)
label = Gtk.Label() label = Gtk.Label()
label.set_text("POSITION") label.set_text("Position:")
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 2, row, 1, 1) grid.attach(label, 2, row, 1, 1)
row += 1 row += 1
panel_idx = 0 panel_idx = 0
for panel in panels: for panel in panels:
check_key(panel, "name", "-") check_key(panel, "name", "")
check_key(panel, "output", "-") check_key(panel, "output", "")
check_key(panel, "position", "-") check_key(panel, "position", "")
label = Gtk.Label() label = Gtk.Label()
label.set_text(panel["name"]) label.set_text('"{}"'.format(panel["name"]))
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 0, row, 1, 1) grid.attach(label, 0, row, 1, 1)
label = Gtk.Label() label = Gtk.Label()
label.set_text(panel["output"]) label.set_text('"{}"'.format(panel["output"]))
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 1, row, 1, 1) grid.attach(label, 1, row, 1, 1)
label = Gtk.Label() label = Gtk.Label()
label.set_text(panel["position"]) label.set_text('"{}"'.format(panel["position"]))
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 2, row, 1, 1) grid.attach(label, 2, row, 1, 1)
@@ -104,7 +104,6 @@ class PanelSelector(Gtk.Window):
editor.set_values(file, panel) editor.set_values(file, panel)
self.close() self.close()
def release_parent(self, w, parent): def release_parent(self, w, parent):
parent.set_sensitive(True) parent.set_sensitive(True)
@@ -163,8 +162,7 @@ class PanelEditor(object):
check_key(self.panel, "items-padding", 0) check_key(self.panel, "items-padding", 0)
check_key(self.panel, "icons", "") check_key(self.panel, "icons", "")
check_key(self.panel, "css-name", "") check_key(self.panel, "css-name", "")
#self.lb_panel_desc.set_text("Panel #{} in {}".format(panel_num, file))
self.lb_panel_desc.set_text("Panel #{} in {}".format(panel_num, file)) self.lb_panel_desc.set_text("Panel #{} in {}".format(panel_num, file))
self.eb_name.set_text(self.panel["name"]) self.eb_name.set_text(self.panel["name"])

View File

@@ -351,11 +351,12 @@
<object class="GtkLabel" id="label-desc"> <object class="GtkLabel" id="label-desc">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Select panel</property> <property name="label" translatable="yes">Select panel</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">False</property>
<property name="padding">10</property> <property name="padding">10</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>