Update Screen: Cong cu, settings, them/Chinh sua task
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+21
-16
@@ -70,18 +70,20 @@ class TaskEditorDialog(QDialog):
|
||||
self.edited_task: Optional[dict] = None
|
||||
self.setWindowTitle(tr("schedtask.editor_title_edit" if task else "schedtask.editor_title_new"))
|
||||
self.resize(560, 680)
|
||||
# Flat inputs: every field (text, list, combo, spin, date) is transparent
|
||||
# so it shows the page background (the app theme otherwise fills inputs
|
||||
# with a lighter box) — just a light outline, consistent with the rest of
|
||||
# the app. The combo drop-down popup keeps a solid dark background so its
|
||||
# items stay readable.
|
||||
# Inputs in this dense form sit flat on the dialog rather than on their
|
||||
# own raised surface — the app-wide sheet styles everything else here,
|
||||
# including the combo popup, so nothing needs a colour override.
|
||||
self.setStyleSheet(
|
||||
"QLineEdit, QPlainTextEdit, QListWidget, QComboBox, QAbstractSpinBox {"
|
||||
" background: transparent; }"
|
||||
"QListWidget::item { background: transparent; }")
|
||||
# Only the files/links/depends-on lists go flat (transparent, no boxed
|
||||
# panel) — they sit right next to their own +/trash buttons, which is
|
||||
# enough affordance without a filled background. Title/Description/
|
||||
# Prompt/combos etc. keep the app's normal raised-surface + border
|
||||
# look (theme.py's default for these widget types): a transparent
|
||||
# single/multi-line box with only a 1px border was tried here and
|
||||
# turned out too faint against the group's own background to read as
|
||||
# an editable field at all ("không thể nhận ra ô textbox của prompt").
|
||||
# Scoped to #flatList, not bare QListWidget — that would also blank
|
||||
# out the sectionIndex sidebar's :selected highlight (set by the app
|
||||
# theme), since a stylesheet set directly on this dialog overrides the
|
||||
# app-wide one for every descendant it matches, regardless of the
|
||||
# theme rule's own selector specificity.
|
||||
self.setStyleSheet("QListWidget#flatList, QListWidget#flatList::item { background: transparent; }")
|
||||
|
||||
outer = QVBoxLayout(self)
|
||||
scroll = QScrollArea()
|
||||
@@ -93,11 +95,11 @@ class TaskEditorDialog(QDialog):
|
||||
root = QVBoxLayout(content)
|
||||
|
||||
# ---- basics ----------------------------------------------------
|
||||
# Held in its own widget so the whole block can be moved into a step
|
||||
# tab below; it is a bare form, not a group box.
|
||||
self._basic_box = QWidget()
|
||||
# A QGroupBox like the other four step pages (Schedule/Input/
|
||||
# Dependency/Execution), so this one isn't the odd one out once it's
|
||||
# moved into its own step page below (bare background, no title).
|
||||
self._basic_box = QGroupBox(tr("schedtask.g_basic"))
|
||||
form = QFormLayout(self._basic_box)
|
||||
form.setContentsMargins(0, 0, 0, 0)
|
||||
self.title_edit = QLineEdit(self.task.get("title", ""))
|
||||
# Description is the source of truth. Its ✨ button GENERATES the Prompt
|
||||
# (Input) FROM the description — the title is just the task's label and
|
||||
@@ -322,6 +324,7 @@ class TaskEditorDialog(QDialog):
|
||||
# multi-select file dialog and APPENDS (never wipes what's already
|
||||
# there), the trash button removes just the selected row(s).
|
||||
self.files_list = QListWidget()
|
||||
self.files_list.setObjectName("flatList")
|
||||
self.files_list.setMaximumHeight(90)
|
||||
self.files_list.setSelectionMode(QListWidget.ExtendedSelection)
|
||||
for p in inp.get("file_paths", []) or []:
|
||||
@@ -347,6 +350,7 @@ class TaskEditorDialog(QDialog):
|
||||
# Links — same "+"-list pattern; "+" prompts for one URL at a time
|
||||
# (fetched best-effort and inlined as context, same as file attachments).
|
||||
self.links_list = QListWidget()
|
||||
self.links_list.setObjectName("flatList")
|
||||
self.links_list.setMaximumHeight(90)
|
||||
self.links_list.setSelectionMode(QListWidget.ExtendedSelection)
|
||||
for u in inp.get("links", []) or []:
|
||||
@@ -396,6 +400,7 @@ class TaskEditorDialog(QDialog):
|
||||
# Fan-in: tick every task this one must WAIT for — it won't run until
|
||||
# ALL of them are Done (parallel predecessors feeding one successor).
|
||||
self.depends_list = QListWidget()
|
||||
self.depends_list.setObjectName("flatList")
|
||||
self.depends_list.setMaximumHeight(96)
|
||||
current_deps = set(dep.get("depends_on") or [])
|
||||
for t in self.all_tasks:
|
||||
|
||||
Reference in New Issue
Block a user