Skip to content

[REFACTOR] improve theme handler #219

@NSPC911

Description

@NSPC911

Current theme handler just doesn't cut it. Themes being defined in config.toml means that rovr will need to be relaunched every time the theme gets changed. This does not help theme development at all.

The only other alternative is to use style.tcss, but it is globally themed, so theme switching doesn't work. We need to change the theme handler to something similar to smassh

What to change:

  1. Create a new theme switcher screen to handle themes
  2. Move over the theme dataclasses to their own stylesheet in src/rovr/config/themes/*.tcss
  3. Find a way to define transparent/opaque and light/dark themes (they need to be set in the app's attributes, but as far as I searched, there doesn't seem to be a way to grab a custom variable's value)
  4. Make the stylesheet handler like this
    • Stylesheet is defined as three different things
      1. rovr's built-in stylesheet
      2. rovr made theme/user made theme/user edited theme
      3. user's global style.tcss
    • user's global stylesheet defined first, followed by theme, then finally rovr's stylesheet, to ensure proper styling and overwrites.
    • modify the stylesheet handler to make appropriate messages (because the three-in-one stylesheet cannot make proper error messages since the line numbers will be messed up)
  5. will be expanded later on

Progress: 0/5.

Branch: https://github.com/NSPC911/rovr/tree/better-themes

Metadata

Metadata

Assignees

Labels

cannot-be-takenthis issue cannot be assigned due to unanswered questions, or difficultydifficulty: extreme demonit is as hard as beating an extreme demon in geometry dashenhancementenhanced something by removing or adding somethingrefactorthe files referenced need refactoring

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions