diff options
author | Damon Chaplin <damon@ximian.com> | 2001-09-29 09:51:45 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-09-29 09:51:45 +0800 |
commit | 11b30502cd6b5b8b9679c21e57fd11d49725d375 (patch) | |
tree | a8597d7c7390553b0a912d58d7d9a4c6e66c5d85 /calendar/gui | |
parent | 9072c0e4dca7048582bf59f89fca23c3a6a01e86 (diff) | |
download | gsoc2013-evolution-11b30502cd6b5b8b9679c21e57fd11d49725d375.tar.gz gsoc2013-evolution-11b30502cd6b5b8b9679c21e57fd11d49725d375.tar.zst gsoc2013-evolution-11b30502cd6b5b8b9679c21e57fd11d49725d375.zip |
use bound_text to print the summary, so it wraps instead of being clipped
001-09-28 Damon Chaplin <damon@ximian.com>
* gui/print.c (print_comp_item): use bound_text to print the summary,
so it wraps instead of being clipped to 1 line. Fixes part 3 of bug
#10285, I think.
* gui/dialogs/alarm-page.glade: left-aligned the Date/Time label.
Also set the width of the Summary & Date/Time labels to 10, and set
expand to TRUE, to make sure that the dialog doesn't keep getting
wider as the summary text on the main page gets longer. Could possibly
use an EClippedLabel here instead, so we get a '...' at the end if it
is clipped.
* gui/dialogs/recurrence-page.glade: changed Summary & Date/Time
widths as above.
* gui/print.c (print_calendar): use landscape mode for the month
preview.
(print_border_with_triangles): use EPSILON to account for floating
point errors. Hopefully fixes part 2b of bug #10285.
svn path=/trunk/; revision=13246
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/alarm-page.glade | 29 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.glade | 6 | ||||
-rw-r--r-- | calendar/gui/print.c | 33 |
3 files changed, 39 insertions, 29 deletions
diff --git a/calendar/gui/dialogs/alarm-page.glade b/calendar/gui/dialogs/alarm-page.glade index fad62dad70..56c6f6ada1 100644 --- a/calendar/gui/dialogs/alarm-page.glade +++ b/calendar/gui/dialogs/alarm-page.glade @@ -110,53 +110,55 @@ <widget> <class>GtkLabel</class> - <name>date-time</name> + <name>summary</name> + <width>10</width> <label></label> <justify>GTK_JUSTIFY_LEFT</justify> <wrap>False</wrap> - <xalign>0.5</xalign> + <xalign>0</xalign> <yalign>0.5</yalign> <xpad>4</xpad> <ypad>0</ypad> <child> <left_attach>1</left_attach> <right_attach>2</right_attach> - <top_attach>1</top_attach> - <bottom_attach>2</bottom_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> - <xexpand>False</xexpand> + <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> - <yfill>True</yfill> + <yfill>False</yfill> </child> </widget> <widget> <class>GtkLabel</class> - <name>summary</name> + <name>date-time</name> + <width>10</width> <label></label> <justify>GTK_JUSTIFY_LEFT</justify> <wrap>False</wrap> - <xalign>0</xalign> + <xalign>7.45058e-09</xalign> <yalign>0.5</yalign> <xpad>4</xpad> <ypad>0</ypad> <child> <left_attach>1</left_attach> <right_attach>2</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> - <xexpand>False</xexpand> + <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> - <yfill>False</yfill> + <yfill>True</yfill> </child> </widget> </widget> @@ -282,7 +284,6 @@ end of appointment <name>button-options</name> <can_focus>True</can_focus> <label>_Options...</label> - <relief>GTK_RELIEF_NORMAL</relief> <child> <padding>0</padding> <expand>False</expand> @@ -361,7 +362,6 @@ end of appointment <can_default>True</can_default> <can_focus>True</can_focus> <label>_Add</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> <widget> @@ -370,7 +370,6 @@ end of appointment <can_default>True</can_default> <can_focus>True</can_focus> <label>_Delete</label> - <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget> </widget> diff --git a/calendar/gui/dialogs/recurrence-page.glade b/calendar/gui/dialogs/recurrence-page.glade index 2858f3a9d6..a044a771aa 100644 --- a/calendar/gui/dialogs/recurrence-page.glade +++ b/calendar/gui/dialogs/recurrence-page.glade @@ -111,6 +111,7 @@ <widget> <class>GtkLabel</class> <name>summary</name> + <width>10</width> <label></label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> @@ -125,7 +126,7 @@ <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> - <xexpand>False</xexpand> + <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> @@ -137,6 +138,7 @@ <widget> <class>GtkLabel</class> <name>date-time</name> + <width>10</width> <label></label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> @@ -151,7 +153,7 @@ <bottom_attach>2</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> - <xexpand>False</xexpand> + <xexpand>True</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> diff --git a/calendar/gui/print.c b/calendar/gui/print.c index e7848e2ef4..f5b0dad825 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -6,6 +6,7 @@ * * Authors: Michael Zucchi <notzed@ximian.com> * Federico Mena-Quintero <federico@ximian.com> + * Damon Chaplin <damon@ximian.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,6 +96,8 @@ /* The space on the right of each event. */ #define DAY_VIEW_EVENT_X_PAD 8 +/* Allowance for small errors in floating point comparisons. */ +#define EPSILON 0.01 /* The weird month of September 1752, where 3 Sep through 13 Sep were eliminated due to the Gregorian reformation. */ @@ -272,7 +275,7 @@ print_border_with_triangles (GnomePrintContext *pc, gnome_print_gsave (pc); /* Fill in the interior of the rectangle, if desired. */ - if (fillcolor >= 0.0) { + if (fillcolor >= -EPSILON) { gnome_print_moveto (pc, l, t); if (left_triangle_width > 0.0) gnome_print_lineto (pc, l - left_triangle_width, @@ -290,7 +293,7 @@ print_border_with_triangles (GnomePrintContext *pc, } /* Draw the outline, if desired. */ - if (width >= 0.0) { + if (width >= -EPSILON) { gnome_print_moveto (pc, l, t); if (left_triangle_width > 0.0) gnome_print_lineto (pc, l - left_triangle_width, @@ -937,7 +940,7 @@ print_day_long_event (GnomePrintContext *pc, GnomeFont *font, x2 = right - 10; y1 = top - event->start_row_or_col * row_height - 4; y2 = y1 - row_height + 4; - print_border_with_triangles (pc, x1, x2, y1, y2, 0.0, 0.95, + print_border_with_triangles (pc, x1, x2, y1, y2, 0.5, 0.95, left_triangle_width, right_triangle_width); @@ -1449,7 +1452,7 @@ print_week_view_background (GnomePrintContext *pc, GnomeFont *font, gnome_print_lineto (pc, x2, y1 - psi->header_row_height + 3); gnome_print_setrgbcolor (pc, 0, 0, 0); - gnome_print_setlinewidth (pc, 0.0); + gnome_print_setlinewidth (pc, 0.5); gnome_print_stroke (pc); /* strftime format %A = full weekday name, %d = day of @@ -1764,7 +1767,7 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal, break; /* Print the box to put the tick in. */ - print_border (pc, x + 2, x + 8, y - 3, y - 11, 0.0, -1.0); + print_border (pc, x + 2, x + 8, y - 3, y - 11, 0.1, -1.0); /* If the task is complete, print a tick in the box. */ cal_component_get_completed (comp, &tt); @@ -2163,13 +2166,15 @@ print_comp_item (GnomePrintContext *pc, CalComponent *comp, case CAL_COMPONENT_EVENT: case CAL_COMPONENT_TODO: /* Summary */ + font = gnome_font_new_closest ("Times", GNOME_FONT_BOLD, FALSE, + 18); cal_component_get_summary (comp, &text); - print_text_size (pc, 18, text.value, ALIGN_LEFT, - left+3, right, top-3, top - 21); - top -= 21; + top = bound_text (pc, font, text.value, left, right, + top - 3, bottom, 0); + gtk_object_unref (GTK_OBJECT (font)); /* Date information */ - print_date_label (pc, comp, left+3, right, top-3, top - 15); + print_date_label (pc, comp, left, right, top-3, top - 15); top -= 30; /* Description */ @@ -2179,9 +2184,10 @@ print_comp_item (GnomePrintContext *pc, CalComponent *comp, CalComponentText *text = l->data; if (text->value != NULL) - top = bound_text (pc, font, text->value, left, right, top-3, bottom, 3); + top = bound_text (pc, font, text->value, left, right, top-3, bottom, 0); } cal_component_free_text_list (desc); + gtk_object_unref (GTK_OBJECT (font)); break; default: @@ -2298,9 +2304,12 @@ print_calendar (GnomeCalendar *gcal, gboolean preview, time_t date, if (preview) { GnomePrintMasterPreview *gpmp; + gboolean landscape = FALSE; - gpmp = gnome_print_master_preview_new (gpm, - _("Print Preview")); + if (default_view == PRINT_VIEW_MONTH) + landscape = TRUE; + + gpmp = gnome_print_master_preview_new_with_orientation (gpm, _("Print Preview"), landscape); gtk_widget_show (GTK_WIDGET (gpmp)); } else { gnome_print_master_print (gpm); |