Skip to content

Commit dc29a7b

Browse files
committed
fix label
1 parent 1a5a530 commit dc29a7b

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

_vpk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88
import tempfile
99
from texture import Texture
10+
1011
class VPK:
1112
"""
1213
Class for handling VPK file operations.

button.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import tkinter as tk
22
import sourceSDK
3-
from tkinter import filedialog
43
import os
54
import subprocess
65
from model import Model

fileListApp.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def create_widgets(self):
3737
self.up_button = ttk.Button(self.root, text="Up", command=self.go_up)
3838
self.up_button.pack(pady=5)
3939

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)
4242

4343
self.canvas.pack(side="left", fill="both", expand=True)
4444
self.scroll_y.pack(side="right", fill="y")
@@ -73,9 +73,15 @@ def load_files(self, folder):
7373
thumbnail_label.place(relx=0.5, rely=0.55, anchor='center')
7474

7575
if os.path.isdir(file_path):
76+
frame.bind("<Double-Button-1>", lambda e, path=file_path: self.load_files(path))
7677
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))
7780
else:
81+
frame.bind("<Double-Button-1>", lambda e, path=file_path: self.open_file(path))
7882
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))
7985

8086
col += 1
8187
if col >= columns:
@@ -105,7 +111,7 @@ def load_thumbnail(self, file_path):
105111
image = Image.open(os.path.join(base_path, "icons", "fileexplorer.png"))
106112
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"):
107113
image = Image.open(os.path.join(base_path, "icons", "txt.png"))
108-
elif file_path.endswith(".slb"):
114+
elif file_path.endswith(".sln"):
109115
image = Image.open(os.path.join(base_path, "icons", "Visual_Studio.png"))
110116

111117
if image:
@@ -124,9 +130,10 @@ def go_up(self):
124130
self.load_files(parent_dir)
125131

126132
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)
129135

130136
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

Comments
 (0)