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

digitalClock.font looks broken #452

Open
haizaar opened this issue Jan 8, 2025 · 6 comments
Open

digitalClock.font looks broken #452

haizaar opened this issue Jan 8, 2025 · 6 comments

Comments

@haizaar
Copy link

haizaar commented Jan 8, 2025

Any changes to digitaClock.font set font weight to extremely thing one:
image

I'm using the latest version of the plasma-manager d16bbde.
Here is my panel configuration:

      panels = [
        {
          location = "bottom";
          height = 32;
          widgets = [   
            "org.kde.plasma.kickoff"
            {
              iconTasks = {
                iconsOnly = false;
                appearance.rows.multirowView = "never";
                behavior = {
                  grouping.method = "none";
                  sortingMethod = "manually";
                };
              };
            }
            "org.kde.plasma.marginsseparator"
            "org.kde.plasma.systemtray"
            {  
              digitalClock = {
                date.enable = false;  
                time.format = "24h";
                font = {
                  family = "Noto Sans";
                  size = 10;
                  bold = true;  
                };
                calendar.firstDayOfWeek = "monday";
              };
            }
          ];
        }
      ];

Looking at the UI config, it says "Thin" though I have explicitly asked for bold.

image

Configuring the font from UI works as expected.

@haizaar
Copy link
Author

haizaar commented Jan 8, 2025

The workaround seems to be to define both weight and style like the below (otherwise default weight of 50 is dropped into ~/.config/plasma-org.kde.plasma.desktop-appletsrc)

                font = {
                  family = "Noto Sans";
                  size = 10;
                  weight = 400;
                  style = "Medium";
                };

@haizaar
Copy link
Author

haizaar commented Jan 10, 2025

The workaround is to configure both style and weight. Otherwise the weight value is always present as 50 in ~/.config/plasma-org.kde.plasma.desktop-appletsrc.

                font = {
                  family = "Noto Sans";
                  size = 10;
                  weight = 400;
                  style = "Medium";
                };

@HeitorAugustoLN
Copy link
Member

AFAIK, fontStyleName that is what is being set, doesn't actually do anything without fontWeight (values that are being set). So the only wait to make it work is setting both or just setting fontWeight. This is more the way digital clock widget works than a plasma-managaer bug.

@haizaar
Copy link
Author

haizaar commented Jan 11, 2025

I think the config should be more user friendly then. Me trying to use this module "as is" resulted in broken font settings, and then required digging through the resulting KDE config files to figure it out.

To make it more user friendly, I suggest the following:

  • Remove bold and italic settings - they conflict with the style option. I.e I can set both bold and italic to be true and then style to Thin - doesn't make sense
  • Add assertion that requires all attributes of the font configuration to be provided; and update option description accordingly
  • Tangent to that, add examples of the style argument, namely "The custom style for the font. Examples: Italic, Bold, Medium, Regular, Thin, Medium, Bold Italic, etc. Check the font configuration UI for supported styles of your chosen font"

WDYT?

@HeitorAugustoLN
Copy link
Member

It is definitely possible, but I generally prefer to keep each option to a specific setting, instead of a single option handling multiple settings. About assertions, they would be nice to do, but widget options aren't exactly modules, so assertions are not possible. But I will see what I can improve

@haizaar
Copy link
Author

haizaar commented Jan 13, 2025

It is definitely possible, but I generally prefer to keep each option to a specific setting, instead of a single option handling multiple settings.

I'm not sure what you mean. If it's about bold/italic options, then they don't appear in the UI. Can you please elaborate?

image

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

No branches or pull requests

2 participants