After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 313807 - Patch to make clock work on vertical panels
Patch to make clock work on vertical panels
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: clock
git master
Other Linux
: High normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-18 10:41 UTC by John Spray
Modified: 2015-03-24 13:00 UTC
See Also:
GNOME target: 2.12.x
GNOME version: 2.11/2.12


Attachments
Patch to set clock label angle depending on panel orientation (2.47 KB, patch)
2005-08-18 10:48 UTC, John Spray
none Details | Review
A fix to make the date display properly on a small side-panel. (611 bytes, patch)
2005-08-26 03:39 UTC, Callum McKenzie
none Details | Review
updated patch (5.60 KB, patch)
2005-09-06 17:13 UTC, William Jon McCann
committed Details | Review

Description John Spray 2005-08-18 10:41:39 UTC
Patch follows.
Comment 1 John Spray 2005-08-18 10:48:07 UTC
Created attachment 50899 [details] [review]
Patch to set clock label angle depending on panel orientation

Problems:

1. The code for setting label angle exists twice: once for initialisation and
once in the signal handler for changing orientation.  Preferably we'd have that
signal handler called when we first create the applet: I don't know how to make
that happen.

2. The condition (cd->size >= GNOME_Vertigo_PANEL_MEDIUM) appears to be always
true for vertical panels, regardless of how small they are.  This results in
the date always being shown above the time (instead of next to it) on panels
where there is not enough room.
Comment 2 Callum McKenzie 2005-08-26 03:38:43 UTC
There is a small bug with this code, it doesn't handle the date display on a
small panel properly (the date gets placed above the time and gets chopped off).
I've attached a patch below to fix this (to be applied along with the above patch).

Comment 3 Callum McKenzie 2005-08-26 03:39:50 UTC
Created attachment 51360 [details] [review]
A fix to make the date display properly on a small side-panel.
Comment 4 William Jon McCann 2005-09-06 17:13:29 UTC
Created attachment 51880 [details] [review]
updated patch

Updated patch to make sure that there is enough room for two full lines of
text, instead of looking only at the panel size and making an assumption about
the font size, before wrapping the label.  Does this look OK for 2.12.1?
Comment 5 Brent Smith (smitten) 2005-09-08 16:47:18 UTC
I have tested this here against cvs gnome-panel, works like a charm, I think
this should definitely go into 2.12.1
Comment 6 Danielle Madeley 2005-09-15 14:58:42 UTC
Upping priority. Jeff Waugh things this is a 2.12.1 issue (so do I).

Haven't read patch yet.
Comment 7 Vincent Untz 2005-09-15 20:03:39 UTC
Thanks for the patch, William. Please commit it to HEAD.
Jeff: I hope you'll be nice and come to France ;-)
Comment 8 William Jon McCann 2005-09-15 20:21:33 UTC
2005-09-15  William Jon McCann  <mccann@jhu.edu>

	* clock.c (calculate_minimum_height, use_two_line_format) 
	(update_timeformat, update_clock, create_clock_widget) 
	(applet_change_orient): Orient the text vertically on
	vertical panels.  Only use multiple lines when there
	is enough space two fit two lines.
	
	Based on patches from John Spray <jcs116@york.ac.uk>
	and Callum McKenzie <callum@physics.otago.ac.nz>
	Fixes #313807.