Skip to content

Commit bc85aa1

Browse files
committed
fix preview window hangup
fix layout prerelease
1 parent bb85172 commit bc85aa1

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

.github/workflows/run.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ jobs:
259259
with:
260260
tag_name: ${{ steps.version.outputs.version }}
261261
name: Dude ${{ steps.version.outputs.version }}
262-
draft: true
262+
draft: false
263263
prerelease: true
264264
files: |
265265
dude.${{ steps.version.outputs.version }}.linux.portable.zip

src/dude.py

+27-25
Original file line numberDiff line numberDiff line change
@@ -344,31 +344,31 @@ def read_ahead_threaded_loop(self,thread_id):
344344
try:
345345
timestamp_key_done,scaled_image_done,width_done,height_done,ratio_done,window_width_done,window_height_done = self_cache_scaled_file[path]
346346

347-
if window_width==window_width_done and window_height==window_height_done:
347+
if (window_width==window_width_done and window_height==window_height_done) or scaled_image_done is None:
348348
continue
349349
except:
350-
pass
350+
#pass
351351

352-
try:
353-
full_image = self_image_open(path)
354-
if full_image.mode != 'RGBA':
355-
full_image = full_image.convert("RGBA")
352+
try:
353+
full_image = self_image_open(path)
354+
if full_image.mode != 'RGBA':
355+
full_image = full_image.convert("RGBA")
356356

357-
height = full_image.height
358-
ratio_y = height/(window_height-self.txt_label_heigh)
357+
height = full_image.height
358+
ratio_y = height/(window_height-self.txt_label_heigh)
359359

360-
width = full_image.width
361-
ratio_x = width/window_width
360+
width = full_image.width
361+
ratio_x = width/window_width
362362

363-
ratio = max(ratio_x,ratio_y,1)
363+
ratio = max(ratio_x,ratio_y,1)
364364

365-
scaled_image = full_image if ratio==1 else full_image.resize( ( int (width/ratio), int(height/ratio)) ,self_BILINEAR)
365+
scaled_image = full_image if ratio==1 else full_image.resize( ( int (width/ratio), int(height/ratio)) ,self_BILINEAR)
366366

367-
self_cache_scaled_file[path] = first_timestamp_key,scaled_image,width,height,ratio,window_width,window_height
367+
self_cache_scaled_file[path] = first_timestamp_key,scaled_image,width,height,ratio,window_width,window_height
368368

369-
except Exception as e:
370-
print('get_cached_full_image Error:',e)
371-
self_cache_scaled_file[path] = first_timestamp_key,None,0,0,1,0,0
369+
except Exception as e:
370+
print('get_cached_full_image Error:',e)
371+
self_cache_scaled_file[path] = first_timestamp_key,None,0,0,1,0,0
372372

373373
sys_exit()
374374

@@ -404,7 +404,9 @@ def get_photo_image(self,path,tkwindow):
404404
del self_cache_scaled_file[oldest_path]
405405

406406
return self.scaled_photoimage,f'{width} x {height} pixels' + (f' ({round(100.0/ratio)}%)' if ratio>1 else '')
407+
407408
self.scaled_photoimage,width,height,ratio = None,0,0,1
409+
break
408410
except:
409411
if any(self.read_ahead_pools):
410412
tkwindow.after(10)
@@ -937,13 +939,13 @@ def __init__(self,cwd,paths_to_add=None,exclude=None,exclude_regexp=None,norun=N
937939
self.status_line_lab_configure = self.status_line_lab.configure
938940
self.status_line_lab_update = self.status_line_lab.update
939941

940-
self.status_folder_quant=Label(status_frame_folder,width=10,borderwidth=2,bg=bg_color,relief='groove',foreground='red',anchor='w')
942+
self.status_folder_quant=Label(status_frame_folder,borderwidth=2,bg=bg_color,relief='groove',foreground='red',anchor='w', image=self.ico_empty,width=80,compound='left')
941943
self.status_folder_quant.pack(fill='both',expand=0,side='right')
942944
self.status_folder_quant_configure=self.status_folder_quant.configure
943945

944946
Label(status_frame_folder,width=16,text=STR('Marked files # '),relief='groove',borderwidth=2,bg=bg_color,anchor='e').pack(fill='both',expand=0,side='right')
945-
self.status_folder_size=Label(status_frame_folder,width=80,image=self.ico_empty,compound='right',borderwidth=2,bg=bg_color,relief='groove',foreground='red',anchor='w')
946-
self.status_folder_size.pack(expand=0,side='right')
947+
self.status_folder_size=Label(status_frame_folder,width=80,image=self.ico_empty,compound='left',borderwidth=2,bg=bg_color,relief='groove',foreground='red',anchor='w')
948+
self.status_folder_size.pack(fill='both',expand=0,side='right')
947949
self.status_folder_size_configure=self.status_folder_size.configure
948950

949951
Label(status_frame_folder,width=20,text=STR('Marked files size: '),relief='groove',borderwidth=2,bg=bg_color,anchor='e').pack(fill='both',expand=0,side='right')
@@ -5113,8 +5115,8 @@ def tree_folder_update_none(self):
51135115
self.folder_tree_delete(*self.current_folder_items)
51145116
self.selected[self.folder_tree]=None
51155117

5116-
self.status_folder_size_configure(text='')
5117-
self.status_folder_quant_configure(text='')
5118+
self.status_folder_size_configure(text='',image=self.ico_empty,compound='left')
5119+
self.status_folder_quant_configure(text='',image=self.ico_empty,compound='left')
51185120

51195121
self.status_path_configure(text='')
51205122
self.current_folder_items=()
@@ -5283,8 +5285,8 @@ def tree_folder_update(self,arbitrary_path=None):
52835285

52845286
ftree.update()
52855287

5286-
self.status_folder_quant_configure(text=fnumber(len(self_current_folder_items_tagged)))
5287-
self.status_folder_size_configure(text=bytes_to_str(current_folder_items_tagged_size))
5288+
self.status_folder_quant_configure(text=fnumber(len(self_current_folder_items_tagged)),image=self.ico_empty,compound='left')
5289+
self.status_folder_size_configure(text=bytes_to_str(current_folder_items_tagged_size),image=self.ico_empty,compound='left')
52885290

52895291
folder_items_len = len(self.current_folder_items)
52905292

@@ -5323,10 +5325,10 @@ def calc_mark_stats_groups(self):
53235325

53245326
def calc_mark_stats_folder(self):
53255327
self_current_folder_items_tagged = self.current_folder_items_tagged
5326-
self.status_folder_quant_configure(text=fnumber(len(self_current_folder_items_tagged)))
5328+
self.status_folder_quant_configure(text=fnumber(len(self_current_folder_items_tagged)),image=self.ico_empty,compound='left')
53275329

53285330
self_iid_to_size = self.iid_to_size
5329-
self.status_folder_size_configure(text=bytes_to_str(sum(self_iid_to_size[iid] for iid in self_current_folder_items_tagged)))
5331+
self.status_folder_size_configure(text=bytes_to_str(sum(self_iid_to_size[iid] for iid in self_current_folder_items_tagged)),image=self.ico_empty,compound='left')
53305332

53315333
def mark_in_specified_group_by_ctime(self, action, crc, reverse,select=False):
53325334
self_groups_tree = self.groups_tree

0 commit comments

Comments
 (0)