GNOME Bugzilla – Bug 313807
Patch to make clock work on vertical panels
Last modified: 2015-03-24 13:00:52 UTC
Patch follows.
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.
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).
Created attachment 51360 [details] [review] A fix to make the date display properly on a small side-panel.
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?
I have tested this here against cvs gnome-panel, works like a charm, I think this should definitely go into 2.12.1
Upping priority. Jeff Waugh things this is a 2.12.1 issue (so do I). Haven't read patch yet.
Thanks for the patch, William. Please commit it to HEAD. Jeff: I hope you'll be nice and come to France ;-)
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.