diff options
author | Stefano Karapetsas <[email protected]> | 2013-11-20 03:54:01 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-11-20 03:54:01 -0800 |
commit | 0e4df16ea5762fb11aac4cece97aa5210ccb6f0f (patch) | |
tree | 6bb18ba82419c259f1eec4bf6c1c3676a872992e /src | |
parent | 36aefd0601529725931abbf7280684c1efdc3f34 (diff) | |
parent | 8d284101a0ee5714a198424926612a163c3c691f (diff) | |
download | engrampa-0e4df16ea5762fb11aac4cece97aa5210ccb6f0f.tar.bz2 engrampa-0e4df16ea5762fb11aac4cece97aa5210ccb6f0f.tar.xz |
Merge pull request #35 from eyelash/gtk3
add GTK3 support
Diffstat (limited to 'src')
-rw-r--r-- | src/dlg-batch-add.c | 11 | ||||
-rw-r--r-- | src/fr-window.c | 45 | ||||
-rw-r--r-- | src/gtk-utils.c | 8 |
3 files changed, 42 insertions, 22 deletions
diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c index 28dbc01..e9d00a9 100644 --- a/src/dlg-batch-add.c +++ b/src/dlg-batch-add.c @@ -555,7 +555,11 @@ dlg_batch_add_files (FrWindow *window, /* archive type combobox */ +#if GTK_CHECK_VERSION(2,24,0) + data->a_archive_type_combo_box = gtk_combo_box_text_new (); +#else data->a_archive_type_combo_box = gtk_combo_box_new_text (); +#endif if (data->single_file) data->supported_types = single_file_save_type; else @@ -563,8 +567,11 @@ dlg_batch_add_files (FrWindow *window, sort_mime_types_by_extension (data->supported_types); for (i = 0; data->supported_types[i] != -1; i++) - gtk_combo_box_append_text (GTK_COMBO_BOX (data->a_archive_type_combo_box), - mime_type_desc[data->supported_types[i]].default_ext); +#if GTK_CHECK_VERSION(2,24,0) + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (data->a_archive_type_combo_box), mime_type_desc[data->supported_types[i]].default_ext); +#else + gtk_combo_box_append_text (GTK_COMBO_BOX (data->a_archive_type_combo_box), mime_type_desc[data->supported_types[i]].default_ext); +#endif gtk_box_pack_start (GTK_BOX (a_archive_type_box), data->a_archive_type_combo_box, TRUE, TRUE, 0); gtk_widget_show_all (a_archive_type_box); diff --git a/src/fr-window.c b/src/fr-window.c index d986b9c..b488b88 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -1919,15 +1919,14 @@ fr_window_update_file_list (FrWindow *window, } else { gtk_widget_set_sensitive (window->priv->list_view, FALSE); - gtk_widget_hide_all (gtk_widget_get_parent (window->priv->list_view)); + gtk_widget_hide (gtk_widget_get_parent (window->priv->list_view)); } return; } else { gtk_widget_set_sensitive (window->priv->list_view, TRUE); - if (! gtk_widget_get_visible (window->priv->list_view)) - gtk_widget_show_all (gtk_widget_get_parent (window->priv->list_view)); + gtk_widget_show_all (gtk_widget_get_parent (window->priv->list_view)); } if (window->priv->give_focus_to_the_list) { @@ -2159,9 +2158,9 @@ location_entry_key_press_event_cb (GtkWidget *widget, GdkEventKey *event, FrWindow *window) { - if ((event->keyval == GDK_Return) - || (event->keyval == GDK_KP_Enter) - || (event->keyval == GDK_ISO_Enter)) + if ((event->keyval == GDK_KEY_Return) + || (event->keyval == GDK_KEY_KP_Enter) + || (event->keyval == GDK_KEY_ISO_Enter)) { fr_window_go_to_location (window, gtk_entry_get_text (GTK_ENTRY (window->priv->location_entry)), FALSE); } @@ -2512,7 +2511,9 @@ create_the_progress_dialog (FrWindow *window) window->priv->pd_cancel_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); d = GTK_DIALOG (window->priv->progress_dialog); +#if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (d, FALSE); +#endif gtk_window_set_resizable (GTK_WINDOW (d), TRUE); gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK); gtk_window_set_default_size (GTK_WINDOW (d), PROGRESS_DIALOG_DEFAULT_WIDTH, -1); @@ -4474,7 +4475,7 @@ key_press_cb (GtkWidget *widget, if (gtk_widget_has_focus (window->priv->filter_entry)) { switch (event->keyval) { - case GDK_Escape: + case GDK_KEY_Escape: fr_window_deactivate_filter (window); retval = TRUE; break; @@ -4487,14 +4488,14 @@ key_press_cb (GtkWidget *widget, alt = (event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK; switch (event->keyval) { - case GDK_Escape: + case GDK_KEY_Escape: activate_action_stop (NULL, window); if (window->priv->filter_mode) fr_window_deactivate_filter (window); retval = TRUE; break; - case GDK_F10: + case GDK_KEY_F10: if (event->state & GDK_SHIFT_MASK) { GtkTreeSelection *selection; @@ -4511,37 +4512,37 @@ key_press_cb (GtkWidget *widget, } break; - case GDK_Up: - case GDK_KP_Up: + case GDK_KEY_Up: + case GDK_KEY_KP_Up: if (alt) { fr_window_go_up_one_level (window); retval = TRUE; } break; - case GDK_BackSpace: + case GDK_KEY_BackSpace: fr_window_go_up_one_level (window); retval = TRUE; break; - case GDK_Right: - case GDK_KP_Right: + case GDK_KEY_Right: + case GDK_KEY_KP_Right: if (alt) { fr_window_go_forward (window); retval = TRUE; } break; - case GDK_Left: - case GDK_KP_Left: + case GDK_KEY_Left: + case GDK_KEY_KP_Left: if (alt) { fr_window_go_back (window); retval = TRUE; } break; - case GDK_Home: - case GDK_KP_Home: + case GDK_KEY_Home: + case GDK_KEY_KP_Home: if (alt) { fr_window_go_to_location (window, "/", FALSE); retval = TRUE; @@ -5809,7 +5810,7 @@ fr_window_construct (FrWindow *window) /* Add a hidden short cut Ctrl-Q for power users */ gtk_accel_group_connect (gtk_ui_manager_get_accel_group (ui), - GDK_q, GDK_CONTROL_MASK, 0, + GDK_KEY_q, GDK_CONTROL_MASK, 0, g_cclosure_new_swap (G_CALLBACK (fr_window_close), window, NULL)); @@ -5824,6 +5825,9 @@ fr_window_construct (FrWindow *window) window->priv->toolbar = toolbar = gtk_ui_manager_get_widget (ui, "/ToolBar"); gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE); +#if GTK_CHECK_VERSION(3,0,0) + gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR); +#endif set_action_important (ui, "/ToolBar/Extract_Toolbar"); /* location bar */ @@ -5952,7 +5956,6 @@ fr_window_construct (FrWindow *window) gtk_widget_show (vbox); } gtk_widget_show (statusbar_box); - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->priv->statusbar), TRUE); fr_window_attach (FR_WINDOW (window), window->priv->statusbar, FR_WINDOW_AREA_STATUSBAR); if (g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_STATUSBAR)) @@ -7085,7 +7088,9 @@ fr_window_view_last_output (FrWindow *window, gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); +#if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); +#endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 6); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 8); diff --git a/src/gtk-utils.c b/src/gtk-utils.c index 5e7fff4..3c55ffe 100644 --- a/src/gtk-utils.c +++ b/src/gtk-utils.c @@ -78,7 +78,9 @@ _gtk_message_dialog_new (GtkWindow *parent, content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); +#if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); +#endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); gtk_container_set_border_width (GTK_CONTAINER (content_area), 6); gtk_box_set_spacing (GTK_BOX (content_area), 8); @@ -214,7 +216,9 @@ _gtk_request_dialog_run (GtkWindow *parent, content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); +#if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); +#endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); gtk_container_set_border_width (GTK_CONTAINER (content_area), 6); gtk_box_set_spacing (GTK_BOX (content_area), 8); @@ -306,7 +310,9 @@ _gtk_yesno_dialog_new (GtkWindow *parent, content_area = gtk_dialog_get_content_area (GTK_DIALOG (d)); +#if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (d), FALSE); +#endif gtk_container_set_border_width (GTK_CONTAINER (d), 6); gtk_container_set_border_width (GTK_CONTAINER (content_area), 6); gtk_box_set_spacing (GTK_BOX (content_area), 8); @@ -394,7 +400,9 @@ _gtk_error_dialog_new (GtkWindow *parent, content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); +#if !GTK_CHECK_VERSION(2,22,0) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); +#endif gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); gtk_container_set_border_width (GTK_CONTAINER (content_area), 6); gtk_box_set_spacing (GTK_BOX (content_area), 8); |