Bug 158762 - Digital clock applet renders ungracefully on smaller panels
Summary: Digital clock applet renders ungracefully on smaller panels
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-clock (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 157537 158827 160286 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-04 15:11 UTC by Jonathan Thomas
Modified: 2009-01-15 20:03 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
My panel (23.67 KB, image/png)
2008-03-04 15:17 UTC, Jonathan Thomas
Details
Wrong panel allignment (803.70 KB, image/png)
2008-03-10 10:49 UTC, Fabio
Details
Clock in vertical panel (1.61 KB, image/png)
2008-03-29 23:10 UTC, Mary Ellen Foster
Details
Clock in Vertical Panel 160 pixels (237.89 KB, image/png)
2008-03-30 00:41 UTC, James Richard Tyrer
Details
vert. panel (5.33 KB, image/png)
2008-03-30 08:49 UTC, k.t.
Details
Wrapped panel (745.41 KB, image/png)
2008-04-08 23:26 UTC, Fabio
Details
Before Panel Resize (505.65 KB, image/png)
2008-04-27 03:07 UTC, Jason
Details
After Panel Resize (Tiny) (519.73 KB, image/png)
2008-04-27 03:07 UTC, Jason
Details
Panel Back To Normal Size (510.19 KB, image/png)
2008-04-27 03:07 UTC, Jason
Details
Overlap of KSnapshot (Bonus) (490.32 KB, image/png)
2008-04-27 03:09 UTC, Jason
Details
Missing panel border (787.41 KB, image/png)
2008-04-29 09:07 UTC, Fabio
Details
puts date at the right of time on horizontal formfactor (3.58 KB, patch)
2008-12-06 02:44 UTC, Marcos Dione
Details
also correctly asks for enough hspace for both time and date/timezone. (4.37 KB, patch)
2008-12-06 04:17 UTC, Marcos Dione
Details
puts date at the right of time on horizontal formfactor only when there's no enought vertical space (11.59 KB, patch)
2008-12-16 01:57 UTC, Marcos Dione
Details
A Screenshot (2.27 KB, image/png)
2009-01-15 05:26 UTC, Marian Kyral
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Thomas 2008-03-04 15:11:50 UTC
Version:            (using KDE 4.0.2)
Installed from:    Ubuntu Packages
Compiler:          gcc 
OS:                Linux

The digital clock applet doesn't play nicely with smaller-than-normal panels. With a 32 or 22 px size, the current date is cut off and the time is no longer centered on the panel.
Comment 1 George Goldberg 2008-03-04 15:15:54 UTC
Can't reproduce this with current svn trunk.
Comment 2 Jonathan Thomas 2008-03-04 15:17:20 UTC
Created attachment 23784 [details]
My panel
Comment 3 Jonathan Thomas 2008-03-04 15:24:45 UTC
Oh, if you have "Show date" actually *set* you can see about half of it. But it seems that if you remove the clock and then add it again that it forgets you had "Show date" set.
Comment 4 Chani 2008-03-05 05:10:09 UTC
jonathan: that's because if you remove the clock and add another one it's a new clock with default settings :) you can have lots and lots of clocks with different settings this way.
Comment 5 Jonathan Thomas 2008-03-05 13:39:31 UTC
Heh, figures. It would be cool if you could check an option that would make the applet settings default for all applets of it's kind. Maybe I should open up a wishlist report...

But if this is fixed in trunk, then it'd be neat if the fix was backported for 4.0.3.
Comment 6 Sebastian Kügler 2008-03-07 01:28:41 UTC
So it simply doesn't fit, showing date and time. I assume it does work well if you switch off showing the date? The clock now tries to show the date (which is what you tell it to do) and respecting the smallest readable font size setting (from System Settings | Appearance | Fonts | Small). 

I can imagine the following:

 1) Silently remove the date when it doesn't fit anyway
 2) Ignore smallest readable font setting
 3) Take more horizontal space and show the date next to the time (in vertical panels, it would then just take more horizontal space.

I think I'd prefer 3), what do others think?
Comment 7 Sebastian Sauer 2008-03-07 03:26:36 UTC
Maybe 3) and if textwidth>panelsize for vertical panel then 2) ? Probably, a "damn small text" is still better then a "half is not readable cause it's truncated" text? There may even be a 4) don't display e.g. year or seconds in the date if textwidth>panelsize and probably even a 5) split the string into multiple lines till it matches (so, e.g. "2008\n03\n07\n23\n59\n59") and a 6) combine some of the points into something ueber-clever :)
Comment 8 Will Stephenson 2008-03-07 08:42:03 UTC
3)

And check how it works on vertical panels of various widths, please.
Comment 9 Chani 2008-03-07 11:38:43 UTC
> ------- Heh, figures. It would be cool if you could check an option that
> would make the applet settings default for all applets of it's kind. Maybe
> I should open up a wishlist report...


sounds like a good idea to me :)
Comment 10 Jonathan Thomas 2008-03-07 16:09:26 UTC
http://bugs.kde.org/show_bug.cgi?id=158909
Well there's the wishlist report if anyone was interested.

Oh, and that picture that I attached was *without* the date. So no, it doesn't render nicely without the date. (Or at least it doesn't in 4.0.2)
Comment 11 Marcin Juszkiewicz 2008-03-09 22:21:40 UTC
Also happen here - clock (only Time shown) does not fit in panel when panel is "Small" size.
Comment 12 Fabio 2008-03-10 10:49:48 UTC
Created attachment 23844 [details]
Wrong panel allignment

Same here. If I set the panel size to "tiny" the clock and all the panel icons
are  not alligned correclty. Some part of the panel is showed on top of the
screen.
Comment 13 Erwan Inyzant 2008-03-13 10:49:02 UTC
Hi,

I have the same problem for the clock, and if I put the size of the panel to "tiny", the K menu is cut off too.
For the clock, we should have the choice of the alignment. something like that :

Hour:Min:(seconds)
Date

or 

Hour:Min:(seconds)  Date
Comment 14 James Richard Tyrer 2008-03-28 06:14:37 UTC
Re: Comment #6

4) Make the time font smaller so that it fits.  If the time font then becomes smaller than the "smallest readable font", then generate an error message.
Comment 15 Mary Ellen Foster 2008-03-29 23:10:52 UTC
Created attachment 24117 [details]
Clock in vertical panel

FYI, here's what the clock looks like in a vertical panel in the KDE-based
Fedora 9 live image. Note that, in addition to being totally cut off, it's also
quite far from the bottom of the screen (the bottom of the image) and can't me
moved around.
Comment 16 James Richard Tyrer 2008-03-30 00:41:53 UTC
Created attachment 24119 [details]
Clock in Vertical Panel 160 pixels

There seems to be a problem with the previous attachment.

For the clock to work in a vertical panel, the panel needs to be a reasonable
size.  So, I tried 160 pixels which I use in KDE-3.5.x.

This clearly shows the problems:

There is the AM/PM issue.  It isn't on the same line as the time numbers.

It also appears (in general) that always having the date the "Small" font is
not satisfactory.  The "Small" font being the minimum size for the date (and
time zone) should be one of the constraints used to determine the size.  Here
the font needs to be larger.

The size of the widget is wrong.  It appears to be vertical with a rather large
aspect ratio (height/width).  The clock takes up a lot of the panel space and
there is a large space between the time and the date.

There are clearly issues with Widgets.	It isn't possible for them to be the
same on the desktop, horizontal panel, or vertical panel.  They are going to
have to know which they are on and when on a panel apply size constraints which
are a function of vertical | horizontal.
Comment 17 Mary Ellen Foster 2008-03-30 01:02:55 UTC
If the "previous attachment" with problems is mine, then maybe I should clarify what it's meant to show. I only took a snapshot of the panel itself, not the whole screen; due to a different bug (apparently fixed now) the wallpaper was white at the time, so it does look a bit funny. But that's an honest image of what the lower-left corner of my screen looked like.
Comment 18 Chani 2008-03-30 01:55:42 UTC
> There are clearly issues with Widgets.	It isn't possible for them to be the
> same on the desktop, horizontal panel, or vertical panel.  They are going
> to have to know which they are on and when on a panel apply size
> constraints which are a function of vertical | horizontal.


they already do just this.
the problem is that the digital clock is really, horrifically, stupendously 
*bad* at it. iirc there's all sorts of weird cruft from long ago when this 
stuff worked differently.
Comment 19 k.t. 2008-03-30 08:49:19 UTC
Created attachment 24124 [details]
vert. panel

can you explain me what's so wrong with vertically placed clock in vertically
placed panel?
e.g. why it has to be like this:
09:41
Sunday
30.03.2008
Comment 20 Jonathan Thomas 2008-03-30 14:19:29 UTC
The vertical clock is half the screen high. That's the problem, in general.
Comment 21 k.t. 2008-03-30 15:45:18 UTC
the attachment I did takes about only 1/6 of my screen height
Comment 22 Jonathan Thomas 2008-03-30 15:49:45 UTC
Oh, sorry, I didn't see the attachment. I though you were saying you weren't having any problems with the clock.
Comment 23 Aaron J. Seigo 2008-04-03 06:55:57 UTC
*** Bug 158827 has been marked as a duplicate of this bug. ***
Comment 24 Aaron J. Seigo 2008-04-03 06:56:02 UTC
*** Bug 157537 has been marked as a duplicate of this bug. ***
Comment 25 Aaron J. Seigo 2008-04-03 06:56:21 UTC
*** Bug 160286 has been marked as a duplicate of this bug. ***
Comment 26 Jonathan Thomas 2008-04-04 03:47:38 UTC
Does the wrapping issue from comment 12 have its own bug report. If it doesn't, should it have its own separate report?
Comment 27 Fabio 2008-04-08 23:26:51 UTC
Created attachment 24273 [details]
Wrapped panel

The bug it's still present in 4.0.3.
I attached another screenshot to show that also kickoff is "wrapped" and it  is
show on top of the screen! Didn't notice this before...

Maybe my simil-wide-screen resolution (1280x800 on dell latitude d620) could be
the problem ?

Thanx!

-- 
Fabio
Comment 28 Jörg Schulte 2008-04-09 12:18:03 UTC
Same Problem like Fabio here. The Kickoff Menu is shown on top of the screen and the  bottom part of the Panel is also shown on the Top like in Fabios screenshot. 

I have the same resolution (1280x800) on an Acer TravelMate 2410 and an Intel 915 Mobile graphic card. Kubuntu 8.04 Beta with KDE 4.0.3

Thx
Comment 29 JustBill 2008-04-14 04:44:19 UTC
I have this problem as well with the Panel set to tiny.  KDE 4.0.3 and I'm using Nvidia MX400 1024x768.  
Comment 30 Jason 2008-04-27 03:06:24 UTC
1.  Panel loads “Normal” size after KDE 4 install.

2.  Size is changed to “Tiny” size. (Clock it cut off)

3.  Size is changed back to “Normal” size. (The bottom half of the panel is white and the icons and clock are cut off)

Notice in the screen shots that KSnapshot always overlaps on the lower left of the task bar...  but that is another issue that needs addressed.

See my screenshots:
Comment 31 Jason 2008-04-27 03:07:00 UTC
Created attachment 24525 [details]
Before Panel Resize
Comment 32 Jason 2008-04-27 03:07:23 UTC
Created attachment 24526 [details]
After Panel Resize (Tiny)
Comment 33 Jason 2008-04-27 03:07:44 UTC
Created attachment 24527 [details]
Panel Back To Normal Size
Comment 34 Jason 2008-04-27 03:09:31 UTC
Created attachment 24528 [details]
Overlap of KSnapshot (Bonus)
Comment 35 Fabio 2008-04-29 09:07:49 UTC
Created attachment 24552 [details]
Missing panel border

The problem of the "wrapped" panel is fixed for me on the latest suse rpm (kde
4.0.3 release 20.2)!! Now the panel is displayed correctly even when size is
set to "tiny"!
There's only a "small visual defect":as you can see on the attached screenshot
on the tray bar if you have some icons of kde3 application (in my case
kbluetooth, kmix and knetworkmanager) the upper border of the panel is not
displayed
Comment 36 Jonah Naylor 2008-05-14 19:00:11 UTC
this is still not fixed in kubuntu with kde 4.0.4. just about nearly fits on Small but Tiny messes up the whole panel bar
Comment 37 Sebastian Kügler 2008-05-22 18:54:40 UTC
It's fixed in trunk/ and should be part of 4.1-beta1. Can someone close this bug? I seem to lack karma.
Comment 38 Anne-Marie Mahfouf 2008-05-22 20:53:52 UTC
*** Bug has been marked as fixed ***.
Comment 39 James Richard Tyrer 2008-05-23 01:47:07 UTC
This bug has not been fixed.
Comment 40 Yves Glodt 2008-06-16 14:02:06 UTC
The clock seems to render nicely in r819867.
Comment 41 James Richard Tyrer 2008-06-16 15:53:56 UTC
This was reported against the 4.0 BRANCH and although it appears to have been fixed in TRUNK, the fix has not been backported to the BRANCH.  Should we close this any how, or can the fix be backported to the 4.0 BRANCH?
Comment 42 Jonathan Thomas 2008-06-16 16:00:16 UTC
Since there wasn't any one commit that explicitly fixed the problem (to the best of my knowledge) and due to Widgets on Canvas a backport would entail porting the WoC'd clock applet back to the 4.0 branch. I doubt this is going to happen. They've been closing 4.0 bugs that are fixed in 4.1 anyway, so this should be resolved fixed.
Comment 43 James Richard Tyrer 2008-06-16 16:14:52 UTC
Since it can't be easily backported, I am closing it.
Comment 44 Aaron J. Seigo 2008-06-16 17:26:12 UTC
Yes, given that 4.1 is just around the corner, we'd like development efforts to now focus on making that release as solid as possible and some of these backports are pretty non-trivial.

I'm absolutely not against someone doing the backport if they want to, of course =) but it's just not a priority for the core plasma group at the moment as we prepare for 4.1.0.
Comment 45 Marcos Dione 2008-12-06 02:29:27 UTC
I just implemented #3 from comment 6 (https://bugs.kde.org/show_bug.cgi?id=158762#c6). patch attached.
Comment 46 Marcos Dione 2008-12-06 02:44:05 UTC
Created attachment 29078 [details]
puts date at the right of time on horizontal formfactor

I simply ignored comments #7 and #8. #7-5) should be feasible, but this first iteration just implements it for horizontal panels.
Comment 47 Marcos Dione 2008-12-06 04:17:43 UTC
Created attachment 29081 [details]
also correctly asks for enough hspace for both time and date/timezone.
Comment 48 Marian Kyral 2008-12-10 22:56:34 UTC
(In reply to comment #47)
> Created an attachment (id=29081) [details]
> also correctly asks for enough hspace for both time and date/timezone.
> 

Hi,
I just succesfully patched and compiled 4.1.82 and it works correctly. Date and time is in one line as in kde3.

Thanks a lot
Comment 49 Marcos Dione 2008-12-16 01:57:49 UTC
Created attachment 29369 [details]
puts date at the right of time on horizontal formfactor only when there's no enought vertical space

asp er Kluegler petition, this patch pnly puts deta/tz besides time if there's not enough vertical space. I prefer the other implementatio (do this always), so I don't check the 'obsoletes" question.
Comment 50 Aaron J. Seigo 2008-12-26 20:12:00 UTC
SVN commit 901830 by aseigo:

date-beside-time-depending-on-height; based on a patch by Marcos Dione with a number of modifications.
the code in this applet is getting a little convoluted, could use a nice cleaning in places.
CCBUG:158762
BUG:178721


 M  +217 -111  clock.cpp  
 M  +5 -1      clock.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=901830
Comment 51 Marian Kyral 2009-01-15 05:23:11 UTC
Regression:

Does not work with 4.1.96 :-(
Comment 52 Marian Kyral 2009-01-15 05:26:19 UTC
Created attachment 30257 [details]
A Screenshot
Comment 53 Aaron J. Seigo 2009-01-15 05:58:08 UTC
this was committed after 4.1.96, wasn't it?
Comment 54 Marian Kyral 2009-01-15 06:52:30 UTC
Sorry, I really don't know :-(
Comment 55 Marian Kyral 2009-01-15 07:18:35 UTC
Well,
there was an another change at 04/01/09 and it is included in 4.1.96.
I really think it worked correctly in 4.1.87 (BETA2)

http://websvn.kde.org/trunk/KDE/kdebase/workspace/plasma/applets/digital-clock/clock.cpp?r1=901830&r2=905255
Comment 56 Aaron J. Seigo 2009-01-15 09:14:28 UTC
SVN commit 911269 by aseigo:

QFont returns -1 for pixelSize when set with a point size. so set with a pixel size, and now it works again.
CCBUG:158762


 M  +5 -4      clock.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=911269
Comment 57 Aaron J. Seigo 2009-01-15 09:15:33 UTC
SVN commit 911271 by aseigo:

QFont returns -1 for pixelSize when set with a point size. so set with a pixel size, and now it works again.
CCBUG:158762


 M  +5 -4      clock.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=911271
Comment 58 Marian Kyral 2009-01-15 20:03:08 UTC
Thanks a lot. The panel have to be a really thin, but works :-)