friedow / centerpiece

Your trusty omnibox search.
MIT License
174 stars 6 forks source link

Allow setting colors via configuration #141

Closed pinpox closed 1 month ago

pinpox commented 1 month ago

Partly Fixes #108

I implemented basic color settings trying to follow the other settings. Since I havn't worked with this very much before, I'm sure there is stuff I missed or should be done differently. Please let me know what has to change, any hints very welcome.

I only implemented colors for now. Not sure if font settings should be a separate PR.

a-kenji commented 1 month ago

Good job @pinpox! You can run the formatter toolchain in the project with:

nix fmt
pinpox commented 1 month ago

@friedow Updated the missing colors. I also moved the hexcolor helper function to settings.rs so I don't have to define it every time. Let me know if that is not the right place for it.

Maybe it would make sense to apply the hexcolor() just one time on startup when reading all the settings form the file and have the color settings be a global that is already of the type iced::Color and can referenced?

friedow commented 1 month ago

You'll need to run the formatter again :)

friedow commented 1 month ago

You're absolutely right, the settings struct should become a singleton. I've created a ticket for that (https://github.com/friedow/centerpiece/issues/142). Feel free to pick that up if you want :).

Anyways, this PR is read to be merged now :tada:! Thank you again for this great contribution @pinpox!