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

Feature request: custom colors and fonts #108

Open
pinpox opened this issue Mar 27, 2024 · 11 comments · Fixed by #141
Open

Feature request: custom colors and fonts #108

pinpox opened this issue Mar 27, 2024 · 11 comments · Fixed by #141
Labels
configuration enhancement New feature or request rust Pull requests that update Rust code

Comments

@pinpox
Copy link
Contributor

pinpox commented Mar 27, 2024

I would love to be able to configure my own colors and font. I use the same font everywhere on my system and would like to have it in the laucher aswell.

@friedow
Copy link
Owner

friedow commented Mar 27, 2024

Yup, we should definetly implement that. I'd want to avoid creating an own config file or standard for that.

What would be good standards to depend on here? I was thinking GTK 3 theme for colors and the system monopace font.

What do you think @pinpox @a-kenji?

@pinpox
Copy link
Contributor Author

pinpox commented Mar 27, 2024

I would actually argue setting a color value in the yaml file would be easier. Not everyone uses GTK, I just want to set foreground and background the same way I would for e.g. my terminal emulator. Also, that should be easier to implement I suppose?

@a-kenji
Copy link
Collaborator

a-kenji commented Mar 27, 2024

I'd agree with @pinpox here.
Only use the system monospace font, if the user opts in to it (If transparently using it there might be font issues the user doesn't know the source for)?
Setting color values inside the configuration is portable, doesn't necessitate parsing a gtk3 file, that might not be there and influences different applications.

@friedow
Copy link
Owner

friedow commented Mar 27, 2024

It is certainly simpler to do it that way :). Lets just do it in the config file then.

@friedow friedow added enhancement New feature or request rust Pull requests that update Rust code labels Mar 30, 2024
@pinpox
Copy link
Contributor Author

pinpox commented May 13, 2024

I tried a bit to work on this, but my rust skills are limited. This works to set colors from a hex string, how would I access the values from the config that I added? If someone can give me an example I can add all the missing colors and create a PR 0f3bcdc

@friedow
Copy link
Owner

friedow commented May 14, 2024

Hey @pinpox, so nice that you are working on this 🤩.

To access the settings you can just create a new instance of the settings object whereever you need it like this:
https://github.com/friedow/centerpiece/blob/main/client/src/plugin/git_repositories.rs#L33
And then use the values of the settings object like this:
https://github.com/friedow/centerpiece/blob/main/client/src/plugin/git_repositories.rs#L119

@pinpox
Copy link
Contributor Author

pinpox commented May 16, 2024

Hey @pinpox, so nice that you are working on this 🤩.

To access the settings you can just create a new instance of the settings object whereever you need it like this: https://github.com/friedow/centerpiece/blob/main/client/src/plugin/git_repositories.rs#L33 And then use the values of the settings object like this: https://github.com/friedow/centerpiece/blob/main/client/src/plugin/git_repositories.rs#L119

Thank you, that got me to a working version. I opened a draft PR as there are still a few issues.

friedow added a commit that referenced this issue May 23, 2024
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.

---------

Co-authored-by: Christian Friedow <[email protected]>
@friedow friedow reopened this May 25, 2024
@friedow
Copy link
Owner

friedow commented May 25, 2024

Setting custom colors has been done in #141. Custom fonts is still TODO :).

@pinpox
Copy link
Contributor Author

pinpox commented May 25, 2024

Custom fonts is still TODO :).

I had a short look at how this might be done, but the font paths seem to be hardcoded. I guess a third-party library would be the way to go?

@friedow
Copy link
Owner

friedow commented May 25, 2024

I don't think we need a third party library here. The font path is only hardcoded because we load a font which is not installed on the users system already.

I think you could just try not loading a font at all if the user sets a custom font and setting another font name here: https://github.com/friedow/centerpiece/blob/main/client/src/main.rs#L277. Since the user should have installed and loaded the custom font already we should just be able to use it.

@pinpox
Copy link
Contributor Author

pinpox commented May 27, 2024

Work in progress PR for font settings here: #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration enhancement New feature or request rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants