arreglos estetics

This commit is contained in:
2026-02-21 23:08:04 +01:00
parent 859175f23a
commit 36e03e7649
11 changed files with 98 additions and 74 deletions
+2
View File
@@ -1,3 +1,5 @@
PocketSync.exe
# ---> Python # ---> Python
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -1,9 +1,9 @@
{ {
"version": 2, "version": 2,
"active_profile": "Default", "active_profile": "Retroid Pocket 5",
"profiles": [ "profiles": [
{ {
"name": "Default", "name": "Retroid Pocket 5",
"esde_src": "C:/Users/jaild/Retroid/ES-DE", "esde_src": "C:/Users/jaild/Retroid/ES-DE",
"roms_src": "C:/Users/jaild/Retroid/ROMs", "roms_src": "C:/Users/jaild/Retroid/ROMs",
"esde_dst": "F:/ES-DE", "esde_dst": "F:/ES-DE",
+1
View File
@@ -42,6 +42,7 @@ class RobocopySyncEngine(SyncEngine):
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
text=True, text=True,
universal_newlines=True, universal_newlines=True,
creationflags=subprocess.CREATE_NO_WINDOW,
) )
files_copied = 0 files_copied = 0
+3
View File
@@ -23,6 +23,9 @@ def main() -> None:
cm.load() cm.load()
root = tk.Tk() root = tk.Tk()
ico = os.path.join(BASE_DIR, "assets", "pocketsync.ico")
if os.path.isfile(ico):
root.iconbitmap(ico)
PocketSyncApp(root, cm) PocketSyncApp(root, cm)
root.mainloop() root.mainloop()
+4 -3
View File
@@ -27,8 +27,9 @@ class PocketSyncApp:
# ------------------------------------------------------------------ # ------------------------------------------------------------------
def _build_ui(self) -> None: def _build_ui(self) -> None:
self.root.title("PocketSync") self.root.title("PocketSync (© 2026 JailDesigner)")
self.root.geometry(f"{styles.WINDOW_WIDTH}x{styles.WINDOW_HEIGHT}") self.root.geometry(f"{styles.WINDOW_WIDTH}x{styles.WINDOW_HEIGHT}")
self.root.configure(bg=styles.APP_BG)
# --- Barra de perfiles --- # --- Barra de perfiles ---
self.profile_bar = ProfileBar(self.root, on_change=self._on_profile_change) self.profile_bar = ProfileBar(self.root, on_change=self._on_profile_change)
@@ -56,7 +57,7 @@ class PocketSyncApp:
# --- Botón Sync --- # --- Botón Sync ---
tk.Button( tk.Button(
self.root, self.root,
text="Sync Now", text="Sincronizar",
font=styles.FONT_BUTTON, font=styles.FONT_BUTTON,
command=self._run_sync, command=self._run_sync,
).pack(pady=6) ).pack(pady=6)
@@ -67,7 +68,7 @@ class PocketSyncApp:
# --- Panel de resumen --- # --- Panel de resumen ---
self.summary = SummaryPanel(self.root) self.summary = SummaryPanel(self.root)
self.summary.pack(fill="x", padx=styles.PAD_X, pady=styles.PAD_Y) self.summary.pack(fill="both", expand=True, padx=styles.PAD_X, pady=styles.PAD_Y)
self.root.protocol("WM_DELETE_WINDOW", self._on_close) self.root.protocol("WM_DELETE_WINDOW", self._on_close)
+24 -14
View File
@@ -13,29 +13,40 @@ class PathPanel(tk.LabelFrame):
parent, parent,
text=title, text=title,
font=styles.FONT_HEADING, font=styles.FONT_HEADING,
padx=styles.PAD_X, padx=8,
pady=styles.PAD_Y, pady=4,
**kwargs, **kwargs,
) )
self.columnconfigure(1, weight=1)
self.path_esde = tk.StringVar() self.path_esde = tk.StringVar()
self.path_roms = tk.StringVar() self.path_roms = tk.StringVar()
self._add_selector("ES-DE:", self.path_esde) self._add_selector(0, "ES-DE:", self.path_esde)
self._add_selector("ROMs:", self.path_roms) self._add_selector(1, "ROMs:", self.path_roms)
def _add_selector(self, label: str, var: tk.StringVar, callback: Optional[Callable] = None): def _add_selector(self, row: int, label: str, var: tk.StringVar, callback: Optional[Callable] = None):
frame = tk.Frame(self) tk.Label(
frame.pack(fill="x", pady=2) self,
text=label,
width=8,
anchor="w",
font=styles.FONT_LABEL,
).grid(row=row, column=0, sticky="w", pady=2)
tk.Entry(
self,
textvariable=var,
font=styles.FONT_SMALL,
).grid(row=row, column=1, sticky="ew", padx=4, pady=2)
tk.Label(frame, text=label, width=10, anchor="w", font=styles.FONT_LABEL).pack(side="left")
tk.Entry(frame, textvariable=var, width=55, font=styles.FONT_SMALL).pack(side="left", padx=4)
tk.Button( tk.Button(
frame, self,
text="Buscar", text="Buscar",
font=styles.FONT_SMALL, font=styles.FONT_SMALL,
command=lambda: self._choose(var, callback), command=lambda: self._choose(var, callback),
).pack(side="left") ).grid(row=row, column=2, sticky="e", pady=2)
def _choose(self, var: tk.StringVar, callback: Optional[Callable]): def _choose(self, var: tk.StringVar, callback: Optional[Callable]):
path = filedialog.askdirectory() path = filedialog.askdirectory()
@@ -47,11 +58,10 @@ class PathPanel(tk.LabelFrame):
def set_roms_callback(self, callback: Callable[[str], None]) -> None: def set_roms_callback(self, callback: Callable[[str], None]) -> None:
"""Registra callback que se invoca al cambiar la ruta de ROMs.""" """Registra callback que se invoca al cambiar la ruta de ROMs."""
# Reemplaza el selector de ROMs con uno que tenga el callback
for widget in self.winfo_children(): for widget in self.winfo_children():
widget.destroy() widget.destroy()
self._add_selector("ES-DE:", self.path_esde) self._add_selector(0, "ES-DE:", self.path_esde)
self._add_selector("ROMs:", self.path_roms, callback=callback) self._add_selector(1, "ROMs:", self.path_roms, callback=callback)
def get_esde(self) -> str: def get_esde(self) -> str:
return self.path_esde.get() return self.path_esde.get()
+33 -31
View File
@@ -6,56 +6,58 @@ _MAX_FILE_LEN = 80
class StatusBar(tk.Frame): class StatusBar(tk.Frame):
"""Barra de estado con tres labels: sistema, fase y archivo actual.""" """Barra de estado con tres filas: sistema, fase y archivo actual."""
def __init__(self, parent, **kwargs): def __init__(self, parent, **kwargs):
super().__init__(parent, bg=styles.STATUS_BG, relief="sunken", bd=2, **kwargs) super().__init__(parent, bg=styles.STATUS_BG, relief="groove", bd=1, **kwargs)
self._label_system = tk.Label( self.columnconfigure(1, weight=1)
labels = ["Sistema:", "Fase:", "Archivo:"]
self._values = []
for row, name in enumerate(labels):
tk.Label(
self, self,
text="Sistema: -", text=name,
font=styles.FONT_LABEL + ("bold",) if isinstance(styles.FONT_LABEL, tuple) else styles.FONT_LABEL, font=styles.FONT_LABEL + ("bold",),
bg=styles.STATUS_BG, bg=styles.STATUS_BG,
fg=styles.STATUS_SYSTEM_FG, fg=styles.STATUS_LABEL_FG,
anchor="w", anchor="w",
) width=9,
self._label_system.pack(fill="x", padx=10, pady=3) ).grid(row=row, column=0, sticky="w", padx=(10, 4), pady=3)
self._label_phase = tk.Label( val = tk.Label(
self, self,
text="Fase: -", text="-",
font=styles.FONT_LABEL,
bg=styles.STATUS_BG,
fg=styles.STATUS_PHASE_FG,
anchor="w",
)
self._label_phase.pack(fill="x", padx=10, pady=3)
self._label_file = tk.Label(
self,
text="Archivo: -",
font=styles.FONT_SMALL, font=styles.FONT_SMALL,
bg=styles.STATUS_BG, bg=styles.STATUS_BG,
fg=styles.STATUS_FILE_FG, fg=styles.STATUS_VALUE_FG,
anchor="w", anchor="w",
) )
self._label_file.pack(fill="x", padx=10, pady=3) val.grid(row=row, column=1, sticky="ew", padx=(0, 10), pady=3)
self._values.append(val)
def set_system(self, text: str) -> None: def set_system(self, text: str) -> None:
self._label_system.config(text=text) # Eliminar el prefijo "Sistema: " si viene incluido (compatibilidad con app.py)
self._label_system.update_idletasks() if text.startswith("Sistema: "):
text = text[len("Sistema: "):]
self._values[0].config(text=text)
self._values[0].update_idletasks()
def set_phase(self, text: str) -> None: def set_phase(self, text: str) -> None:
self._label_phase.config(text=text) if text.startswith("Fase: "):
self._label_phase.update_idletasks() text = text[len("Fase: "):]
self._values[1].config(text=text)
self._values[1].update_idletasks()
def set_file(self, text: str) -> None: def set_file(self, text: str) -> None:
if len(text) > _MAX_FILE_LEN: if len(text) > _MAX_FILE_LEN:
text = "..." + text[-(_MAX_FILE_LEN - 3):] text = "..." + text[-(_MAX_FILE_LEN - 3):]
self._label_file.config(text=f"Archivo: {text}") self._values[2].config(text=text)
self._label_file.update_idletasks() self._values[2].update_idletasks()
def reset(self) -> None: def reset(self) -> None:
self.set_system("Sistema: ✅ COMPLETADO") self._values[0].config(text="✅ COMPLETADO")
self.set_phase("Fase: -") self._values[1].config(text="-")
self.set_file("-") self._values[2].config(text="-")
+14 -9
View File
@@ -5,22 +5,27 @@ FONT_FAMILY = "Segoe UI"
FONT_HEADING = (FONT_FAMILY, 11, "bold") FONT_HEADING = (FONT_FAMILY, 11, "bold")
FONT_LABEL = (FONT_FAMILY, 10) FONT_LABEL = (FONT_FAMILY, 10)
FONT_SMALL = (FONT_FAMILY, 9) FONT_SMALL = (FONT_FAMILY, 9)
FONT_BUTTON = (FONT_FAMILY, 11, "bold") FONT_BUTTON = (FONT_FAMILY, 10, "bold")
FONT_MONO = ("Consolas", 9) FONT_MONO = ("Consolas", 9)
# Colores de la barra de estado # Colores base
STATUS_BG = "#2a2a2a" APP_BG = "#f5f5f5" # fondo ventana principal
STATUS_SYSTEM_FG = "#00ff00" FRAME_BG = "#ffffff" # fondo de frames internos
STATUS_PHASE_FG = "#00aaff" TEXT_PRIMARY = "#1a1a1a" # texto principal
STATUS_FILE_FG = "#ffaa00" TEXT_SECONDARY = "#555555" # texto secundario
# StatusBar — Light
STATUS_BG = "#f0f0f0"
STATUS_LABEL_FG = TEXT_PRIMARY
STATUS_VALUE_FG = "#333333"
# Colores del panel de resumen # Colores del panel de resumen
SUMMARY_BG = "#f0f0f0" SUMMARY_BG = "#ffffff"
SUMMARY_FG = "#000000" SUMMARY_FG = TEXT_PRIMARY
# Dimensiones de ventana # Dimensiones de ventana
WINDOW_WIDTH = 800 WINDOW_WIDTH = 800
WINDOW_HEIGHT = 720 WINDOW_HEIGHT = 860
# Padding genérico # Padding genérico
PAD_X = 10 PAD_X = 10
+2 -2
View File
@@ -13,13 +13,13 @@ class SummaryPanel(tk.Frame):
self._text = tk.Text( self._text = tk.Text(
self, self,
height=6, height=10,
state="disabled", state="disabled",
bg=styles.SUMMARY_BG, bg=styles.SUMMARY_BG,
fg=styles.SUMMARY_FG, fg=styles.SUMMARY_FG,
font=styles.FONT_MONO, font=styles.FONT_MONO,
) )
self._text.pack(fill="both", expand=False, padx=styles.PAD_X, pady=styles.PAD_Y) self._text.pack(fill="both", expand=True, padx=styles.PAD_X, pady=styles.PAD_Y)
def append(self, line: str) -> None: def append(self, line: str) -> None:
self._text.configure(state="normal") self._text.configure(state="normal")
+2 -2
View File
@@ -26,14 +26,14 @@ class SystemList(tk.Frame):
tk.Button( tk.Button(
btn_frame, btn_frame,
text="Select All", text="Seleccionar todo",
font=styles.FONT_SMALL, font=styles.FONT_SMALL,
command=self._select_all, command=self._select_all,
).pack(side="left", padx=2) ).pack(side="left", padx=2)
tk.Button( tk.Button(
btn_frame, btn_frame,
text="Select None", text="Quitar selección",
font=styles.FONT_SMALL, font=styles.FONT_SMALL,
command=self._select_none, command=self._select_none,
).pack(side="left", padx=2) ).pack(side="left", padx=2)