PATCH: add paned windows to the Day View
- From: rms39 columbia edu (Russell Steinthal)
- To: calendar-list gnome org
- Subject: PATCH: add paned windows to the Day View
- Date: Mon, 18 Oct 1999 22:00:04 -0400
All:
I got frustrated with not being able to expand the size of the to-do
list, so I whipped up the following patch to put the day view's main
elements (the daily calendar, the mini monthly calendar, and the
to-do list) into paned windows so that the user can adjust their
relative sizes.
I don't think there's any functionality lost by adding the panes, so
if there aren't any objections, I'll commit the patch to HEAD in a
day or so. If there are problems, please let me know.
-Russell
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-pim/gncal/ChangeLog,v
retrieving revision 1.226
diff -u -r1.226 ChangeLog
--- ChangeLog 1999/10/13 16:16:49 1.226
+++ ChangeLog 1999/10/19 00:32:38
@@ -1,3 +1,10 @@
+1999-10-18 Russell Steinthal <rms39@columbia.edu>
+
+ * gncal-day-panel.c (gncal_day_panel_new): Placed the various
+ elements of the day view in paned windows so that the user can
+ adjust the relative sizes of the daily schedule, monthly calendar,
+ and to-do list.
+
1999-10-13 Eskil Olsen <deity@eskil.dk>
* Makefile.am: Hopefully the fixes the much-hated
Index: gncal-day-panel.c
===================================================================
RCS file: /cvs/gnome/gnome-pim/gncal/gncal-day-panel.c,v
retrieving revision 1.18
diff -u -r1.18 gncal-day-panel.c
--- gncal-day-panel.c 1999/09/27 20:56:29 1.18
+++ gncal-day-panel.c 1999/10/19 00:32:38
@@ -95,6 +95,8 @@
{
GncalDayPanel *dpanel;
GtkWidget *w;
+ GtkWidget *hpane, *vpane;
+ gint start_pos = 265;
struct tm tm;
g_return_val_if_fail (calendar != NULL, NULL);
@@ -118,6 +120,15 @@
0, 0);
gtk_widget_show (w);
+ /* Create horizontal pane */
+
+ hpane = gtk_hpaned_new ();
+ gtk_table_attach (GTK_TABLE (dpanel), hpane,
+ 0, 1, 2, 4,
+ GTK_EXPAND | GTK_FILL | GTK_SHRINK,
+ GTK_EXPAND | GTK_FILL | GTK_SHRINK,
+ 0, 0);
+
/* Full day */
w = gtk_scrolled_window_new (NULL, NULL);
@@ -125,11 +136,8 @@
gtk_scrolled_window_set_policy (dpanel->fullday_sw,
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_table_attach (GTK_TABLE (dpanel), w,
- 0, 1, 1, 4,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
+ gtk_paned_pack1 (GTK_PANED (hpane), w, FALSE, TRUE);
+ /*gtk_paned_add1 (GTK_PANED (hpane), w);*/
gtk_widget_show (w);
w = gncal_full_day_new (calendar, time_day_begin (start_of_day),
time_day_end (start_of_day));
@@ -146,6 +154,12 @@
(GtkSignalFunc) full_day_size_allocated,
dpanel);
+ /* Create vertical pane */
+
+ vpane = gtk_vpaned_new ();
+ gtk_paned_pack2 (GTK_PANED (hpane), GTK_WIDGET (vpane), TRUE, TRUE);
+ /*gtk_paned_add2 (GTK_PANED (hpane), GTK_WIDGET (vpane));*/
+
/* Gtk calendar */
tm = *localtime (&start_of_day);
@@ -165,37 +179,21 @@
dpanel);
gtk_signal_connect (GTK_OBJECT (dpanel->gtk_calendar),
"month_changed",
GTK_SIGNAL_FUNC (retag_calendar), dpanel);
- gtk_table_attach (GTK_TABLE (dpanel), w,
- 1, 2, 1, 2,
- GTK_FILL | GTK_SHRINK,
- GTK_FILL | GTK_SHRINK,
- 0, 0);
+ gtk_paned_add1 (GTK_PANED (vpane), w);
gtk_widget_show (w);
- /* Separator */
-
- w = gtk_hseparator_new ();
- gtk_table_attach (GTK_TABLE (dpanel), w,
- 1, 2, 2, 3,
- GTK_FILL | GTK_SHRINK,
- GTK_FILL | GTK_SHRINK,
- 0, 0);
- gtk_widget_show (w);
-
/* To-do */
w = gncal_todo_new (calendar);
dpanel->todo = GNCAL_TODO (w);
- gtk_table_attach (GTK_TABLE (dpanel), w,
- 1, 2, 3, 4,
- GTK_FILL | GTK_SHRINK,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
- 0, 0);
+ gtk_paned_add2 (GTK_PANED (vpane), w);
gtk_widget_show (w);
/* Done */
gncal_day_panel_set (dpanel, start_of_day);
+
+ gtk_paned_set_position (GTK_PANED (hpane), start_pos);
return GTK_WIDGET (dpanel);
}
--
Russell Steinthal Columbia Law School, Class of 2002
<rms39@columbia.edu> Columbia College, Class of 1999
<steintr@nj.org> UNIX System Administrator, nj.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]