LeeVD / plasma-applet-net-bandwidth-monitor

Network bandwidth monitor for plasma using dbus
GNU General Public License v3.0
24 stars 4 forks source link

Decimal places #21

Open JM279-17 opened 1 year ago

JM279-17 commented 1 year ago

I would like to see better decimal place handling. Currently I can only choose the number of decimal places, that is, zero, one, two or three. But while I don't care whether the current speed is 12.3 b/s or 12.4 b/s, there's a big difference between 1.1 Mb/s and 1.9 Mb/s. So I would like to have the option to omit decimal places for bits and even kilobits and only show them for megabits. It would make it more readable and compact (bits or kilobits use three digits much more often than megabits, so a decimal place makes the string unnecessarily long, which can be a problem in a vertical panel). The decimal place could even be omitted automatically if it's zero. 0 b/s or 128 kb/s looks better than 0.0 b/s or 128.0 kb/s. For example, the monitor widget bundled with Plasma doesn't show decimal places for bits/bytes, only for kilobits/kilobytes and higher. I also find the default setting of binary (1024) and bytes strange, as network speed is almost always measured in the metric system and bits, but thankfully it can be changed.

LeeVD commented 11 months ago

Hi JM279-17 You raise some interesting points. For the decimal place question, i think i could integrate that as another option, leave it with me. The binary vs decimal statement, i did a load of reading on this topic and many people have many positions on this. If i remember correctly, the widgets i based mine from, used binary 1024. Personally, i dont care. I included decimal as it seemed to make sense based on my research. The default starting setting should be 'bits' and binary, not 'bytes'. Thanks for the decimal place suggestion. Ta.

LeeVD commented 11 months ago

Hi @JM279-17 v0.4 should provide the adjustments you mention. Check out 'Decimal place filter' and 'Rounded whole number' and feedback if it works for you.

Ta.

JM279-17 commented 11 months ago

Excellent, thank you very much! It seems to be working well, and it looks much cleaner now.

One minor (slightly off-topic) issue: when I click on the "i" icons to see the explanation for these options in the configuration dialog, the text is displayed as white on a light grey background, so it's almost invisible (I'm using the default Breeze light theme in KDE Plasma). The text is not selectable, so I cannot even make it visible by selecting it. I think the text colour should not be hardcoded, but should simply follow the user's colour theme.

Anyway, thanks a lot for these improvements.

LeeVD commented 11 months ago

I've just been messing with plasma light and dark themes to test this. There is no hardcoded text colour, the text should respect the theme colours. The text in question is HTML wrapped, I dont see why that would make an difference though. With breeze light i get dark text, with breeze dark i get light text, all good. With breeze twilight - dark panel and light backgrounds i get light text. Messing with the plasma setting 'colours', the text is classified as 'Window Text' and should change along with the chosen colour: image I'll take a look at this when i get a chance. Thanks for letting me know.

JM279-17 commented 11 months ago

Yes, sorry, I forgot to say I'm using the "Kubuntu" Plasma theme (which I think is the default on Kubuntu 23.04), that is, a dark panel along with the default Breeze light Qt theme.

Even when I change the window text colour to green, the text in the info section still remains white, while all other text (including the regular text labels in the config dialog) changes to green, except for the "Wired connection" label in the network tab, the keyboard shortcuts button in the keyboard shortcuts section, and "LeeVD" in the About section, which, for some reason, remain black.

But this may be a bug with the Plasma colour theme or generally with the way KDE Plasma and Qt interact... I've seen many colour theme related problems and bugs in the past on Linux with Qt, GTK and Plasma, so this might be just one of them. It's just strange that this applet is the only piece of software I see this "white on light grey" text, I can't see it in any other application or applet anywhere.

LeeVD commented 11 months ago

More testing and more puzzling. theme.textColor returns qml: #dfdfdf (light grey) no matter what theme i chose, no idea why. Not sure if its a plasma issue or something in my code. Will keep looking.

LeeVD commented 4 months ago

FYI, this theme text color issue will be fixed in the next release. For anyone else experiencing this issue when using Plasma QML, the solution is:

Dont use: theme.textColor. Do Use: SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } with: color: myPalette.windowText