Skip to content

Commit

Permalink
V0.49.3
Browse files Browse the repository at this point in the history
  • Loading branch information
domhnallmorr committed Jun 3, 2023
1 parent 15f6c7f commit c648d14
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
Binary file removed src/controller/__pycache__/controller.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion src/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def paste_file_folder(self, branch_id):
task = "copy"

fo = pythoncom.CoCreateInstance(shell.CLSID_FileOperation, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IFileOperation)
print(dir(fo))

for source in files_to_process:
src = shell.SHCreateItemFromParsingName(source, None, shell.IID_IShellItem)
dst = shell.SHCreateItemFromParsingName(current_directory, None, shell.IID_IShellItem)
Expand Down
35 changes: 33 additions & 2 deletions src/custom_widgets/address_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(self, branch_tab):
self.bind("<FocusIn>", self.on_focusin)
self.bind("<FocusOut>", self.on_focusout)
self.bind("<Escape>", self.on_escape)
self.bind("<Configure>", lambda event: self.truncate_breadcrumbs())
self.text = None

def update_bar(self, text):
Expand Down Expand Up @@ -47,11 +48,12 @@ def update_bar(self, text):
path = os.path.join(path, folder)

btn = Button(self, text=folder, bootstyle="secondary",)
btn.grid(row=0, column=idx)
# btn.grid(row=0, column=idx)
btn.bind("<Button-1>", lambda event=None, path=path: self.button_clicked(event, path))
btn.bindtags((btn, btn.winfo_class(), self, self.winfo_class(), "all"))
self.buttons.append(btn)

self.truncate_breadcrumbs()
self.branch_tab.focus()

def enter_event(self, event):
Expand All @@ -75,4 +77,33 @@ def on_focusout(self, event):
def on_escape(self, event):
self.update_bar(self.text)
self.branch_tab.focus()


def truncate_breadcrumbs(self, event=None):
available_width = self.winfo_width()

if available_width < 200: # DON'T ATTEMPT TO TRUNCATE IF AVAILABLE IS VERY SMALL
for idx, btn in enumerate(self.buttons):
btn.grid(row=0, column=idx)
else:
total_width = 0
col = len(self.buttons)

for idx, btn in reversed(list(enumerate(self.buttons))):

total_width += btn.winfo_reqwidth()

if idx == 0:
btn.grid(row=0, column=col)
else:
if total_width < available_width:
btn.grid(row=0, column=col)

col -= 1








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.49.2"
self.version = "0.49.3"

# ----------------- WEEK NUMBER -----------------------
year, week_num, day_of_week = datetime.date.today().isocalendar()
Expand Down

0 comments on commit c648d14

Please sign in to comment.