[buoh] Port to gtk3



commit faffbc5d029cdffaa18e02ab44abc43ab1296b74
Author: Pablo Arroyo Loma <pzioma gmail com>
Date:   Sat May 14 16:25:49 2011 +0200

    Port to gtk3
    
    Fixes bug #650013.

 configure.ac                 |    4 +-
 src/buoh-add-comic-dialog.c  |    6 +-
 src/buoh-comic-list.c        |   48 ++++++++-----
 src/buoh-properties-dialog.c |    9 +--
 src/buoh-view-comic.c        |  158 +++++++++++++++++++++++++-----------------
 src/buoh-view-message.c      |   27 +++++---
 src/buoh-view.c              |    2 +-
 src/buoh-window.c            |    6 +-
 8 files changed, 151 insertions(+), 109 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4dded05..6771055 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,13 +37,13 @@ dnl ** pkg-config dependacy checks          **
 dnl ******************************************
 
 GLIB_REQUIRED=2.6.0
-GTK_REQUIRED=2.6.0
+GTK_REQUIRED=3.0.0
 LIBSOUP_REQUIRED=2.4.0
 GCONF_REQUIRED=2.2.0
 
 PKG_CHECK_MODULES(BUOH, 
 		  glib-2.0       >= $GLIB_REQUIRED
-		  gtk+-2.0       >= $GTK_REQUIRED 
+		  gtk+-3.0       >= $GTK_REQUIRED
 		  libsoup-2.4    >= $LIBSOUP_REQUIRED
 		  gconf-2.0      >= $GCONF_REQUIRED) 
 AC_SUBST(BUOH_CFLAGS)
diff --git a/src/buoh-add-comic-dialog.c b/src/buoh-add-comic-dialog.c
index 633f370..63cc150 100644
--- a/src/buoh-add-comic-dialog.c
+++ b/src/buoh-add-comic-dialog.c
@@ -67,9 +67,9 @@ buoh_add_comic_dialog_init (BuohAddComicDialog *dialog)
 	gtk_window_set_title (GTK_WINDOW (dialog), _("Add Comic"));
 	gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 300);
 	gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
-	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 12);
+	gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+			     12);
 
 	gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE,
 			       GTK_RESPONSE_ACCEPT);
@@ -157,7 +157,7 @@ buoh_add_comic_dialog_init (BuohAddComicDialog *dialog)
 	gtk_container_add (GTK_CONTAINER (frame), vbox);
 	gtk_widget_show (vbox);
 
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
 			    frame, TRUE, TRUE, 0);
 	gtk_widget_show (frame);
 
diff --git a/src/buoh-comic-list.c b/src/buoh-comic-list.c
index a5570be..7c51b7f 100644
--- a/src/buoh-comic-list.c
+++ b/src/buoh-comic-list.c
@@ -41,11 +41,11 @@ static void buoh_comic_list_init                   (BuohComicList *buoh_comic_li
 static void buoh_comic_list_class_init             (BuohComicListClass *klass);
 static void buoh_comic_list_finalize               (GObject *object);
 
-static void buoh_comic_list_size_request           (GtkWidget        *widget,
-						    GtkRequisition   *requisition);
-static void buoh_comic_list_size_allocate          (GtkWidget        *widget,
+static void buoh_comic_list_get_preferred_width    (GtkWidget        *widget,
+						    gint             *minimun,
+						    gint             *natural);
+static void     buoh_comic_list_size_allocate      (GtkWidget        *widget,
 						    GtkAllocation    *allocation);
-
 static void     buoh_comic_list_selection_changed  (GtkTreeSelection *selection,
 						    gpointer          gdata);
 static gboolean buoh_comic_list_visible            (GtkTreeModel     *model,
@@ -151,7 +151,7 @@ buoh_comic_list_class_init (BuohComicListClass *klass)
 
 	g_type_class_add_private (klass, sizeof (BuohComicListPrivate));
 
-	widget_class->size_request = buoh_comic_list_size_request;
+	widget_class->get_preferred_width = buoh_comic_list_get_preferred_width;
 	widget_class->size_allocate = buoh_comic_list_size_allocate;
 
 	object_class->finalize = buoh_comic_list_finalize;
@@ -174,32 +174,42 @@ buoh_comic_list_finalize (GObject *object)
 }
 
 static void
-buoh_comic_list_size_request (GtkWidget *widget, GtkRequisition *requisition)
+buoh_comic_list_get_preferred_width (GtkWidget *widget,
+				     gint      *minimun,
+				     gint      *natural)
 {
-	GtkBin         *bin = GTK_BIN (widget);
-	GtkRequisition  child_requisition;
+	GtkBin    *bin = GTK_BIN (widget);
+	GtkWidget *child;
+	gint       child_minimun;
+	gint       child_natural;
 
-	if (bin->child && gtk_widget_get_visible (bin->child)) {
-		gtk_widget_size_request (bin->child, &child_requisition);
-		*requisition = child_requisition;
-		
+	child = gtk_bin_get_child (bin);
+
+	if (child && gtk_widget_get_visible (child)) {
+		gtk_widget_get_preferred_width (child,
+						&child_minimun,
+						&child_natural);
 		/* we need some extra size */
-		requisition->width += 100;
+		*minimun = child_minimun + 100;
+		*natural = child_natural + 100;
 	} else {
-		requisition->width = 0;
-		requisition->height = 0;
+		*minimun = 0;
+		*natural = 0;
 	}
 }
 
 static void
 buoh_comic_list_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 {
-	GtkBin *bin = GTK_BIN (widget);
+	GtkBin    *bin = GTK_BIN (widget);
+	GtkWidget *child;
+
+	child = gtk_bin_get_child (bin);
 
-	widget->allocation = *allocation;
+	gtk_widget_set_allocation (widget, allocation);
 
-	if (bin->child && gtk_widget_get_visible (bin->child)) {
-		gtk_widget_size_allocate (bin->child, allocation);
+	if (child && gtk_widget_get_visible (child)) {
+		gtk_widget_size_allocate (child, allocation);
 
 		/* we need some extra size */
 		allocation->width += 100;
diff --git a/src/buoh-properties-dialog.c b/src/buoh-properties-dialog.c
index 9601cb8..7e11f13 100644
--- a/src/buoh-properties-dialog.c
+++ b/src/buoh-properties-dialog.c
@@ -47,9 +47,8 @@ buoh_properties_dialog_init (BuohPropertiesDialog *dialog)
 
 	gtk_window_set_title (GTK_WINDOW (dialog), _("Comic Properties"));
 	gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
-	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 12);
+	gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 12);
 
 	gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE,
 			       GTK_RESPONSE_ACCEPT);
@@ -80,7 +79,7 @@ buoh_properties_dialog_set_comic_manager (BuohPropertiesDialog   *dialog,
 	GtkWidget *label_pub_days, *label_pub_days_val;
 	GtkWidget *image;
 	GDate     *comic_date;
-	gchar date[DATE_BUFFER];
+	gchar      date[DATE_BUFFER];
 	gchar     *pub_days;
 	BuohComic *comic;
 	GdkPixbuf *thumbnail;
@@ -200,7 +199,7 @@ buoh_properties_dialog_set_comic_manager (BuohPropertiesDialog   *dialog,
 			  1, 2, 5, 6, GTK_FILL, GTK_FILL, 0, 0);
 		gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (label_pub_days_val),
 			  2, 3, 5, 6, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
-		
+
 		gtk_widget_show (label_pub_days);
 		gtk_widget_show (label_pub_days_val);
 	}
@@ -221,7 +220,7 @@ buoh_properties_dialog_set_comic_manager (BuohPropertiesDialog   *dialog,
 	gtk_widget_show (label_date);
 	gtk_widget_show (label_date_val);
 
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
 			    table, TRUE, TRUE, 0);
 
 	gtk_widget_show (table);
diff --git a/src/buoh-view-comic.c b/src/buoh-view-comic.c
index 6271bec..6a6ebbe 100644
--- a/src/buoh-view-comic.c
+++ b/src/buoh-view-comic.c
@@ -84,8 +84,6 @@ static gboolean buoh_view_comic_scroll_event          (GtkWidget        *widget,
 						       GdkEventScroll   *event);
 static void     buoh_view_comic_size_allocate         (GtkWidget        *widget,
 						       GtkAllocation    *allocation);
-static void     buoh_view_comic_size_request          (GtkWidget        *widget,
-						       GtkRequisition   *requisition);
 static void     buoh_view_comic_drag_begin            (GtkWidget        *widget,
 						       GdkDragContext   *drag_context,
 						       gpointer          gdata);
@@ -119,7 +117,7 @@ G_DEFINE_TYPE (BuohViewComic, buoh_view_comic, GTK_TYPE_VIEWPORT)
 static void
 buoh_view_comic_init (BuohViewComic *c_view)
 {
-	GTK_WIDGET_SET_FLAGS (c_view, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (GTK_WIDGET (c_view), TRUE);
 	
 	c_view->priv = BUOH_VIEW_COMIC_GET_PRIVATE (c_view);
 
@@ -167,7 +165,6 @@ buoh_view_comic_class_init (BuohViewComicClass *klass)
 	widget_class->key_press_event = buoh_view_comic_key_press_event;
 	widget_class->scroll_event = buoh_view_comic_scroll_event;
 	widget_class->size_allocate = buoh_view_comic_size_allocate;
-	widget_class->size_request = buoh_view_comic_size_request;
 
 	/* Properties */
 	g_object_class_install_property (object_class,
@@ -255,7 +252,7 @@ buoh_view_comic_set_property (GObject      *object,
 	case PROP_ZOOM_MODE:
 		c_view->priv->zoom_mode = g_value_get_enum (value);
 		buoh_view_comic_update_scrollbar_policy (c_view);
-		
+
 		break;
 	case PROP_SCALE:
 		c_view->priv->scale = g_value_get_double (value);
@@ -300,46 +297,52 @@ buoh_view_comic_key_press_event (GtkWidget *widget, GdkEventKey *event)
 	gdouble        value;
 
 	switch (event->keyval) {
-	case GDK_Up:
-	case GDK_KP_Up:
+	case GDK_KEY_Up:
+	case GDK_KEY_KP_Up:
 		g_object_get (G_OBJECT (c_view),
 			      "vadjustment", &adjustment,
 			      NULL);
-		value = adjustment->value - adjustment->step_increment;
-		
+		value = gtk_adjustment_get_value (adjustment) -
+			gtk_adjustment_get_step_increment (adjustment);
+
 		break;
-	case GDK_Down:
-	case GDK_KP_Down:
+	case GDK_KEY_Down:
+	case GDK_KEY_KP_Down:
 		g_object_get (G_OBJECT (c_view),
 			      "vadjustment", &adjustment,
 			      NULL);
-		value = adjustment->value + adjustment->step_increment;
-		
+		value = gtk_adjustment_get_value (adjustment) +
+			gtk_adjustment_get_step_increment (adjustment);
+
 		break;
-	case GDK_Left:
-	case GDK_KP_Left:
+	case GDK_KEY_Left:
+	case GDK_KEY_KP_Left:
 		g_object_get (G_OBJECT (c_view),
 			      "hadjustment", &adjustment,
 			      NULL);
-		value = adjustment->value - adjustment->step_increment;
-		
+		value = gtk_adjustment_get_value (adjustment) -
+			gtk_adjustment_get_step_increment (adjustment);
+
 		break;
-	case GDK_Right:
-	case GDK_KP_Right:
+	case GDK_KEY_Right:
+	case GDK_KEY_KP_Right:
 		g_object_get (G_OBJECT (c_view),
 			      "hadjustment", &adjustment,
 			      NULL);
-		value = adjustment->value + adjustment->step_increment;
-		
+		value = gtk_adjustment_get_value (adjustment) +
+			gtk_adjustment_get_step_increment (adjustment);
+
 		break;
 	default:
 		return FALSE;
 	}
 
-	value = CLAMP (value, adjustment->lower,
-		       adjustment->upper - adjustment->page_size);
+	value = CLAMP (value,
+		       gtk_adjustment_get_lower (adjustment),
+		       gtk_adjustment_get_upper (adjustment) -
+		       gtk_adjustment_get_page_size (adjustment));
 	gtk_adjustment_set_value (adjustment, value);
-	
+
 	return TRUE;
 }
 
@@ -390,7 +393,6 @@ buoh_view_comic_update_zoom_cb (BuohViewComic *c_view)
 		scale_width =
 			buoh_view_comic_get_scale_for_width (c_view,
 							     gdk_pixbuf_get_width (pixbuf));
-		
 		scale_height =
 			buoh_view_comic_get_scale_for_height (c_view,
 							      gdk_pixbuf_get_height (pixbuf));
@@ -405,20 +407,12 @@ buoh_view_comic_update_zoom_cb (BuohViewComic *c_view)
 		break;
 	default:
 		g_assert_not_reached ();
-
 	}
 
 	if (new_scale != c_view->priv->scale)
 		buoh_view_comic_zoom (c_view, new_scale, FALSE);
-	
-	return FALSE;
-}
 
-static void
-buoh_view_comic_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
-	requisition->width = -1;
-	requisition->height = -1;
+	return FALSE;
 }
 
 static void
@@ -433,7 +427,7 @@ buoh_view_comic_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 		id = g_idle_add ((GSourceFunc) buoh_view_comic_update_zoom_cb,
 				 c_view);
 	}
-	
+
 	GTK_WIDGET_CLASS (buoh_view_comic_parent_class)->size_allocate (widget, allocation);
 }
 
@@ -476,16 +470,15 @@ buoh_view_comic_drag_data_get (GtkWidget *widget, GdkDragContext *drag_context,
 			       GtkSelectionData *data, guint info, guint time,
 			       gpointer gdata)
 {
-	BuohViewComic *c_view = BUOH_VIEW_COMIC (widget);
-	const gchar   *uri;
+	BuohViewComic  *c_view = BUOH_VIEW_COMIC (widget);
+	const gchar    *uri;
+	gchar          *uris[2];
 
 	uri = buoh_comic_get_uri (c_view->priv->comic);
 	if (uri) {
-		gtk_selection_data_set (data,
-					data->target,
-					8,
-					(guchar *)uri,
-					strlen (uri));
+		uris[0] = g_strdup (uri);
+		uris[1] = NULL;
+		gtk_selection_data_set_uris (data, uris);
 	}
 }
 
@@ -515,26 +508,40 @@ buoh_view_comic_size_prepared (GdkPixbufLoader *loader,
 		 */
 		swindow = gtk_widget_get_parent (GTK_WIDGET (c_view));
 		if (GTK_IS_SCROLLED_WINDOW (swindow)) {
-			GtkRequisition req;
+			GtkAllocation  allocation;
+			GtkStyleContext *style;
+			GtkBorder      padding;
 			gint           scrollbar_spacing;
-			gint           new_scale;
+			gint           scrollbar_width;
 			gint           widget_width;
 			gint           widget_height;
+			gint           new_scale;
 
-			widget_width = GTK_WIDGET (c_view)->allocation.width;
-			widget_width -= 2 * GTK_WIDGET (c_view)->style->xthickness;
+			gtk_widget_get_allocation (GTK_WIDGET (c_view), &allocation);
+			widget_width = allocation.width;
+
+			style = gtk_widget_get_style_context (GTK_WIDGET (c_view));
+			gtk_style_context_get_padding (style,
+						       GTK_STATE_FLAG_NORMAL,
+						       &padding);
+			widget_width -= padding.left + padding.right;
 
 			new_scale = (gdouble)widget_width / (gdouble)width;
 
-			widget_height = GTK_WIDGET (c_view)->allocation.height;
+			widget_height = allocation.height;
 
 			if ((height * new_scale) > widget_height) {
-				gtk_widget_size_request (GTK_SCROLLED_WINDOW (swindow)->vscrollbar, &req);
+				GtkWidget *vscrollbar;
+
+				vscrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (swindow));
+
+				scrollbar_width = gtk_widget_get_allocated_width (vscrollbar);
 				gtk_widget_style_get (swindow,
 						      "scrollbar_spacing", &scrollbar_spacing,
 						      NULL);
 				
-				GTK_WIDGET (c_view)->allocation.width -= (req.width + scrollbar_spacing);
+				allocation.width -= (scrollbar_width + scrollbar_spacing);
+				gtk_widget_set_allocation (GTK_WIDGET (c_view), &allocation);
 			}
 		}
 		
@@ -564,7 +571,8 @@ buoh_view_comic_prepare_load (BuohViewComic *c_view)
 	buoh_view_comic_update_scrollbar_policy (c_view);
 
 	if (gtk_widget_get_realized (GTK_WIDGET (c_view)))
-		gdk_window_set_cursor (GTK_WIDGET (c_view)->window, NULL);
+		gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (c_view)),
+				       NULL);
 
 	gtk_image_clear (GTK_IMAGE (c_view->priv->image));
 }
@@ -630,7 +638,8 @@ buoh_view_comic_load_finished (BuohViewComic *c_view,
 
 	gdk_pixbuf_loader_close (c_view->priv->pixbuf_loader, NULL);
 
-	gdk_window_set_cursor (GTK_WIDGET (c_view)->window, NULL);
+	gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (c_view)),
+			       NULL);
 	
 	buoh_comic_loader_get_error (c_view->priv->comic_loader, &error);
 	if (error) {
@@ -748,8 +757,9 @@ buoh_view_comic_load (BuohViewComic *c_view)
 			      NULL);
 
 		cursor = gdk_cursor_new (GDK_WATCH);
-		gdk_window_set_cursor (GTK_WIDGET (c_view)->window, cursor);
-		gdk_cursor_unref (cursor);
+		gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (c_view)),
+				       cursor);
+		g_object_unref (cursor);
 
 		if (c_view->priv->pixbuf_loader) {
 			gdk_pixbuf_loader_close (c_view->priv->pixbuf_loader, NULL);
@@ -802,13 +812,22 @@ static gdouble
 buoh_view_comic_get_scale_for_width (BuohViewComic *c_view,
 				     gint           width)
 {
-	GtkWidget *widget = GTK_WIDGET (c_view);
-	gint       widget_width;
-	gdouble    new_scale;
+	GtkWidget       *widget = GTK_WIDGET (c_view);
+	GtkAllocation    allocation;
+	GtkStyleContext *style;
+	GtkBorder        padding;
+	gint             widget_width;
+	gdouble          new_scale;
+
+	gtk_widget_get_allocation (widget, &allocation);
+	widget_width = allocation.width;
+
+	style = gtk_widget_get_style_context (widget);
+	gtk_style_context_get_padding (style,
+				       GTK_STATE_FLAG_NORMAL,
+				       &padding);
+	widget_width -= padding.left + padding.right;
 
-	widget_width = widget->allocation.width;
-	widget_width -= 2 * widget->style->xthickness;
-	
 	new_scale = (gdouble)widget_width / (gdouble)width;
 
 	return new_scale;
@@ -818,13 +837,22 @@ static gdouble
 buoh_view_comic_get_scale_for_height (BuohViewComic *c_view,
 				      gint           height)
 {
-	GtkWidget *widget = GTK_WIDGET (c_view);
-	gint       widget_height;
-	gdouble    new_scale;
+	GtkWidget       *widget = GTK_WIDGET (c_view);
+	GtkAllocation    allocation;
+	GtkStyleContext *style;
+	GtkBorder        padding;
+	gint             widget_height;
+	gdouble          new_scale;
+
+	gtk_widget_get_allocation (widget, &allocation);
+	widget_height = allocation.height;
+
+	style = gtk_widget_get_style_context (widget);
+	gtk_style_context_get_padding (style,
+				       GTK_STATE_FLAG_NORMAL,
+				       &padding);
+	widget_height -= padding.top + padding.bottom;
 
-	widget_height = widget->allocation.height;
-	widget_height -= 2 * widget->style->ythickness;
-	
 	new_scale = (gdouble)widget_height / (gdouble)height;
 
 	return new_scale;
diff --git a/src/buoh-view-message.c b/src/buoh-view-message.c
index fb805fd..c752652 100644
--- a/src/buoh-view-message.c
+++ b/src/buoh-view-message.c
@@ -46,7 +46,7 @@ buoh_view_message_init (BuohViewMessage *m_view)
 	GtkWidget *hbox;
 	GtkWidget *vbox;
 
-	GTK_WIDGET_SET_FLAGS (m_view, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (GTK_WIDGET (m_view), TRUE);
 	
 	m_view->priv = BUOH_VIEW_MESSAGE_GET_PRIVATE (m_view);
 
@@ -112,8 +112,10 @@ buoh_view_message_new (void)
 void
 buoh_view_message_set_title (BuohViewMessage *m_view, const gchar *title)
 {
-	gint size;
-	PangoFontDescription *font_desc;
+	gint                        size;
+	GtkStyleContext            *style;
+	const PangoFontDescription *font_desc;
+	PangoFontDescription       *font_desc_new;
 
 	g_return_if_fail (BUOH_IS_VIEW_MESSAGE (m_view));
 	g_return_if_fail (title != NULL);
@@ -121,18 +123,23 @@ buoh_view_message_set_title (BuohViewMessage *m_view, const gchar *title)
 	gtk_label_set_text (GTK_LABEL (m_view->priv->title), title);
 	
 	/* unset the font settings */
-	gtk_widget_modify_font (m_view->priv->title, NULL);
+	gtk_widget_override_font (m_view->priv->title, NULL);
 
-	size = pango_font_description_get_size (m_view->priv->title->style->font_desc);
+	style = gtk_widget_get_style_context (m_view->priv->title);
+	font_desc = gtk_style_context_get_font (style,
+						GTK_STATE_FLAG_NORMAL);
+	size = pango_font_description_get_size (font_desc);
 	
-	font_desc = pango_font_description_new ();
+	font_desc_new = pango_font_description_new ();
 
-	pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
-	pango_font_description_set_size (font_desc, size * PANGO_SCALE_X_LARGE);
+	pango_font_description_set_weight (font_desc_new,
+					   PANGO_WEIGHT_BOLD);
+	pango_font_description_set_size (font_desc_new,
+					 size * PANGO_SCALE_X_LARGE);
 
-	gtk_widget_modify_font (m_view->priv->title, font_desc);
+	gtk_widget_override_font (m_view->priv->title, font_desc_new);
 
-	pango_font_description_free (font_desc);
+	pango_font_description_free (font_desc_new);
 
 	gtk_widget_show (m_view->priv->title);
 }
diff --git a/src/buoh-view.c b/src/buoh-view.c
index d238bb0..288bfaf 100644
--- a/src/buoh-view.c
+++ b/src/buoh-view.c
@@ -123,7 +123,7 @@ buoh_view_init (BuohView *buoh_view)
         GtkWidget *label;
         GtkWidget *swindow;
 
-	GTK_WIDGET_SET_FLAGS (buoh_view, GTK_CAN_FOCUS);
+	gtk_widget_set_can_focus (GTK_WIDGET (buoh_view), TRUE);
 	
         buoh_view->priv = BUOH_VIEW_GET_PRIVATE (buoh_view);
 
diff --git a/src/buoh-window.c b/src/buoh-window.c
index 3677722..cfb26d0 100644
--- a/src/buoh-window.c
+++ b/src/buoh-window.c
@@ -364,8 +364,6 @@ buoh_window_init (BuohWindow *buoh_window)
 
 	/* Status bar */
 	buoh_window->priv->statusbar = gtk_statusbar_new ();
-	gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (buoh_window->priv->statusbar),
-					   TRUE);
 	buoh_window->priv->view_message_cid = gtk_statusbar_get_context_id
 		(GTK_STATUSBAR (buoh_window->priv->statusbar), "view_message");
 	buoh_window->priv->help_message_cid = gtk_statusbar_get_context_id
@@ -1132,7 +1130,7 @@ buoh_window_comic_list_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpoi
 	state = event->state & GDK_SHIFT_MASK;
 
 	if (state == GDK_SHIFT_MASK &&
-	    event->keyval == GDK_F10) {
+	    event->keyval == GDK_KEY_F10) {
 		selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
 		if (gtk_tree_selection_get_selected (selection, NULL, NULL)) {
 			popup = gtk_ui_manager_get_widget (window->priv->ui_manager, "/ListPopup");
@@ -1201,7 +1199,7 @@ buoh_window_comic_view_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpoi
 	state = event->state & GDK_SHIFT_MASK;
 
 	if (state == GDK_SHIFT_MASK &&
-	    event->keyval == GDK_F10) {
+	    event->keyval == GDK_KEY_F10) {
 		popup = gtk_ui_manager_get_widget (window->priv->ui_manager, "/ViewPopup");
 
 		gtk_menu_popup (GTK_MENU (popup), NULL,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]