fix merge conflict
This commit is contained in:
commit
6ce29bea75
21 changed files with 371 additions and 178 deletions
|
@ -26,6 +26,7 @@ class Menubar(tk.Menu):
|
|||
self.app = app
|
||||
self.menuaction = action.MenuAction(app, master)
|
||||
self.recent_menu = None
|
||||
self.edit_menu = None
|
||||
self.draw()
|
||||
|
||||
def draw(self):
|
||||
|
@ -111,6 +112,7 @@ class Menubar(tk.Menu):
|
|||
|
||||
self.app.master.bind_all("<Control-c>", self.menuaction.copy)
|
||||
self.app.master.bind_all("<Control-v>", self.menuaction.paste)
|
||||
self.edit_menu = menu
|
||||
|
||||
def draw_canvas_menu(self):
|
||||
"""
|
||||
|
@ -444,3 +446,15 @@ class Menubar(tk.Menu):
|
|||
def execute_python(self):
|
||||
dialog = ExecutePythonDialog(self.app, self.app)
|
||||
dialog.show()
|
||||
|
||||
def change_menubar_item_state(self, is_runtime: bool):
|
||||
for i in range(self.edit_menu.index("end")):
|
||||
try:
|
||||
label_name = self.edit_menu.entrycget(i, "label")
|
||||
if label_name in ["Copy", "Paste"]:
|
||||
if is_runtime:
|
||||
self.edit_menu.entryconfig(i, state="disabled")
|
||||
else:
|
||||
self.edit_menu.entryconfig(i, state="normal")
|
||||
except tk.TclError:
|
||||
logging.debug("Ignore separators")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue