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

Add basic theme support and switch config to hex colors. #17

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

simotek
Copy link

@simotek simotek commented May 8, 2023

  • This moves the text and graph colors along with fonts into a separate file / module and then loads them into a current_theme variable so that its easy to add and swap between colors and fonts, we can also build up and add more style options later.
  • It also swaps the widget api and therefore theme from using cairo format colors to using conky and or html hex format colors and does the conversions internally.

I suspect that it will be best if I rebase this one after the other PR's are accepted.

I also made the following as a second different example that can be used for testing. But I figured there is no point in pushing it yet because it doesn't really have a matching conky config yet.
https://github.com/simotek/conky-bubbles/blob/dev/src/themes/dimensions.lua

image

This will hopefully make them easier to maintain in the long term. The main polycore config all the examples and tests have been updated although the test suite isn't rendering for me. For now the split is as follows, but open to changes and suggestions:
  * widget_core * Widget * Rows * Columns * Filler * Frame
  * widget_cpu
    * Cpu
    * CpuRound * CpuFrequencies
  * widget_drive * Drive
  * widget_gpu
    * Gpu
    * GpuTop
  * widget_graph - This could have a better name * Bar * Graph * LED
  * widget_memory
    * MemoryBar
    * MemoryGrid
  * widget_network * Network
  * widget_text
    * Text
    * StaticText * TextLine
Cairo requires 0.0->1.0 and this makes doing that much simpler
All "theme" elements have now been moved into a separate file and
module, to make it easier to add new ones.

At startup each config needs to load a theme module into the
current_theme variable.
Rather then users having to manually convert there colors to
cairo's non standard 0.0->1.0 rgb format users now specify colors
as hex strings either with or without a leading hash. The same as
the format used by conky. All the widgets now convert these colors
internally to the cairo format.
@simotek simotek marked this pull request as draft May 9, 2023 02:20
@simotek
Copy link
Author

simotek commented May 9, 2023

I marked this one as a draft because I'll need to rebase it at some point once some of the other changes are in.

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.

1 participant