Move sidebar panel title theming into SidebarPanel base class
Débutant
enhancementgood first issue
1 ★
Poids du clone léger
Mise à jour
Description
The line applying the title label's theme stylesheet is duplicated identically across every sidebar panel's `_apply_theme()`:
```python
self.title_label.setStyleSheet(self.title_stylesheet(base_fg, card_border))
```
Found in:
- `pandaplot/gui/components/sidebar/fit/fit_panel.py`
- `pandaplot/gui/components/sidebar/signal/signal_panel.py`
- `pandaplot/gui/components/sidebar/chart/chart_properties_panel.py`
- `pandaplot/gui/components/sidebar/transform/transform_panel.py`
- `pandaplot/gui/components/sidebar/statistics/statistics_panel.py`
- `pandaplot/gui/components/sidebar/statistics/descriptive_panel.py`
- `pandaplot/gui/components/sidebar/preprocessing/preprocessing_panel.py`
- `pandaplot/gui/components/sidebar/analysis/analysis_panel.py`
- `pandaplot/gui/components/sidebar/search/search_panel.py`
- `pandaplot/gui/components/sidebar/project/project_view_panel.py`
`SidebarPanel` (`pandaplot/gui/components/sidebar/panels/sidebar_panel.py`) already owns `title_label` (typed `Optional[QLabel]`) and the shared `title_stylesheet()` static method, but applying the stylesheet to `title_label` is left to each subclass to repeat.
Proposed fix: add something like `SidebarPanel._apply_title_theme(base_fg, card_border)` that guards `if self.title_label is not None:` before calling `setStyleSheet`, and have all 10 panels call it instead of duplicating the line. The `None` guard matters because `title_label` is only set once `_set_title()` runs, and `_apply_theme()` can in principle be invoked before that (e.g. via the base `ThemeEvents.THEME_CHANGED` subscription) depending on subclass init order.
Raised while reviewing PR #172's fit panel changes.
Issues similaires
Tout voir
Python
Débutant
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an im…
Mise à jour
Python
Débutant
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:54…
Mise à jour
Python
Débutant
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the r…
Mise à jour