2 Commits
Author SHA1 Message Date
CosmicKillsSouls 0af6aa05a0 Adjustable Window sizes
Changed window sizes to be controlled by config.
2026-09-04 11:43:31 -05:00
CosmicKillsSouls 1aaaefd08f Adjustable Window sizes
Changed window sizes to be controlled by config.
2026-09-04 11:39:48 -05:00
2 changed files with 396 additions and 388 deletions
+7 -4
View File
@@ -13,6 +13,9 @@ import configparser
# CONFIG: # CONFIG:
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read(r"C:\ProgramData\Program-Search\config.ini") config.read(r"C:\ProgramData\Program-Search\config.ini")
SEARCH_WINDOW_SIZE = config["General"]["SEARCH_WINDOW_SIZE"]
RESULTS_WINDOW_SIZE = config["General"]["RESULTS_WINDOW_SIZE"]
PREVIEW_WINDOW_SIZE = config["General"]["PREVIEW_WINDOW_SIZE"]
SEARCH_ROOT = config["Paths"]["SEARCH_ROOT"] SEARCH_ROOT = config["Paths"]["SEARCH_ROOT"]
TRASH_DIR = config["Paths"]["TRASH_DIR"] TRASH_DIR = config["Paths"]["TRASH_DIR"]
TRASH_ENABLED = config.getboolean("Features", "TRASH_ENABLED") TRASH_ENABLED = config.getboolean("Features", "TRASH_ENABLED")
@@ -30,7 +33,7 @@ os.makedirs(TRASH_DIR, exist_ok=True)
def custom_messagebox(title, message, kind="info"): def custom_messagebox(title, message, kind="info"):
win = tk.Toplevel() win = tk.Toplevel()
win.title(title) win.title(title)
win.geometry("600x300") win.geometry(SEARCH_WINDOW_SIZE)
win.grab_set() win.grab_set()
win.focus_force() win.focus_force()
frame = tk.Frame(win, padx=20, pady=20) frame = tk.Frame(win, padx=20, pady=20)
@@ -101,7 +104,7 @@ def close_all(root):
def popup_search_input(): def popup_search_input():
win = tk.Toplevel() win = tk.Toplevel()
win.title("Search") win.title("Search")
win.geometry("600x300") win.geometry(SEARCH_WINDOW_SIZE)
center_window(win) center_window(win)
tk.Label(win, text="Enter program number, part number, or name:").pack(pady=10) tk.Label(win, text="Enter program number, part number, or name:").pack(pady=10)
@@ -149,7 +152,7 @@ def search_files(term):
def popup_results_list(matches): def popup_results_list(matches):
win = tk.Toplevel() win = tk.Toplevel()
win.title("Matches Found") win.title("Matches Found")
win.geometry("1200x1000") win.geometry(RESULTS_WINDOW_SIZE)
center_window(win) center_window(win)
tk.Label(win, text="Select files to preview:").pack(pady=10) tk.Label(win, text="Select files to preview:").pack(pady=10)
@@ -181,7 +184,7 @@ def popup_results_list(matches):
def popup_file_preview(path, on_close_callback): def popup_file_preview(path, on_close_callback):
win = tk.Toplevel() win = tk.Toplevel()
win.title(path) win.title(path)
win.geometry("900x1000") win.geometry(PREVIEW_WINDOW_SIZE)
box = scrolledtext.ScrolledText(win, wrap=tk.WORD) box = scrolledtext.ScrolledText(win, wrap=tk.WORD)
box.pack(expand=True, fill="both") box.pack(expand=True, fill="both")
+5
View File
@@ -1,3 +1,8 @@
[General]
SEARCH_WINDOW_SIZE = 600x300
RESULTS_WINDOW_SIZE = 1200x1000
PREVIEW_WINDOW_SIZE = 900x1000
[Paths] [Paths]
SEARCH_ROOT = C:\CNCPrograms\Programs SEARCH_ROOT = C:\CNCPrograms\Programs
TRASH_DIR = C:\CNCPrograms\Trash TRASH_DIR = C:\CNCPrograms\Trash