filebrowser: Improve GTK3 support

This commit is contained in:
Stefano Karapetsas 2013-10-30 23:13:21 +01:00
parent 3fa783ec0e
commit 70a9d462ec
2 changed files with 13 additions and 1 deletions

View File

@ -323,7 +323,7 @@ set_click_policy_property (PlumaFileBrowserView *obj,
obj->priv->hover_path = NULL; obj->priv->hover_path = NULL;
} }
if (GTK_WIDGET_REALIZED (GTK_WIDGET (obj))) { if (gtk_widget_get_realized (GTK_WIDGET (obj))) {
win = gtk_widget_get_window (GTK_WIDGET (obj)); win = gtk_widget_get_window (GTK_WIDGET (obj));
gdk_window_set_cursor (win, NULL); gdk_window_set_cursor (win, NULL);
@ -642,7 +642,11 @@ key_press_event (GtkWidget *widget,
handled = FALSE; handled = FALSE;
break; break;
} }
#if GTK_CHECK_VERSION (3, 0, 0)
if (!gtk_widget_has_focus (widget)) {
#else
if (!GTK_WIDGET_HAS_FOCUS (widget)) { if (!GTK_WIDGET_HAS_FOCUS (widget)) {
#endif
handled = FALSE; handled = FALSE;
break; break;
} }

View File

@ -997,7 +997,11 @@ create_toolbar (PlumaFileBrowserWidget * obj,
"DirectoryPrevious"); "DirectoryPrevious");
g_object_set (action, "is_important", TRUE, "short_label", g_object_set (action, "is_important", TRUE, "short_label",
_("Previous location"), NULL); _("Previous location"), NULL);
#if GTK_CHECK_VERSION (2, 16, 0)
gtk_activatable_set_related_action (GTK_ACTIVATABLE (widget), action);
#else
gtk_action_connect_proxy (action, widget); gtk_action_connect_proxy (action, widget);
#endif
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget), 0); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget), 0);
/* Next directory menu tool item */ /* Next directory menu tool item */
@ -1018,7 +1022,11 @@ create_toolbar (PlumaFileBrowserWidget * obj,
"DirectoryNext"); "DirectoryNext");
g_object_set (action, "is_important", TRUE, "short_label", g_object_set (action, "is_important", TRUE, "short_label",
_("Previous location"), NULL); _("Previous location"), NULL);
#if GTK_CHECK_VERSION (2, 16, 0)
gtk_activatable_set_related_action (GTK_ACTIVATABLE (widget), action);
#else
gtk_action_connect_proxy (action, widget); gtk_action_connect_proxy (action, widget);
#endif
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget), 1); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget), 1);
gtk_box_pack_start (GTK_BOX (obj), toolbar, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (obj), toolbar, FALSE, FALSE, 0);