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

Added: Custom themes on user level & Styles improvements #521

Merged
merged 12 commits into from
Jan 6, 2025

Conversation

AmmarAbouZor
Copy link
Owner

This PR closes #509

It provides a complete framework to enable users to override the styles and colors of the app.

This PR includes:

  • Move all styles into one central struct with default implementation.
  • Users can override themes by defining them in themes.toml file in tui-journal directory within the config directory (More in themes documentations)
  • CLI sub-commands to print default themes, print the path of themes files and write the default themes directly to the file.
  • New Themes.md Document to explain theming in details.
  • Small changes on current themes, enabling unified feel on UI across the app
  • Cover serializing of theme with a lot of unit tests
  • Update README with small fixes

* Create struct to define the fields needed for a style to be serialized
  and used for the custom themes.
* Add unit tests for serializing styles
* Define structures for styles and integrate them in UI components using
  default implementation temporally.
* Define styles for editor with default values and use them in the
  editor widget.
* Provide styles definitions and default implementation for journals
  list then integrate the styles in journal list.
* Converting styles: Initial style removes all modifiers to ensure
  styles don't inherit the modifiers from its parents in GUI hierarchy
* Definitions and default implementations for general styles.
* Integrations of general styles in filter popup providing new styles
  for list highlight style when control is inactive.
* Apply general styles logic on entry popup and its tags popups as well
  to retain a unified style along the UI of the whole app.
* Add definitions for message box colors with default values
* Integrate message box colors in UI
* Provides cli commands to print path & default styles and to write the
  default styles to the path of the themes.
* Remove async from method signature since it doesn't need it.
* Module for desrializing & combining themes, still as placeholder
  without implementation.
* Deserialize themes from text in toml format, adding missing themes
  from the default colors.
* Combining styles from defaults led to refactoring in default values of
  the style groups.
* Provide unit tests to cover all cases of themes.
* Styles needs to be read and validated before enabling raw mode on
  terminal to ensure the error message isn't distorted.
* Improve error message extending it with the path of styles file.
* Add document to explain how custom theming works.
* Update the readme file referencing the themes file and updating help
  output on CLI.
* Add missing install nodes to table of content of README file.
* Fix small alignment issues.
@AmmarAbouZor AmmarAbouZor merged commit ceba728 into main Jan 6, 2025
4 checks passed
@AmmarAbouZor AmmarAbouZor deleted the custom_themes branch January 6, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: No color in interface option
1 participant