aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gncal-day-panel.c48
-rw-r--r--calendar/gui/gncal-day-panel.c48
3 files changed, 53 insertions, 50 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 7fb9dd4318..759fee0e9d 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -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-18 Martin Norbäck <norpan@bigfoot.com>
* gncal.desktop: Added swedish translation
diff --git a/calendar/gncal-day-panel.c b/calendar/gncal-day-panel.c
index f041e3d6dd..f407a497d3 100644
--- a/calendar/gncal-day-panel.c
+++ b/calendar/gncal-day-panel.c
@@ -95,6 +95,8 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
{
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 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
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 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
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 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
(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,38 +179,22 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
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_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_paned_add1 (GTK_PANED (vpane), w);
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);
}
diff --git a/calendar/gui/gncal-day-panel.c b/calendar/gui/gncal-day-panel.c
index f041e3d6dd..f407a497d3 100644
--- a/calendar/gui/gncal-day-panel.c
+++ b/calendar/gui/gncal-day-panel.c
@@ -95,6 +95,8 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
{
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 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
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 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
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 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
(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,38 +179,22 @@ gncal_day_panel_new (GnomeCalendar *calendar, time_t start_of_day)
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_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_paned_add1 (GTK_PANED (vpane), w);
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);
}