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: Composable Themes System #9653

Merged
merged 6 commits into from
Apr 21, 2024
Merged

Conversation

derrod
Copy link
Member

@derrod derrod commented Oct 2, 2023

Description

This PR introduces a system that allows "layering" of theme files, i.e. a base theme can provide styling, a variant theme the colour palette, and optional high-contrast adjustments or user customisation can adjust it to suit the user's needs.
Themes will be able to specify variables that can be overwritten and extended by child themes, to provide much more flexibility than the Qt palette system currently in use, as it allows arbitrary values to be specified.

Bonus feature: Loaded theme can be watched for changes and automatically reloaded when edited (hidden config option [Appearance] -> AutoReload).

Also see: Overview of syntax and design goals (will be migrated to wiki/design repo once finalised).

Additionally, theme settings are moved to a new "Appearance" tab in the settings menu, which will be expanded upon in the future:
2023-11-14_11-21-58_7gwq8h

Motivation and Context

This PR is based around conversations with @Warchamp7 on how we can improve theming in OBS and better accomodate new UI elements in the future.

An additional benefit for third-party themes is that they can inherit stock OBS themes and adjust them to their needs without having to copy everything into their own file. This also should make them forward-compatible as styling for the UI elements introduced in PRs such as #8446 will automatically be inherited and adjusted to the themes colour palette.

How Has This Been Tested?

Built a basic test base theme (Yami.obt) and variant theme (Yami_test.ovt) to validate parsers, UI, and composing to be functional.

Types of changes

  • New feature (non-breaking change which adds functionality)

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.

@derrod derrod added Seeking Testers Build artifacts on CI UI/UX Anything to do with changes or additions to UI/UX elements. labels Oct 2, 2023
@derrod derrod requested a review from Warchamp7 October 2, 2023 05:02
@derrod derrod force-pushed the composable-themes branch 7 times, most recently from 8d75aa9 to 6d063e9 Compare October 7, 2023 22:12
@derrod derrod force-pushed the composable-themes branch 3 times, most recently from 9417570 to 7f00c43 Compare October 13, 2023 14:48
@derrod derrod force-pushed the composable-themes branch 2 times, most recently from 11fb0ed to f358480 Compare November 14, 2023 10:17
@derrod
Copy link
Member Author

derrod commented Nov 14, 2023

Based on feedback by @Warchamp7 I removed the UI for customising variables for now and cut the PR down a bit. We will revisit that later on once we're comfortable with the composition system and its capabilities.

Edit: Themes are still unfinished, I'll leave that for Warchamp to solve :)

@derrod derrod marked this pull request as ready for review November 14, 2023 10:18
@derrod derrod force-pushed the composable-themes branch 5 times, most recently from c884bf1 to 1863787 Compare November 14, 2023 11:29
UI/obs-app-theming.cpp Outdated Show resolved Hide resolved
@PatTheMav PatTheMav added the Enhancement Improvement to existing functionality label Dec 9, 2023
@derrod derrod changed the title UI: Rework Theming System UI: Composable Themes System Dec 13, 2023
@derrod derrod force-pushed the composable-themes branch 3 times, most recently from 9582c64 to 438605d Compare December 19, 2023 00:56
@Warchamp7 Warchamp7 requested a review from RytoEX April 2, 2024 22:22
@Warchamp7 Warchamp7 force-pushed the composable-themes branch 5 times, most recently from ac16bce to 10eb1f7 Compare April 12, 2024 16:52
@RytoEX RytoEX self-assigned this Apr 17, 2024
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick skim. Will set aside some time for building/testing later this week.

UI/data/themes/Yami_Classic.ovt Outdated Show resolved Hide resolved
UI/data/themes/Yami_Grey.ovt Show resolved Hide resolved
UI/platform-x11.cpp Outdated Show resolved Hide resolved
UI/platform-x11.cpp Outdated Show resolved Hide resolved
UI/platform-x11.cpp Outdated Show resolved Hide resolved
UI/platform-x11.cpp Outdated Show resolved Hide resolved
UI/platform-x11.cpp Outdated Show resolved Hide resolved
UI/platform-x11.cpp Outdated Show resolved Hide resolved
@Warchamp7 Warchamp7 force-pushed the composable-themes branch 2 times, most recently from f7f148e to 92907cf Compare April 21, 2024 00:14
@Warchamp7 Warchamp7 merged commit a3a8f6d into obsproject:master Apr 21, 2024
14 checks passed
@derrod derrod deleted the composable-themes branch April 21, 2024 04:01
@RytoEX RytoEX added this to the OBS Studio (Next Version) milestone Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality Seeking Testers Build artifacts on CI UI/UX Anything to do with changes or additions to UI/UX elements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants