aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-14 06:16:57 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:19 +0800
commit80bc7035be2d07d14e60b09a624147f6e92d1dc6 (patch)
tree6a6dbd40ed7efffa7f42c0f2ff940474b80f7191 /calendar/gui
parent2485ba3936c9fdd4e185393d49c34dae7ba1f49d (diff)
downloadgsoc2013-evolution-80bc7035be2d07d14e60b09a624147f6e92d1dc6.tar.gz
gsoc2013-evolution-80bc7035be2d07d14e60b09a624147f6e92d1dc6.tar.zst
gsoc2013-evolution-80bc7035be2d07d14e60b09a624147f6e92d1dc6.zip
Fudge GtkScrollable for gtk2.
Yes, the GtkScrollable interface is implemented by more than just GtkLayout, but it turns out GtkLayout is the only thing Evolution uses the GtkScrollable API for on the gtk3 branch.
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-day-view.c56
-rw-r--r--calendar/gui/e-meeting-time-sel.c26
2 files changed, 41 insertions, 41 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index e50e1c2b61..e762bda568 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -919,7 +919,7 @@ e_day_view_init (EDayView *day_view)
gint day;
GnomeCanvasGroup *canvas_group;
GtkAdjustment *adjustment;
- GtkLayout *layout;
+ GtkScrollable *scrollable;
GtkWidget *w;
gtk_widget_set_can_focus (GTK_WIDGET (day_view), TRUE);
@@ -1170,10 +1170,10 @@ e_day_view_init (EDayView *day_view)
* Times Canvas
*/
day_view->time_canvas = e_canvas_new ();
- layout = GTK_LAYOUT (day_view->main_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
- layout = GTK_LAYOUT (day_view->time_canvas);
- gtk_layout_set_vadjustment (layout, adjustment);
+ scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
+ scrollable = GTK_SCROLLABLE (day_view->time_canvas);
+ gtk_scrollable_set_vadjustment (scrollable, adjustment);
gtk_table_attach (GTK_TABLE (day_view), day_view->time_canvas,
0, 1, 1, 2,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
@@ -1192,21 +1192,21 @@ e_day_view_init (EDayView *day_view)
/*
* Scrollbar.
*/
- layout = GTK_LAYOUT (day_view->main_canvas);
- adjustment = gtk_layout_get_hadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+ adjustment = gtk_scrollable_get_hadjustment (scrollable);
day_view->mc_hscrollbar = gtk_hscrollbar_new (adjustment);
gtk_table_attach (GTK_TABLE (day_view), day_view->mc_hscrollbar, 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
gtk_widget_show (day_view->mc_hscrollbar);
- layout = GTK_LAYOUT (day_view->top_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->top_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
day_view->tc_vscrollbar = gtk_vscrollbar_new (adjustment);
gtk_table_attach (GTK_TABLE (day_view), day_view->tc_vscrollbar,
2, 3, 0, 1, 0, GTK_FILL, 0, 0);
/* gtk_widget_show (day_view->tc_vscrollbar); */
- layout = GTK_LAYOUT (day_view->main_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
day_view->vscrollbar = gtk_vscrollbar_new (adjustment);
gtk_table_attach (GTK_TABLE (day_view), day_view->vscrollbar,
2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0);
@@ -1582,7 +1582,7 @@ e_day_view_style_set (GtkWidget *widget,
MAX (day_view->row_height,
E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2);
- adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (day_view->main_canvas));
+ adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (day_view->main_canvas));
gtk_adjustment_set_step_increment (adjustment, day_view->row_height);
day_view->top_row_height =
@@ -1595,7 +1595,7 @@ e_day_view_style_set (GtkWidget *widget,
E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2 +
E_DAY_VIEW_TOP_CANVAS_Y_GAP);
- adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (day_view->top_canvas));
+ adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (day_view->top_canvas));
gtk_adjustment_set_step_increment (adjustment, day_view->top_row_height);
gtk_widget_set_size_request (day_view->top_dates_canvas, -1, day_view->top_row_height - 2);
@@ -5899,16 +5899,16 @@ static void
e_day_view_scroll (EDayView *day_view,
gfloat pages_to_scroll)
{
- GtkLayout *layout;
GtkAdjustment *adjustment;
+ GtkScrollable *scrollable;
gdouble new_value;
gdouble page_size;
gdouble lower;
gdouble upper;
gdouble value;
- layout = GTK_LAYOUT (day_view->main_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
page_size = gtk_adjustment_get_page_size (adjustment);
lower = gtk_adjustment_get_lower (adjustment);
@@ -5924,16 +5924,16 @@ static void
e_day_view_top_scroll (EDayView *day_view,
gfloat pages_to_scroll)
{
- GtkLayout *layout;
GtkAdjustment *adjustment;
+ GtkScrollable *scrollable;
gdouble new_value;
gdouble page_size;
gdouble lower;
gdouble upper;
gdouble value;
- layout = GTK_LAYOUT (day_view->top_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->top_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
page_size = gtk_adjustment_get_page_size (adjustment);
lower = gtk_adjustment_get_lower (adjustment);
@@ -5950,15 +5950,15 @@ e_day_view_ensure_rows_visible (EDayView *day_view,
gint start_row,
gint end_row)
{
- GtkLayout *layout;
GtkAdjustment *adjustment;
+ GtkScrollable *scrollable;
gdouble max_value;
gdouble min_value;
gdouble page_size;
gdouble value;
- layout = GTK_LAYOUT (day_view->main_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
value = gtk_adjustment_get_value (adjustment);
page_size = gtk_adjustment_get_page_size (adjustment);
@@ -6615,11 +6615,11 @@ e_day_view_on_editing_started (EDayView *day_view,
&start_day, &end_day,
&item_x, &item_y,
&item_w, &item_h)) {
- GtkLayout *layout;
GtkAdjustment *adjustment;
+ GtkScrollable *scrollable;
- layout = GTK_LAYOUT (day_view->top_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->top_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
/* and ensure it's visible too */
/*item_y = (event_num * (day_view->top_row_height + 1)) - 1;*/
@@ -6953,7 +6953,7 @@ e_day_view_auto_scroll_handler (gpointer data)
ECalendarViewPosition pos;
gint scroll_x, scroll_y, new_scroll_y, canvas_x, canvas_y, row, day;
GtkAdjustment *adjustment;
- GtkLayout *layout;
+ GtkScrollable *scrollable;
gdouble step_increment;
gdouble page_size;
gdouble upper;
@@ -6973,8 +6973,8 @@ e_day_view_auto_scroll_handler (gpointer data)
gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas),
&scroll_x, &scroll_y);
- layout = GTK_LAYOUT (day_view->main_canvas);
- adjustment = gtk_layout_get_vadjustment (layout);
+ scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
step_increment = gtk_adjustment_get_step_increment (adjustment);
page_size = gtk_adjustment_get_page_size (adjustment);
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 8b6f36da6b..14f05c5bc7 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -399,7 +399,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
GtkWidget *alignment, *child_hbox, *arrow, *menuitem;
GtkWidget *child;
GtkAdjustment *adjustment;
- GtkLayout *layout;
+ GtkScrollable *scrollable;
GSList *group;
guint accel_key;
time_t meeting_start_time;
@@ -508,13 +508,13 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
g_signal_connect (mts->display_main, "scroll-event",
G_CALLBACK (e_meeting_time_selector_on_canvas_scroll_event), mts);
- layout = GTK_LAYOUT (mts->display_main);
+ scrollable = GTK_SCROLLABLE (mts->display_main);
- adjustment = gtk_layout_get_vadjustment (layout);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
gtk_scrolled_window_set_vadjustment (
GTK_SCROLLED_WINDOW (sw), adjustment);
- adjustment = gtk_layout_get_hadjustment (layout);
+ adjustment = gtk_scrollable_get_hadjustment (scrollable);
mts->hscrollbar = gtk_hscrollbar_new (adjustment);
gtk_adjustment_set_step_increment (adjustment, mts->day_width);
gtk_table_attach (
@@ -522,7 +522,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
1, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 0);
gtk_widget_show (mts->hscrollbar);
- adjustment = gtk_layout_get_vadjustment (layout);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
mts->vscrollbar = gtk_vscrollbar_new (adjustment);
gtk_adjustment_set_step_increment (adjustment, mts->row_height);
gtk_table_attach (
@@ -842,12 +842,12 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
e_meeting_time_selector_alloc_named_color (mts, "orange4", &mts->busy_colors[E_MEETING_FREE_BUSY_OUT_OF_OFFICE]);
/* Connect handlers to the adjustments scroll the other items. */
- layout = GTK_LAYOUT (mts->display_main);
- adjustment = gtk_layout_get_hadjustment (layout);
+ scrollable = GTK_SCROLLABLE (mts->display_main);
+ adjustment = gtk_scrollable_get_hadjustment (scrollable);
g_signal_connect (
adjustment, "value_changed",
G_CALLBACK (e_meeting_time_selector_hadjustment_changed), mts);
- adjustment = gtk_layout_get_vadjustment (layout);
+ adjustment = gtk_scrollable_get_vadjustment (scrollable);
g_signal_connect (
adjustment, "value_changed",
G_CALLBACK (e_meeting_time_selector_vadjustment_changed), mts);
@@ -1182,10 +1182,10 @@ style_change_idle_func (EMeetingTimeSelector *mts)
widget = mts->display_main;
- adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (widget));
+ adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget));
gtk_adjustment_set_step_increment (adjustment, mts->day_width);
- adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (widget));
+ adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget));
gtk_adjustment_set_step_increment (adjustment, mts->row_height);
g_object_unref (layout);
@@ -1256,11 +1256,11 @@ e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment,
EMeetingTimeSelector *mts)
{
GtkAdjustment *hadjustment;
- GtkLayout *layout;
+ GtkScrollable *scrollable;
gdouble value;
- layout = GTK_LAYOUT (mts->display_top);
- hadjustment = gtk_layout_get_hadjustment (layout);
+ scrollable = GTK_SCROLLABLE (mts->display_top);
+ hadjustment = gtk_scrollable_get_hadjustment (scrollable);
value = gtk_adjustment_get_value (adjustment);
gtk_adjustment_set_value (hadjustment, value);