From 97cf290ffcbc79e38baa9cde83f97c328b443c55 Mon Sep 17 00:00:00 2001 From: gryf Date: Mon, 2 Oct 2023 15:23:57 +0200 Subject: [PATCH] Added toolbar. --- gtkpass.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gtkpass.py b/gtkpass.py index 6833608..acd407b 100755 --- a/gtkpass.py +++ b/gtkpass.py @@ -38,6 +38,10 @@ class GTKPass(Gtk.Window): mainbox.set_homogeneous(False) self.add(mainbox) + # add toolbar + toolbar = self.create_toolbar() + mainbox.pack_start(child=toolbar, expand=False, fill=False, padding=0) + # pane pane = Gtk.Paned(orientation=Gtk.Orientation.HORIZONTAL) mainbox.pack_start(child=pane, expand=True, fill=True, padding=0) @@ -78,6 +82,36 @@ class GTKPass(Gtk.Window): self.show_all() self.refresh() + + def create_toolbar(self): + toolbar = Gtk.Toolbar() + + b_new = Gtk.ToolButton() + b_new.set_icon_name("document-new-symbolic") + toolbar.insert(b_new, 0) + + b_dir = Gtk.ToolButton() + b_dir.set_icon_name("folder-new-symbolic") + toolbar.insert(b_dir, 1) + + b_edit = Gtk.ToolButton() + b_edit.set_icon_name("document-edit-symbolic") + toolbar.insert(b_edit, 2) + + b_del = Gtk.ToolButton() + b_del.set_icon_name("edit-delete-symbolic") + toolbar.insert(b_del, 3) + + b_gitpush = Gtk.ToolButton() + b_gitpush.set_icon_name("go-up-symbolic") + toolbar.insert(b_gitpush, 4) + + b_gitpull = Gtk.ToolButton() + b_gitpull.set_icon_name("go-down-symbolic") + toolbar.insert(b_gitpull, 5) + + return toolbar + def add_nodes(self, data, parent): "Create the tree nodes from a hierarchical data structure" for obj in data.sorted_children: