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

Reintroduce analogue clock time icon #700

Merged
merged 1 commit into from
Mar 10, 2024
Merged

Conversation

tecosaur
Copy link
Contributor

@tecosaur tecosaur commented Mar 7, 2024

Take 2 of #698, resolving the issue noted in #698 (comment).

Now works on my machine without me loading my config 😉.

@seagle0128
Copy link
Owner

seagle0128 commented Mar 7, 2024

Below is the screenshot in my env. The clock looks wired.

image

@tecosaur
Copy link
Contributor Author

tecosaur commented Mar 7, 2024

Interesting. Seems like the sizing is worse for some reason? It might be the case that the size factor might want to be tweaked depending on the particular graphical/modeline configuration.

Would you like me to expose a clock size customisation variable (and let me know if you'd prefer a defcustom or defvar if we're just testing)?

@seagle0128
Copy link
Owner

I set doom-modeline--clock-inverse-size to 3.0 and it looks great.

It seems related to the font. If the analogue clock is enabled by default, the users have to set this variable. The experience is not good.

@tecosaur
Copy link
Contributor Author

tecosaur commented Mar 7, 2024

Ok, so sounds like we should have it off by default.

How about I push these changes?

  • Change the default value of doom-modeline-time-analogue-clock to nil
    (now I look I think I may have missed the other non-segment files when copying over the old state, so I'll correct that along the way)
  • Turn doom-modeline--clock-inverse-size into a new defcustom mentioned in the docstring of doom-modeline-time-analogue-clock, possibly make it the non-inverse size, so it's a bit easier to explain. I just did inverse originally so the range of "good numbers" was nicer (3-5) but 0.2-0.4 doesn't seem to bad.

@seagle0128
Copy link
Owner

seagle0128 commented Mar 7, 2024

Sounds good! But I am wondering how to calculate./tweak the ratios/size?

@tecosaur
Copy link
Contributor Author

tecosaur commented Mar 7, 2024

Yea, it would be ideal to have something that "just works". I'm not sure how we can do this robustly though?

@seagle0128
Copy link
Owner

  • Change the default value of doom-modeline-time-analogue-clock to nil
    (now I look I think I may have missed the other non-segment files when copying over the old state, so I'll correct that along the way)
  • Turn doom-modeline--clock-inverse-size into a new defcustom mentioned in the docstring of doom-modeline-time-analogue-clock, possibly make it the non-inverse size, so it's a bit easier to explain. I just did inverse originally so the range of "good numbers" was nicer (3-5) but 0.2-0.4 doesn't seem to bad.

Please move forward. And it's better merge #689 into this. Then I just need to merge one.

@tecosaur
Copy link
Contributor Author

tecosaur commented Mar 8, 2024

Aha! I think I might have figured it out, the problem is that scaling is applied to the SVG based on an (image-compute-scaling-factor image-scaling-factor) call that occurs within create-image (on my system, this results in a scaling factor of ~1.41).

I think we might be able to avoid the extra variable after all!

Edit: on seconds thoughts, it's still worth having, it's just easier to understand how it works now.

@tecosaur
Copy link
Contributor Author

tecosaur commented Mar 8, 2024

Let me know how that seems to you.

Since I think this fixes the "weird scaling" issue, I've left doom-modeline-time-analogue-clock as t by default, but happy to change if you'd prefer.

Reattempt d066e7b, this time including
the required svg generation function.
@tecosaur
Copy link
Contributor Author

tecosaur commented Mar 9, 2024

I've just made the sizing variable doom-modeline-time-clock-size, and made it so it can be set to an integer number of pixels, or a proportion to `doom-modeline-height'.

@seagle0128 seagle0128 merged commit 311a0c5 into seagle0128:master Mar 10, 2024
6 checks passed
@seagle0128
Copy link
Owner

seagle0128 commented Mar 10, 2024

Thank you! And I committed a patch 4d1d013 to fix the cache issue. Please check.

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.

2 participants