Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Replace themeID and style hints with class property #11226

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

Warchamp7
Copy link
Member

Description

In the past we've used a custom property called themeID to apply special styling to widgets. These widgets could be targeted using attribute style CSS selectors like
QWidget[themeID="addIcon"]. This approach was flawed in instances where we wanted to apply multiple of these adjustments on a single widget.

To solve that, we adjusted to instead using a boolean value which could be targeted with QWidget[addIcon="true"]

However, we have recently discovered that QSS has (almost completely undocumented) special handling for when widgets have a custom property named class, allowing the class selector like CSS

myWidget->setProperty("class", "addIcon toolButton")

QSS

.addIcon {
    /* styles */
}

.toolButton {
    /* styles */
}

Motivation and Context

Standardizes and unifies our approach for applying special appearance changes to widgets.

How Has This Been Tested?

Ensured that the appearance of specific widgets all looks correct

Types of changes

  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Warchamp7 Warchamp7 force-pushed the standardize-theming-hints branch 2 times, most recently from 26195ef to e3cb695 Compare August 31, 2024 05:48
@WizardCM WizardCM added Enhancement Improvement to existing functionality Code Cleanup Non-breaking change which makes code smaller or more readable labels Aug 31, 2024
@RytoEX RytoEX self-assigned this Sep 3, 2024
UI/forms/OBSAbout.ui Outdated Show resolved Hide resolved
UI/data/themes/Yami.obt Outdated Show resolved Hide resolved
UI/data/themes/Yami.obt Outdated Show resolved Hide resolved
UI/data/themes/Yami.obt Outdated Show resolved Hide resolved
@RytoEX RytoEX merged commit cb02696 into obsproject:master Oct 4, 2024
14 checks passed
@RytoEX RytoEX added this to the OBS Studio 31 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Non-breaking change which makes code smaller or more readable Enhancement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants