Adjustable Window sizes
Changed window sizes to be controlled by config.
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user