Skip to content

Commit

Permalink
optimize auto layout
Browse files Browse the repository at this point in the history
  • Loading branch information
nachifur committed Apr 4, 2021
1 parent c6a0485 commit d79445a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
__pycache__/

.vscode/
dist/
build/
test_output/mag*
test_output/select*
*.csv
*.csv
main.spec
6 changes: 3 additions & 3 deletions mulimg_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, parent, UpdateUI, get_type):
self.color_list = []

def frame_resize(self, event):
self.auto_layout()
self.auto_layout(frame_resize=True)

def open_all_img(self, event):
input_mode = self.choice_input_mode.GetSelection()
Expand Down Expand Up @@ -597,10 +597,10 @@ def show_img(self):
["-1", "-1", "***Error: no image in this dir! Maybe you can choose parallel mode!***", "-1"])
self.auto_layout()

def auto_layout(self):
def auto_layout(self,frame_resize=False):
# Auto Layout
self.displaySize = wx.Size(wx.DisplaySize())
if self.auto_layout_check.Value:
if self.auto_layout_check.Value and (not frame_resize):
if self.img_size[0] < self.width:
if self.img_size[0]+300 < self.width:
w = self.width
Expand Down

0 comments on commit d79445a

Please sign in to comment.