From 3756469deb89a00452fb27f4eaf199486b159341 Mon Sep 17 00:00:00 2001 From: piotr Date: Fri, 17 Feb 2023 13:07:39 +0100 Subject: [PATCH] add logo & name label --- nwg-processes.svg | 89 ++++++++++++++++++++++++++++++++++++++++++ nwg_panel/processes.py | 30 +++++--------- 2 files changed, 98 insertions(+), 21 deletions(-) create mode 100644 nwg-processes.svg diff --git a/nwg-processes.svg b/nwg-processes.svg new file mode 100644 index 0000000..c52e3c3 --- /dev/null +++ b/nwg-processes.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/nwg_panel/processes.py b/nwg_panel/processes.py index 618f265..a7cc1ec 100644 --- a/nwg_panel/processes.py +++ b/nwg_panel/processes.py @@ -151,27 +151,13 @@ def list_processes(widget): idx += 1 - # global max_num_items - # if max_num_items < idx: - # max_num_items = idx - # - # if idx < max_num_items: - # for i in range(idx, max_num_items): - # lbl = Gtk.Label() - # lbl.set_markup(" ") - # grid.attach(lbl, 0, i, 1, 1) - grid.show_all() - # scrolled_window.get_vadjustment().set_value(scroll) - return True def on_background_cb(check_button): common_settings["processes-background-only"] = check_button.get_active() - global max_num_items - max_num_items = 0 if window_lbl: window_lbl.set_visible(not common_settings["processes-background-only"]) list_processes(None) @@ -179,8 +165,6 @@ def on_background_cb(check_button): def on_own_cb(check_button): common_settings["processes-own-only"] = check_button.get_active() - global max_num_items - max_num_items = 0 list_processes(None) @@ -265,9 +249,17 @@ def main(): dist.set_property("vexpand", True) box.pack_start(dist, True, True, 0) - hbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 12) + hbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 6) + hbox.set_property("margin", 6) box.pack_start(hbox, False, False, 0) + img = Gtk.Image.new_from_icon_name("nwg-processes", Gtk.IconSize.LARGE_TOOLBAR) + hbox.pack_start(img, False, False, 0) + + lbl = Gtk.Label() + lbl.set_markup("nwg-processes") + hbox.pack_start(lbl, False, False, 0) + cb = Gtk.CheckButton.new_with_label("Background only") cb.set_tooltip_text("Processes that don't belong to the sway tree") cb.set_active(common_settings["processes-background-only"]) @@ -284,10 +276,6 @@ def main(): hbox.pack_end(btn, False, False, 0) btn.connect("clicked", Gtk.main_quit) - # btn = Gtk.Button.new_with_label("Refresh") - # hbox.pack_end(btn, False, False, 0) - # btn.connect("clicked", list_processes) - screen = Gdk.Screen.get_default() provider = Gtk.CssProvider() style_context = Gtk.StyleContext()