Skip to content

Commit d2f202b

Browse files
committed
fix(documentation frame): hide mandatory level in simple mode
1 parent 33de635 commit d2f202b

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_documentation_frame.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def _create_documentation_frame(self, current_file: str) -> None:
5959
documentation_grid.pack(fill="both", expand=True)
6060

6161
for row, (text, tooltip) in enumerate(self.DOCUMENTATION_SECTIONS):
62+
if row == 3 and ProgramSettings.get_setting("gui_complexity") == "simple":
63+
# Skip the mandatory level row in simple mode
64+
self.mandatory_level = ttk.Progressbar(documentation_grid, length=100, mode="determinate")
65+
continue
66+
6267
# Create labels for the first column with static descriptive text
6368
label = ttk.Label(documentation_grid, text=text)
6469
label.grid(row=row, column=0, sticky="w")
@@ -78,30 +83,26 @@ def _create_documentation_frame(self, current_file: str) -> None:
7883
self.update_why_why_now_tooltip(current_file)
7984

8085
def _create_bottom_row(self, documentation_grid: ttk.Frame, row: int) -> None:
81-
gui_complexity = ProgramSettings.get_setting("gui_complexity")
82-
8386
bottom_frame = ttk.Frame(documentation_grid)
8487
bottom_frame.grid(row=row, column=1, sticky="ew") # ew to stretch horizontally
8588

8689
self.mandatory_level = ttk.Progressbar(bottom_frame, length=100, mode="determinate")
87-
if gui_complexity != "simple":
88-
self.mandatory_level.pack(side=tk.LEFT, fill="x", expand=True, padx=(0, 100))
90+
self.mandatory_level.pack(side=tk.LEFT, fill="x", expand=True, padx=(0, 100))
8991

9092
auto_open_checkbox = ttk.Checkbutton(
9193
bottom_frame,
9294
text=_("Automatically open documentation links in browser"),
9395
variable=self.auto_open_var,
9496
command=lambda: ProgramSettings.set_setting("auto_open_doc_in_browser", self.auto_open_var.get()),
9597
)
96-
if gui_complexity != "simple":
97-
show_tooltip(
98-
auto_open_checkbox,
99-
_(
100-
"Automatically open all the above documentation links in a browser\n"
101-
"whenever the current intermediate parameter file changes"
102-
),
103-
)
104-
auto_open_checkbox.pack(side=tk.LEFT, expand=False)
98+
show_tooltip(
99+
auto_open_checkbox,
100+
_(
101+
"Automatically open all the above documentation links in a browser\n"
102+
"whenever the current intermediate parameter file changes"
103+
),
104+
)
105+
auto_open_checkbox.pack(side=tk.LEFT, expand=False)
105106

106107
def update_why_why_now_tooltip(self, current_file: str) -> None:
107108
why_tooltip_text = self.local_filesystem.get_seq_tooltip_text(current_file, "why")

0 commit comments

Comments
 (0)