This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Timer widget - font too small in the panel

Tags: None
(comma "," separated)
kde-deshmukh
Registered Member
Posts
184
Karma
0
The default timer widget looks pretty odd in the panel because next to clock, etc. the font seems to be too small.

Is there a way to change (increase font size) of the timer widget?


--
Manjaro KDE. Kernel 4.19.244-1-MANJARO. 64-bit. Plasma 5.24.5. KDE Frameworks 5.94.0. Qt 5.15.4. 8GB RAM and more than 100GB free on the hard disk.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
Bug 321507 - Timer widget looks too small when docked into a panel: https://bugs.kde.org/show_bug.cgi?id=321507

Size matters - Before:

Image

The /usr/share/plasma/plasmoids/org.kde.plasma.timer/contents/ui/TimerView.qml has:

Code: Select all
property int digitH: ((height / 2) * digits < width ? height : ((width - (digits - 1)) / digits) * 2);
property int digitW: digitH / 2;



The widget height part (digitH) formula needs a bit tuning but just 'hardcoding' the height at this - after edit:

Code: Select all
//property int digitH: ((height / 2) * digits < width ? height : ((width - (digits - 1)) / digits) * 2);
property int digitH: 30
property int digitW: digitH / 2;


Note - At here the panel default height is 33 px.

So after the plasmashell restart (logout-login):

Image

Note #2 - You may need to use the 'panel spacers'. At here, the timer is flowing over the Systray without a spacer.


Workaround - My Timer

System upgrade can overwrite the /usr/share/plasma/plasmoids/org.kde.plasma.timer/contents/ui/TimerView.qml. Better way is to copy the widget to the user home

Image

and rename it: /usr/share/plasma/plasmoids/org.kde.plasma.timer/ -> $HOME/.local/share/plasma/plasmoids/org.kde.plasma.mytimer/.

Edit the metadata.desktop:

Code: Select all
[Desktop Entry]
Encoding=UTF-8
Name=My Timer
Name[x-test]=xxMy Timerxx

Comment=Countdown over a specified time period
Comment[x-test]=xxCountdown over a specified time periodxx

Type=Service
Icon=chronometer
ServiceTypes=Plasma/Applet
X-KDE-PluginInfo-Author=Davide Bettio
X-KDE-PluginInfo-Email=davide.bettio@kdemail.net
X-KDE-PluginInfo-Name=org.kde.plasma.mytimer
X-KDE-PluginInfo-Version=2.0
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Date and Time
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true

X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-Requires-FileDialog=Unused
X-Plasma-Requires-LaunchApp=Unused
X-Plasma-StandAloneApp=true


The metadata.json can be also edited.

Remember to edit the digitH !

After the edits there is a new version of the Timer widget:

Image
kde-deshmukh
Registered Member
Posts
184
Karma
0
Rog131 wrote:Bug 321507 - Timer widget looks too small when docked into a panel: https://bugs.kde.org/show_bug.cgi?id=321507

Size matters - Before:

...

After the edits there is a new version of the Timer widget:

Image


And so does color. The color of the digits is fixed to be black. So when I choose a dark theme, I see dark digits on dark background. So, there is panel background, background for each set of digits (hours, minutes, seconds) and dark digits.

How do I get the digits to change the color automatically (like other widgets like clock do)?

Looking at other widgets, it seems that I need to introduce:
Code: Select all
                color: theme.textColor

somewhere. Or is there something else?


--
Manjaro KDE. Kernel 4.19.244-1-MANJARO. 64-bit. Plasma 5.24.5. KDE Frameworks 5.94.0. Qt 5.15.4. 8GB RAM and more than 100GB free on the hard disk.
airdrik
Registered Member
Posts
1854
Karma
5
OS
Another workaround for the timer size is to put it on the desktop instead of on the panel.
For the color scheme used, that may depend on which themes you are using. With the setup I have at home, the timer is white text on blue background. I don't have the details readily available, though, other than that the color scheme is a custom one with mainly white text on dark blue, and the plasma theme is one which respects the color scheme (I think it was either one called "Bise" or something like that, or the regular Breeze (not light or dark) theme).

You could try using different plasma themes and tweaking various parts of the color scheme to see if that helps.


airdrik, proud to be a member of KDE forums since 2008-Dec.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
Timer font/font color

The Timer is using desktop theme file "widgets/timer"

Image
Numbers are svg objects.

Image
Can be edited with a vector graphics software.
freemind
Registered Member
Posts
1
Karma
0
Sorry to dig up this topic, but i found it useful when trying to find a solution for this problem with the timer plasmoid in kubuntu 18.04. However there was one part that i wasn't able to achieve well. I'm referring to the following:
Rog131 wrote:Note #2 - You may need to use the 'panel spacers'. At here, the timer is flowing over the Systray without a spacer.

So to fix this, i changed the main.qml file in line 59. I replaced this:
Code: Select all
Plasmoid.compactRepresentation: TimerView { }

With this:
Code: Select all
Plasmoid.compactRepresentation: Grid {
        columns: 1
        rows: 1
        Layout.minimumWidth: 100
       
        TimerView {
            anchors.fill: parent
        }
    }

Also, since the panel in kubuntu 18.04 is black, i had to change the color of the digits. For that i just used the white color available from the oxygen theme. Just copy the timer.svgz in /usr/share/plasma/desktoptheme/oxygen/widgets/ to /usr/share/plasma/desktoptheme/default/widgets/ .
apache
Registered Member
Posts
302
Karma
0
OS
@Rog131
I followed your steps. In TimerView.qml I have it like this:
Code: Select all
    readonly property real digits: (showSeconds) ? 7 : 4.5;
    readonly property int digitH: ((height / 2) * digits < width ? height : ((width - (digits - 1)) / digits) * 2);
    readonly property int digitH: 30
    readonly property int digitW: digitH / 2;

    PlasmaCore.Svg {


But it doesn't work. Font size is still very tiny. And when I use option "show seconds" font becomes even smaller. But I have a lot of space available on panel.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
apache wrote:@Rog131
I followed your steps. In TimerView.qml I have it like this:
Code: Select all
    readonly property real digits: (showSeconds) ? 7 : 4.5;
    readonly property int digitH: ((height / 2) * digits < width ? height : ((width - (digits - 1)) / digits) * 2);
    readonly property int digitH: 30
    readonly property int digitW: digitH / 2;

    PlasmaCore.Svg {




If you are using that then you are not using my steps.

Mine:

Code: Select all
//property int digitH: ((height / 2) * digits < width ? height : ((width - (digits - 1)) / digits) * 2);
property int digitH: 30


Image

If you don't remove the other - there should be an error message:
Image


The Bug 321507 has been marked as unmaintained with the plasma4. The new one is https://bugs.kde.org/show_bug.cgi?id=395182 .
apache
Registered Member
Posts
302
Karma
0
OS
Indeed. Now it works. I also had to add spacers on both sides of Timer. I also reported in this bug report.
Thank you very much.

Edit:
Is it possible to add some minutes values like 3 min, 4 min, 6, 7,8,9?

I reported a bug about Timer overlapping other widgets (or is covered by other widgets):
https://bugs.kde.org/show_bug.cgi?id=399930
User avatar
Rog131
Registered Member
Posts
828
Karma
10
apache wrote:Indeed. Now it works. I also had to add spacers on both sides of Timer. I also reported in this bug report.
Thank you very much.

Edit:
Is it possible to add some minutes values like 3 min, 4 min, 6, 7,8,9?

I reported a bug about Timer overlapping other widgets (or is covered by other widgets):
https://bugs.kde.org/show_bug.cgi?id=399930

...and from a private message:

contents/config/main.xml
I added


Code: Select all
  <group name="General">
    <entry name="predefinedTimers" type="StringList">
        <default>30,60,120,180,240,300,360,420,480,540,600,660,720,780,840,900,960,1020,1080,1140,1200,1500,1800,2700,3600</default>
    </entry>



Seems to work at here:
Image
Full image: https://imgur.com/GFYQFRT

Did you restart the plasmashell after you changed the main.xml ?

Steps:
1) Edit the main.xml
2) Stop the plasmashell - krunner:
Code: Select all
kquitapp5 plasmashell

3) Restart the plasmashell - krunner
Code: Select all
plasmashell


Restart will clear the old code/values from the memory.
apache
Registered Member
Posts
302
Karma
0
OS
Hmm. Strange. I did that and even restarted system but didn't worked. Finally I edited
/usr/share/plasma/plasmoids/org.kde.plasma.timer/contents/config/main.xml
and it works.

Anyway, thank you for checking and help.
apache
Registered Member
Posts
302
Karma
0
OS
@Rog131
Is it possible to apply to Timer widget notification pop-up custom font size and colour so that it matches custom setting of Plasma notification as described here
How to change notification pop-up text size and color?
viewtopic.php?f=17&t=156011

I ask because on my desktop it uses default font size and colour. May this be caused by using plasmoids from custom location
/.local/share/plasma/
And their names I also modified as suggested.
axd
Registered Member
Posts
2
Karma
0
How is it possible that after so many years, this is still an issue?

The digits are unreadable!
hensem
Registered Member
Posts
6
Karma
0
off topic: just reinstall neon and can't find this widget to install. where do I get this widget again?

Thanks.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
Indeed, completely off-topic as you are not using Plasma4. Please choose the Neon Forum for questions about Neon


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]