Skip to content

Commit

Permalink
taking window_size outside the state dict
Browse files Browse the repository at this point in the history
  • Loading branch information
villares committed Oct 13, 2023
1 parent a627d34 commit bdaf327
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions admin_scripts/folder_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@
state = {
# 'sort_by': by_name, # function by_name has to be defined yet
'mode': 'browse',
'size': {
'browse': (840, 840),
'browse_preview': (1680, 840),
'diff': (1680, 840),
},
'scroll_start': 0,
'scroll_end': 0,
'first_row': 0,
Expand All @@ -67,6 +62,12 @@
'selection': [],
}

window_size = {
'browse': (840, 840),
'browse_preview': (1680, 840),
'diff': (1680, 840),
}

hidden_files = False
folder_items = []

Expand Down Expand Up @@ -328,9 +329,9 @@ def key_pressed():


def toggle_modes():
state['size'][state['mode']] = (py5.width, py5.height)
window_size[state['mode']] = (py5.width, py5.height)
state['mode'] = next(mode_options)
py5.window_resize(*state['size'][state['mode']])
py5.window_resize(*window_size[state['mode']])


def toggle_sorting():
Expand Down

0 comments on commit bdaf327

Please sign in to comment.