新增黑色主题,优化代码

This commit is contained in:
2025-05-17 10:44:30 +08:00
parent 628838aa32
commit 272652d5d1
12 changed files with 8050 additions and 7942 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -329,6 +329,9 @@
('subprocess',
'C:\\Users\\Yuxing\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\subprocess.py',
'PYMODULE'),
('sv_ttk',
'D:\\NETWORK_SYNC\\0_DAILY\\CodeProjects\\purposed_apps\\Robocopy_GUI\\robocopy\\Lib\\site-packages\\sv_ttk\\__init__.py',
'PYMODULE'),
('tarfile',
'C:\\Users\\Yuxing\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\tarfile.py',
'PYMODULE'),

View File

@@ -18,8 +18,8 @@ missing module named grp - imported by shutil (delayed, optional), tarfile (opti
missing module named pwd - imported by posixpath (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib._local (optional), subprocess (delayed, conditional, optional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional)
missing module named 'collections.abc' - imported by tracemalloc (top-level), traceback (top-level), typing (top-level), inspect (top-level), logging (top-level), importlib.resources.readers (top-level), selectors (top-level)
missing module named posix - imported by posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional), os (conditional, optional)
missing module named 'collections.abc' - imported by traceback (top-level), typing (top-level), inspect (top-level), logging (top-level), importlib.resources.readers (top-level), selectors (top-level), tracemalloc (top-level)
missing module named posix - imported by os (conditional, optional), posixpath (optional), shutil (conditional), importlib._bootstrap_external (conditional)
missing module named resource - imported by posix (top-level)
missing module named vms_lib - imported by platform (delayed, optional)
missing module named 'java.lang' - imported by platform (delayed, optional)

View File

@@ -15,7 +15,7 @@
<div class="node">
<a name="pyi_rth__tkinter.py"></a>
<a target="code" href="///D:/NETWORK_SYNC/0_DAILY/CodeProjects/venv_purposed_apps/Lib/site-packages/PyInstaller/hooks/rthooks/pyi_rth__tkinter.py" type="text/plain"><tt>pyi_rth__tkinter.py</tt></a>
<a target="code" href="///D:/NETWORK_SYNC/0_DAILY/CodeProjects/purposed_apps/Robocopy_GUI/robocopy/Lib/site-packages/PyInstaller/hooks/rthooks/pyi_rth__tkinter.py" type="text/plain"><tt>pyi_rth__tkinter.py</tt></a>
<span class="moduletype">Script</span> <div class="import">
imports:
<a href="#os">os</a>
@@ -32,7 +32,7 @@ imported by:
<div class="node">
<a name="pyi_rth_inspect.py"></a>
<a target="code" href="///D:/NETWORK_SYNC/0_DAILY/CodeProjects/venv_purposed_apps/Lib/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py" type="text/plain"><tt>pyi_rth_inspect.py</tt></a>
<a target="code" href="///D:/NETWORK_SYNC/0_DAILY/CodeProjects/purposed_apps/Robocopy_GUI/robocopy/Lib/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py" type="text/plain"><tt>pyi_rth_inspect.py</tt></a>
<span class="moduletype">Script</span> <div class="import">
imports:
<a href="#inspect">inspect</a>
@@ -209,6 +209,7 @@ imports:
&#8226; <a href="#sre_parse">sre_parse</a>
&#8226; <a href="#stat">stat</a>
&#8226; <a href="#subprocess">subprocess</a>
&#8226; <a href="#sv_ttk">sv_ttk</a>
&#8226; <a href="#threading">threading</a>
&#8226; <a href="#tkinter">tkinter</a>
&#8226; <a href="#tkinter.filedialog">tkinter.filedialog</a>
@@ -261,6 +262,7 @@ imported by:
&#8226; <a href="#importlib.metadata">importlib.metadata</a>
&#8226; <a href="#importlib.metadata._meta">importlib.metadata._meta</a>
&#8226; <a href="#importlib.resources.readers">importlib.resources.readers</a>
&#8226; <a href="#sv_ttk">sv_ttk</a>
</div>
@@ -5060,6 +5062,7 @@ imported by:
&#8226; <a href="#re">re</a>
&#8226; <a href="#robocopy_mirror_gui.py">robocopy_mirror_gui.py</a>
&#8226; <a href="#statistics">statistics</a>
&#8226; <a href="#sv_ttk">sv_ttk</a>
&#8226; <a href="#tempfile">tempfile</a>
&#8226; <a href="#tokenize">tokenize</a>
&#8226; <a href="#tracemalloc">tracemalloc</a>
@@ -6371,6 +6374,7 @@ imported by:
&#8226; <a href="#importlib.resources.readers">importlib.resources.readers</a>
&#8226; <a href="#pathlib._abc">pathlib._abc</a>
&#8226; <a href="#pathlib._local">pathlib._local</a>
&#8226; <a href="#sv_ttk">sv_ttk</a>
&#8226; <a href="#zipfile._path">zipfile._path</a>
</div>
@@ -7182,6 +7186,26 @@ imported by:
</div>
<div class="node">
<a name="sv_ttk"></a>
<a target="code" href="///D:/NETWORK_SYNC/0_DAILY/CodeProjects/purposed_apps/Robocopy_GUI/robocopy/Lib/site-packages/sv_ttk/__init__.py" type="text/plain"><tt>sv_ttk</tt></a>
<span class="moduletype">Package</span> <div class="import">
imports:
<a href="#__future__">__future__</a>
&#8226; <a href="#functools">functools</a>
&#8226; <a href="#pathlib">pathlib</a>
&#8226; <a href="#tkinter">tkinter</a>
&#8226; <a href="#tkinter.ttk">tkinter.ttk</a>
</div>
<div class="import">
imported by:
<a href="#robocopy_mirror_gui.py">robocopy_mirror_gui.py</a>
</div>
</div>
<div class="node">
<a name="sys"></a>
<tt>sys</tt> <span class="moduletype"><i>(builtin module)</i></span> <div class="import">
@@ -7427,6 +7451,7 @@ imports:
<div class="import">
imported by:
<a href="#robocopy_mirror_gui.py">robocopy_mirror_gui.py</a>
&#8226; <a href="#sv_ttk">sv_ttk</a>
&#8226; <a href="#tkinter.commondialog">tkinter.commondialog</a>
&#8226; <a href="#tkinter.constants">tkinter.constants</a>
&#8226; <a href="#tkinter.dialog">tkinter.dialog</a>
@@ -7579,6 +7604,7 @@ imports:
<div class="import">
imported by:
<a href="#robocopy_mirror_gui.py">robocopy_mirror_gui.py</a>
&#8226; <a href="#sv_ttk">sv_ttk</a>
&#8226; <a href="#tkinter">tkinter</a>
</div>

Binary file not shown.

View File

@@ -1,5 +1,6 @@
import tkinter as tk
from tkinter import ttk, filedialog, messagebox, scrolledtext
import sv_ttk # Import the library
import subprocess
import threading
import platform
@@ -45,32 +46,36 @@ class RobocopyMirrorApp: # Renamed class for clarity
# Frame for inputs
input_frame = ttk.Frame(main_content_frame, padding="10")
input_frame.pack(fill=tk.X)
input_frame = ttk.Frame(main_content_frame, padding="15 15 15 10") # Increased padding
input_frame.pack(fill=tk.X, padx=10, pady=(10,0)) # Added horizontal padding for the frame itself
# Source Row
ttk.Label(input_frame, text="Source:").grid(row=0, column=0, padx=5, pady=5, sticky=tk.W)
ttk.Label(input_frame, text="Source:").grid(row=0, column=0, padx=5, pady=10, sticky=tk.W) # Increased pady
self.source_entry = ttk.Entry(input_frame, textvariable=self.source_var, width=50)
self.source_entry.grid(row=0, column=1, padx=5, pady=5, sticky=tk.EW)
self.source_entry.grid(row=0, column=1, padx=5, pady=10, sticky=tk.EW) # Increased pady
self.source_button = ttk.Button(input_frame, text="Browse...", command=self.browse_source)
self.source_button.grid(row=0, column=2, padx=5, pady=5)
self.source_button.grid(row=0, column=2, padx=5, pady=10) # Increased pady
# Target Row
ttk.Label(input_frame, text="Target:").grid(row=1, column=0, padx=5, pady=5, sticky=tk.W)
ttk.Label(input_frame, text="Target:").grid(row=1, column=0, padx=5, pady=10, sticky=tk.W) # Increased pady
self.target_entry = ttk.Entry(input_frame, textvariable=self.target_var, width=50)
self.target_entry.grid(row=1, column=1, padx=5, pady=5, sticky=tk.EW)
self.target_entry.grid(row=1, column=1, padx=5, pady=10, sticky=tk.EW) # Increased pady
self.target_button = ttk.Button(input_frame, text="Browse...", command=self.browse_target)
self.target_button.grid(row=1, column=2, padx=5, pady=5)
self.target_button.grid(row=1, column=2, padx=5, pady=10) # Increased pady
# Configure input frame column weights for resizing
input_frame.columnconfigure(1, weight=1)
# Run Button
self.run_button = ttk.Button(main_content_frame, text="Run Robocopy Mirror", command=self.start_robocopy_thread)
self.run_button.pack(pady=10)
# Run Button Frame for better padding control
run_button_frame = ttk.Frame(main_content_frame)
run_button_frame.pack(pady=(15, 10)) # Increased pady
self.run_button = ttk.Button(run_button_frame, text="Run Robocopy Mirror", command=self.start_robocopy_thread)
self.run_button.pack()
# Output Area Frame
output_frame = ttk.Frame(main_content_frame, padding="10")
output_frame = ttk.Frame(main_content_frame, padding="15 15 15 10") # Increased padding
output_frame.pack(fill=tk.BOTH, expand=True)
ttk.Label(output_frame, text="Robocopy Output:").pack(anchor=tk.W)
@@ -79,7 +84,7 @@ class RobocopyMirrorApp: # Renamed class for clarity
# --- Disclaimer Label ---
# Packed directly into root, so it stays at the very bottom and can be centered
disclaimer_label = ttk.Label(root, text="Ver. 2.0 @杨昱幸. All Rights Reserved.", font=("Arial", 8))
disclaimer_label = ttk.Label(root, text="Ver. 2.1 @杨昱幸. All Rights Reserved.", font=("Arial", 8))
disclaimer_label.pack(side=tk.BOTTOM, pady=(5, 10)) # Centered by default when using pack with side=BOTTOM
@@ -233,6 +238,7 @@ class RobocopyMirrorApp: # Renamed class for clarity
# --- Main Execution ---
if __name__ == "__main__":
root = tk.Tk()
sv_ttk.set_theme("dark") # Set the dark theme
# Use the renamed class
app = RobocopyMirrorApp(root)
root.protocol("WM_DELETE_WINDOW", app.on_closing)