Skip to content

Commit

Permalink
V0.48.3 Added Additional Bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
domhnallmorr committed Feb 3, 2023
1 parent 230c31c commit a137662
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/custom_widgets/address_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ def __init__(self, branch_tab):
self.buttons = []
self.bind("<FocusIn>", self.on_focusin)
self.bind("<FocusOut>", self.on_focusout)
self.bind("<Escape>", self.on_escape)
self.text = None

def update_bar(self, text):
self.text = text
self.delete(0, END) #deletes the current value
self.insert(0, text) #inserts new value assigned by 2nd parameter

Expand Down Expand Up @@ -49,6 +52,7 @@ def update_bar(self, text):
btn.bindtags((btn, btn.winfo_class(), self, self.winfo_class(), "all"))
self.buttons.append(btn)

self.branch_tab.focus()

def enter_event(self, event):
# -------------- CALL THE CONTROLLER METHOD TO UPDATE THE BRANCH TAB BASED ON DIRECTORY IN THE ADDRESS BAR -------------
Expand All @@ -67,4 +71,8 @@ def on_focusin(self, event):
def on_focusout(self, event):
for btn in self.buttons:
btn.grid()

def on_escape(self, event):
self.update_bar(self.text)
self.branch_tab.focus()

2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, parent, *args, **kwargs):
self.controller = controller.Controller(root, parent, self)

# ----------------- VERSION -----------------------
self.version = "0.48.2"
self.version = "0.48.3"

# ----------------- WEEK NUMBER -----------------------
year, week_num, day_of_week = datetime.date.today().isocalendar()
Expand Down
6 changes: 5 additions & 1 deletion src/view/todo_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def setup_input_widgets(self):
ttk.Label(self.todo_frame, text='Task:').grid(row=0, column=0, columnspan=1, sticky='NSEW', padx=self.view.default_padx, pady=self.view.default_pady)
self.task_entry = ttk.Entry(self.todo_frame)
self.task_entry.grid(row=0, column=1, columnspan=15, sticky='NSEW', padx=self.view.default_padx, pady=self.view.default_pady)
self.task_entry.bind('<Return>', self.enter_event)

ttk.Label(self.todo_frame, text='Status:').grid(row=1, column=0, columnspan=1, sticky='NSEW', padx=self.view.default_padx, pady=self.view.default_pady)
self.status_combo = ttk.Combobox(self.todo_frame, values=["Open", "Closed"], state='readonly')
Expand Down Expand Up @@ -145,4 +146,7 @@ def header_click(self, event):
region = self.treeview.identify("region", event.x, event.y)
if region == 'heading':
for item in self.treeview.selection():
self.treeview.selection_remove(item)
self.treeview.selection_remove(item)

def enter_event(self, event):
self.add()

0 comments on commit a137662

Please sign in to comment.