Skip to content

Commit

Permalink
Fixes in sidebar_context_menu.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kocio-pl authored and diegogangl committed Mar 10, 2024
1 parent f85b138 commit aa5d084
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions GTG/gtk/browser/sidebar_context_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
# -----------------------------------------------------------------------------

"""
tag_context_menu:
Implements a context (pop-up) menu for the tag item in the sidebar.
Right now it is just a void shell It is supposed to become a more generic
sidebar context for all kind of item displayed there.
sidebar_context_menu:
Implements a context (pop-up) menu for the tag or saved search item in the
sidebar. It is supposed to be a generic sidebar context for all kind of item
displayed there.
Also, it is supposed to handle more complex menus (with non-std widgets,
like a color picker)
like a color picker).
"""

from gi.repository import Gtk, Gio
Expand All @@ -33,7 +33,7 @@


class TagContextMenu(Gtk.PopoverMenu):
"""Context menu fo the tag i the sidebar"""
"""Context menu to the tag in the sidebar"""

def __init__(self, ds, app, tag):
super().__init__(has_arrow=False)
Expand All @@ -44,7 +44,8 @@ def __init__(self, ds, app, tag):
actions = [
("edit_tag", self.on_mi_cc_activate),
("generate_tag_color", self.on_mi_ctag_activate),
("delete_tag", lambda w, a, p : self.app.browser.on_delete_tag_activate([self.tag]))
("delete_tag", lambda w, a, p:
self.app.browser.on_delete_tag_activate([self.tag]))
]

for action_disc in actions:
Expand Down Expand Up @@ -81,7 +82,7 @@ def on_mi_ctag_activate(self, widget, action_name, param):


class SearchesContextMenu(Gtk.PopoverMenu):
"""Context menu fo the tag i the sidebar"""
"""Context menu to the saved search in the sidebar"""

def __init__(self, ds, app, search):
super().__init__(has_arrow=False)
Expand All @@ -91,7 +92,8 @@ def __init__(self, ds, app, search):

actions = [
("edit_search", lambda w, a, p: app.open_search_editor(search)),
("delete_search", lambda w, a, p : ds.saved_searches.remove(self.search.id))
("delete_search", lambda w, a, p:
ds.saved_searches.remove(self.search.id))
]

for action_disc in actions:
Expand All @@ -116,4 +118,4 @@ def build_menu(self):
def on_mi_cc_activate(self, widget, action_name, param):
"""Callback: show the tag editor upon request"""

# self.app.open_tag_editor(self.tag)
# self.app.open_tag_editor(self.tag)

0 comments on commit aa5d084

Please sign in to comment.