use text inputs for dashboard numeric fields
This commit is contained in:
1 parent
fe53debeb1
commit
ba2e159cad
2 files changed
+2
-15
No files matched your search
@@ -88,7 +88,7 @@ class DashboardApp:
|
||||
self.scan_button.pack(side="left", padx=4)
|
||||
button(tool_row, "WiFi ADB", self.open_wifi_adb, width=118).pack(side="left", padx=3)
|
||||
ttk.Label(tool_row, text="Y偏移:", background=theme.SURFACE, foreground=theme.MUTED).pack(side="left", padx=(8, 3))
|
||||
ttk.Spinbox(tool_row, from_=-200, to=200, textvariable=self.y_var, width=6).pack(side="left")
|
||||
ttk.Entry(tool_row, textvariable=self.y_var, width=7).pack(side="left")
|
||||
button(tool_row, "保存配置", self.save_config, width=126).pack(side="right", padx=3)
|
||||
button(tool_row, "截图+OCR", self.screenshot_ocr, kind="primary", width=132).pack(side="right", padx=3)
|
||||
|
||||
|
||||
@@ -474,20 +474,7 @@ def spin_field(
|
||||
width: int | None = None,
|
||||
state: str = "normal",
|
||||
) -> tk.Frame:
|
||||
row = field_shell(parent, label)
|
||||
if variable is None:
|
||||
variable = tk.StringVar(value=str(value))
|
||||
spin = ttk.Spinbox(
|
||||
row,
|
||||
from_=from_,
|
||||
to=to,
|
||||
increment=increment,
|
||||
textvariable=variable,
|
||||
width=width,
|
||||
state=state,
|
||||
)
|
||||
spin.pack(fill="x", padx=9, pady=(0, 8))
|
||||
return row
|
||||
return field(parent, label, variable, value=value)
|
||||
|
||||
|
||||
def switch_row(parent, label: str, variable: tk.Variable | None = None, value: bool = False) -> tk.Frame:
|
||||
|
||||
Reference in new issue
Block a user