Skip to content

refactor(stylehelper): add generic state stylesheet composer#11

Open
CPythoner wants to merge 12 commits intodevelopfrom
codex/determine-qelbutton-style-location
Open

refactor(stylehelper): add generic state stylesheet composer#11
CPythoner wants to merge 12 commits intodevelopfrom
codex/determine-qelbutton-style-location

Conversation

@CPythoner
Copy link
Copy Markdown
Owner

Motivation

  • Prevent QelStyleHelper from becoming a collection of per-component state-sheet functions by providing a reusable composer for common visual states.
  • Let QelTheme remain the single source of token ownership while QelStyleHelper offers generic primitives to derive QSS for any component.
  • Avoid forcing each new component to add a bespoke *StateStyleSheet function; components should only map theme tokens into a reusable state set.

Description

  • Replace ButtonStyle with a generic ComponentStyle and add StateStyleSet to represent the six common visual states (normal, hover, active, focus, disabled, loading).
  • Add composeStateStyleSheet(const QString &baseSelector, const QString &loadingSelector, const StateStyleSet &styles, bool disableFocusOutline) to generate standard state QSS for arbitrary component selectors.
  • Add buttonStateStyles(...) to map button theme tokens into a StateStyleSet and keep buttonStateStyleSheet(...) as a thin wrapper that calls the generic composer for backward compatibility.
  • Update QelButton::updateButtonStyle() to use QelStyleHelper::buttonStateStyleSheet(...) for state QSS while retaining geometry/size/border-radius logic inside the component.

Testing

  • Attempted to build the button target with qmake QelButton/QelButton.pro -o /tmp/QelButton.Makefile && make -f /tmp/QelButton.Makefile -j2 and the command failed because qmake is not installed in the environment (command not found).
  • Performed local code inspection to verify that QelButton now delegates state stylesheet composition to the helper and that the helper provides the generic composer; no runtime artifacts were produced due to the missing qmake tool.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant