Reworked UI for easier workflow.
This commit is contained in:
50
ptlinux/ui/dialogs/activity.py
Normal file
50
ptlinux/ui/dialogs/activity.py
Normal file
@@ -0,0 +1,50 @@
|
||||
"""Activity-log auxiliary window."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Callable
|
||||
|
||||
from ..viewmodels.dashboard import fitted_window_size
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ActivityWindow:
|
||||
window: Any
|
||||
log: Any
|
||||
|
||||
|
||||
def build_activity_window(
|
||||
root: Any,
|
||||
*,
|
||||
tk_module: Any,
|
||||
ui_scale: float,
|
||||
apply_window_icon: Callable[[Any], None],
|
||||
) -> ActivityWindow:
|
||||
window = tk_module.Toplevel(root)
|
||||
window.title("PristonTale EU — Activity")
|
||||
width, height = fitted_window_size(
|
||||
800,
|
||||
400,
|
||||
scale=ui_scale,
|
||||
screen_width=window.winfo_screenwidth(),
|
||||
screen_height=window.winfo_screenheight(),
|
||||
)
|
||||
window.geometry(f"{width}x{height}")
|
||||
window.resizable(False, False)
|
||||
window.configure(background="#0c0908")
|
||||
apply_window_icon(window)
|
||||
log = tk_module.Text(
|
||||
window,
|
||||
background="#100d0c",
|
||||
foreground="#d8cbbd",
|
||||
insertbackground="#f8fafc",
|
||||
relief="flat",
|
||||
font=("Monospace", 9),
|
||||
padx=10,
|
||||
pady=8,
|
||||
state="disabled",
|
||||
)
|
||||
log.pack(fill="both", expand=True, padx=10, pady=10)
|
||||
window.withdraw()
|
||||
return ActivityWindow(window=window, log=log)
|
||||
Reference in New Issue
Block a user