@@ -37,8 +37,8 @@ def create_widgets(self):
37
37
self .up_button = ttk .Button (self .root , text = "Up" , command = self .go_up )
38
38
self .up_button .pack (pady = 5 )
39
39
40
- self .up_button = ttk .Button (self .root , text = "Open Directory" , command = self .open_directory )
41
- self .up_button .pack (pady = 5 )
40
+ self .open_dir_button = ttk .Button (self .root , text = "Open Directory" , command = self .open_directory )
41
+ self .open_dir_button .pack (pady = 5 )
42
42
43
43
self .canvas .pack (side = "left" , fill = "both" , expand = True )
44
44
self .scroll_y .pack (side = "right" , fill = "y" )
@@ -73,9 +73,15 @@ def load_files(self, folder):
73
73
thumbnail_label .place (relx = 0.5 , rely = 0.55 , anchor = 'center' )
74
74
75
75
if os .path .isdir (file_path ):
76
+ frame .bind ("<Double-Button-1>" , lambda e , path = file_path : self .load_files (path ))
76
77
label .bind ("<Double-Button-1>" , lambda e , path = file_path : self .load_files (path ))
78
+ if thumbnail :
79
+ thumbnail_label .bind ("<Double-Button-1>" , lambda e , path = file_path : self .load_files (path ))
77
80
else :
81
+ frame .bind ("<Double-Button-1>" , lambda e , path = file_path : self .open_file (path ))
78
82
label .bind ("<Double-Button-1>" , lambda e , path = file_path : self .open_file (path ))
83
+ if thumbnail :
84
+ thumbnail_label .bind ("<Double-Button-1>" , lambda e , path = file_path : self .open_file (path ))
79
85
80
86
col += 1
81
87
if col >= columns :
@@ -105,7 +111,7 @@ def load_thumbnail(self, file_path):
105
111
image = Image .open (os .path .join (base_path , "icons" , "fileexplorer.png" ))
106
112
elif file_path .endswith (".txt" ) or file_path .endswith (".res" ) or file_path .endswith (".vmt" ) or file_path .endswith (".qc" ) or file_path .endswith (".smd" ) or file_path .endswith (".cfg" ):
107
113
image = Image .open (os .path .join (base_path , "icons" , "txt.png" ))
108
- elif file_path .endswith (".slb " ):
114
+ elif file_path .endswith (".sln " ):
109
115
image = Image .open (os .path .join (base_path , "icons" , "Visual_Studio.png" ))
110
116
111
117
if image :
@@ -124,9 +130,10 @@ def go_up(self):
124
130
self .load_files (parent_dir )
125
131
126
132
def open_directory (self ):
127
- open = Open (self .sdk )
128
- open .open_directory (self .current_folder )
133
+ open_instance = Open (self .sdk )
134
+ open_instance .open_directory (self .current_folder )
129
135
130
136
def open_file (self , pathFile ):
131
- open = Open (self .sdk )
132
- open .open_file (localpath = pathFile )
137
+ open_instance = Open (self .sdk )
138
+ open_instance .open_file (localpath = pathFile )
139
+
0 commit comments