diff options
author | monsta <[email protected]> | 2018-01-29 17:28:30 +0300 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-01-31 11:47:27 +0100 |
commit | 26a21fa2cb70a13b7e96ae43d4de825ad7663dc9 (patch) | |
tree | d61f2df112ee55e68de510d5c95b2531ba1fa922 /src | |
parent | 0045e373ee71efb8ae9979adc4ef88d5dc90b2ea (diff) | |
download | caja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.bz2 caja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.xz |
require GTK+ 3.22 and GLib 2.50
Diffstat (limited to 'src')
28 files changed, 14 insertions, 268 deletions
diff --git a/src/caja-application.c b/src/caja-application.c index 3f558901..77a323a6 100644 --- a/src/caja-application.c +++ b/src/caja-application.c @@ -2208,11 +2208,7 @@ init_icons_and_styles (void) /* add our desktop CSS provider, ensures the desktop background does not get covered */ provider = gtk_css_provider_new (); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja-desktop.css", &error); -#else - gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja-desktop-3.14.css", &error); -#endif if (error != NULL) { g_warning ("Can't parse Caja' CSS custom description: %s\n", error->message); diff --git a/src/caja-bookmarks-window.c b/src/caja-bookmarks-window.c index 0c122dad..60254cfd 100644 --- a/src/caja-bookmarks-window.c +++ b/src/caja-bookmarks-window.c @@ -144,15 +144,9 @@ caja_bookmarks_window_response_callback (GtkDialog *dialog, { GError *error = NULL; -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (dialog), "help:mate-user-guide/goscaja-36", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)), - "help:mate-user-guide/goscaja-36", - gtk_get_current_event_time (), &error); -#endif if (error) { diff --git a/src/caja-connect-server-dialog.c b/src/caja-connect-server-dialog.c index 05e6875f..13fc3c58 100644 --- a/src/caja-connect-server-dialog.c +++ b/src/caja-connect-server-dialog.c @@ -710,15 +710,9 @@ connect_dialog_response_cb (CajaConnectServerDialog *dialog, break; case GTK_RESPONSE_HELP : error = NULL; -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (dialog), "help:mate-user-guide/caja-server-connect", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)), - "help:mate-user-guide/caja-server-connect", - gtk_get_current_event_time (), &error); -#endif if (error) { eel_show_error_dialog (_("There was an error displaying help."), error->message, @@ -880,11 +874,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) str = g_strdup_printf ("<b>%s</b>", _("Server Details")); gtk_label_set_markup (GTK_LABEL (label), str); g_free (str); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 6); gtk_widget_show (label); @@ -902,11 +892,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* first row: server entry + port spinbutton */ label = gtk_label_new_with_mnemonic (_("_Server:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); gtk_widget_show (label); @@ -924,11 +910,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* port */ label = gtk_label_new_with_mnemonic (_("_Port:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); @@ -946,11 +928,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* second row: type combobox */ label = gtk_label_new (_("Type:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); gtk_widget_show (label); @@ -1023,11 +1001,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* third row: share entry */ label = gtk_label_new (_("Share:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); dialog->details->share_entry = gtk_entry_new (); @@ -1039,11 +1013,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* fourth row: folder entry */ label = gtk_label_new (_("Folder:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); gtk_widget_show (label); dialog->details->folder_entry = gtk_entry_new (); @@ -1058,11 +1028,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) str = g_strdup_printf ("<b>%s</b>", _("User Details")); gtk_label_set_markup (GTK_LABEL (label), str); g_free (str); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 6); grid = gtk_grid_new (); @@ -1080,11 +1046,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* first row: domain entry */ label = gtk_label_new (_("Domain Name:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); dialog->details->domain_entry = gtk_entry_new (); @@ -1096,11 +1058,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* second row: username entry */ label = gtk_label_new (_("User Name:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); dialog->details->user_entry = gtk_entry_new (); @@ -1112,11 +1070,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog) /* third row: password entry */ label = gtk_label_new (_("Password:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); dialog->details->password_entry = gtk_entry_new (); diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c index a0a71a27..aae03b5e 100644 --- a/src/caja-desktop-window.c +++ b/src/caja-desktop-window.c @@ -144,9 +144,8 @@ caja_desktop_window_new (CajaApplication *application, /* Stop wrong desktop window size in GTK 3.20*/ /* We don't want to set a default size, which the parent does, since this */ /* will cause the desktop window to open at the wrong size in gtk 3.20 */ -#if GTK_CHECK_VERSION (3, 20, 0) gtk_window_set_default_size (GTK_WINDOW (window), -1, -1); -#endif + /* Special sawmill setting*/ gtk_window_set_wmclass (GTK_WINDOW (window), "desktop_window", "Caja"); @@ -250,7 +249,6 @@ realize (GtkWidget *widget) G_CALLBACK (caja_desktop_window_screen_size_changed), window); } -#if GTK_CHECK_VERSION (3, 22, 0) static gboolean draw (GtkWidget *widget, cairo_t *cr) @@ -259,7 +257,6 @@ draw (GtkWidget *widget, return GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->draw (widget, cr); } -#endif static char * real_get_title (CajaWindow *window) @@ -283,9 +280,8 @@ caja_desktop_window_class_init (CajaDesktopWindowClass *klass) wclass->realize = realize; wclass->unrealize = unrealize; wclass->map = map; -#if GTK_CHECK_VERSION (3, 22, 0) wclass->draw = draw; -#endif + nclass->window_type = CAJA_WINDOW_DESKTOP; nclass->get_title = real_get_title; nclass->get_icon = real_get_icon; diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c index 670483e6..7800c7a4 100644 --- a/src/caja-file-management-properties.c +++ b/src/caja-file-management-properties.c @@ -222,15 +222,9 @@ preferences_show_help (GtkWindow *parent, help_string = g_strdup_printf ("help:%s/%s", helpfile, sect_id); -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (parent, help_string, gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_window_get_screen (parent), - help_string, gtk_get_current_event_time (), - &error); -#endif g_free (help_string); if (error) diff --git a/src/caja-history-sidebar.c b/src/caja-history-sidebar.c index c7a5b9ff..de4e71dc 100644 --- a/src/caja-history-sidebar.c +++ b/src/caja-history-sidebar.c @@ -275,9 +275,8 @@ caja_history_sidebar_init (CajaHistorySidebar *sidebar) gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL); gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sidebar), GTK_SHADOW_IN); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (sidebar), FALSE); -#endif + gtk_container_add (GTK_CONTAINER (sidebar), GTK_WIDGET (tree_view)); gtk_widget_show (GTK_WIDGET (sidebar)); diff --git a/src/caja-image-properties-page.c b/src/caja-image-properties-page.c index 12c79e38..465145df 100644 --- a/src/caja-image-properties-page.c +++ b/src/caja-image-properties-page.c @@ -141,12 +141,8 @@ append_label (GtkWidget *vbox, label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), str); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); gtk_label_set_yalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); -#endif gtk_label_set_selectable (GTK_LABEL (label), TRUE); /* setting can_focus to FALSE will allow to make the label diff --git a/src/caja-location-bar.c b/src/caja-location-bar.c index 17bdd989..ad9c423e 100644 --- a/src/caja-location-bar.c +++ b/src/caja-location-bar.c @@ -492,12 +492,8 @@ caja_location_bar_init (CajaLocationBar *bar) label = gtk_label_new (LOCATION_LABEL); gtk_container_add (GTK_CONTAINER (event_box), label); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 1.0); gtk_label_set_yalign (GTK_LABEL (label), 0.5); -#else - gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); -#endif g_signal_connect (label, "style_set", G_CALLBACK (style_set_handler), NULL); diff --git a/src/caja-location-dialog.c b/src/caja-location-dialog.c index 43503b1b..1e9a0b38 100644 --- a/src/caja-location-dialog.c +++ b/src/caja-location-dialog.c @@ -94,15 +94,9 @@ response_callback (CajaLocationDialog *dialog, break; case GTK_RESPONSE_HELP : error = NULL; -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (dialog), "help:mate-user-guide/caja-open-location", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)), - "help:mate-user-guide/caja-open-location", - gtk_get_current_event_time (), &error); -#endif if (error) { eel_show_error_dialog (_("There was an error displaying help."), error->message, diff --git a/src/caja-main.c b/src/caja-main.c index ea299302..c74e43b0 100644 --- a/src/caja-main.c +++ b/src/caja-main.c @@ -250,11 +250,6 @@ main (int argc, char *argv[]) mallopt (M_MMAP_THRESHOLD, 128 *1024); #endif -#if !GLIB_CHECK_VERSION (2, 42, 0) - /* This will be done by gtk+ later, but for now, force it to MATE */ - g_desktop_app_info_set_desktop_env ("MATE"); -#endif - if (g_getenv ("CAJA_DEBUG") != NULL) { eel_make_warnings_and_criticals_stop_in_debugger (); } diff --git a/src/caja-notebook.c b/src/caja-notebook.c index a860df2b..751e6161 100644 --- a/src/caja-notebook.c +++ b/src/caja-notebook.c @@ -306,12 +306,9 @@ build_tab_label (CajaNotebook *nb, CajaWindowSlot *slot) label = gtk_label_new (NULL); gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); gtk_label_set_yalign (GTK_LABEL (label), 0.5); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif + gtk_widget_set_margin_start (label, 0); gtk_widget_set_margin_end (label, 0); gtk_widget_set_margin_top (label, 0); @@ -325,11 +322,7 @@ build_tab_label (CajaNotebook *nb, CajaWindowSlot *slot) gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE); /* don't allow focus on the close button */ -#if GTK_CHECK_VERSION (3, 20, 0) gtk_widget_set_focus_on_click (close_button, FALSE); -#else - gtk_button_set_focus_on_click (GTK_BUTTON (close_button), FALSE); -#endif gtk_widget_set_name (close_button, "caja-tab-close-button"); diff --git a/src/caja-notes-viewer.c b/src/caja-notes-viewer.c index a825c316..b479cc56 100644 --- a/src/caja-notes-viewer.c +++ b/src/caja-notes-viewer.c @@ -347,9 +347,8 @@ caja_notes_viewer_init (CajaNotesViewer *sidebar) GTK_SHADOW_IN); gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL); gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (sidebar), FALSE); -#endif + gtk_container_add (GTK_CONTAINER (sidebar), details->note_text_field); g_signal_connect (details->note_text_field, "focus_out_event", diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index d9b776ad..863e0623 100644 --- a/src/caja-pathbar.c +++ b/src/caja-pathbar.c @@ -150,11 +150,7 @@ get_slider_button (CajaPathBar *path_bar, GtkWidget *button; button = gtk_button_new (); -#if GTK_CHECK_VERSION (3, 20, 0) gtk_widget_set_focus_on_click (button, FALSE); -#else - gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE); -#endif gtk_widget_add_events (button, GDK_SCROLL_MASK); gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name (arrow_type, GTK_ICON_SIZE_MENU)); @@ -1841,11 +1837,7 @@ make_directory_button (CajaPathBar *path_bar, button_data->button = gtk_toggle_button_new (); gtk_style_context_add_class (gtk_widget_get_style_context (button_data->button), "text-button"); -#if GTK_CHECK_VERSION (3, 20, 0) gtk_widget_set_focus_on_click (button_data->button, FALSE); -#else - gtk_button_set_focus_on_click (GTK_BUTTON (button_data->button), FALSE); -#endif gtk_widget_add_events (button_data->button, GDK_SCROLL_MASK); /* TODO update button type when xdg directories change */ diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index ba2e6c0e..9d081f6d 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -3142,9 +3142,8 @@ caja_places_sidebar_init (CajaPlacesSidebar *sidebar) gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL); gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (sidebar), NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sidebar), GTK_SHADOW_IN); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling(GTK_SCROLLED_WINDOW (sidebar), FALSE); -#endif + /* tree view */ tree_view = GTK_TREE_VIEW (gtk_tree_view_new ()); gtk_tree_view_set_headers_visible (tree_view, FALSE); diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c index a7e517c4..09233e9c 100644 --- a/src/caja-property-browser.c +++ b/src/caja-property-browser.c @@ -326,10 +326,8 @@ caja_property_browser_init (CajaPropertyBrowser *property_browser) gtk_widget_show (property_browser->details->category_container); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (property_browser->details->category_container), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (property_browser->details->category_container), FALSE); -#endif /* allocate a table to hold the category selector */ property_browser->details->category_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); @@ -1124,11 +1122,7 @@ caja_emblem_dialog_new (CajaPropertyBrowser *property_browser) /* make the keyword label and field */ widget = gtk_label_new_with_mnemonic(_("_Keyword:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (widget), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5); -#endif gtk_widget_show(widget); gtk_grid_attach(GTK_GRID(grid), widget, 0, 0, 1, 1); @@ -1147,11 +1141,7 @@ caja_emblem_dialog_new (CajaPropertyBrowser *property_browser) /* set up a file chooser to pick the image file */ label = gtk_label_new_with_mnemonic (_("_Image:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); -#endif gtk_widget_show (label); gtk_grid_attach (GTK_GRID(grid), label, 0, 1, 1, 1); @@ -1658,15 +1648,9 @@ help_button_callback (GtkWidget *widget, GtkWidget *property_browser) GError *error = NULL; GtkWidget *dialog; -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (property_browser), "help:mate-user-guide/goscaja-50", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_widget_get_screen (property_browser), - "help:mate-user-guide/goscaja-50", - gtk_get_current_event_time (), &error); -#endif if (error) { @@ -2208,10 +2192,8 @@ caja_property_browser_update_contents (CajaPropertyBrowser *property_browser) gtk_widget_show (property_browser->details->content_frame); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (property_browser->details->content_frame), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (property_browser->details->content_frame), FALSE); -#endif /* allocate a table to hold the content widgets */ property_browser->details->content_table = eel_image_table_new (TRUE); diff --git a/src/caja-query-editor.c b/src/caja-query-editor.c index d9ae2284..f151eccd 100644 --- a/src/caja-query-editor.c +++ b/src/caja-query-editor.c @@ -723,10 +723,8 @@ type_combo_changed (GtkComboBox *combo_box, CajaQueryEditorRow *row) GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (scrolled), FALSE); -#endif gtk_widget_show (scrolled); gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), scrolled, TRUE, TRUE, 6); diff --git a/src/caja-view-as-action.c b/src/caja-view-as-action.c index ab91f4dd..7baed932 100644 --- a/src/caja-view-as-action.c +++ b/src/caja-view-as-action.c @@ -180,11 +180,7 @@ connect_proxy (GtkAction *action, view_as_combo_box = gtk_combo_box_text_new (); -#if GTK_CHECK_VERSION (3, 20, 0) gtk_widget_set_focus_on_click (view_as_combo_box, FALSE); -#else - gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (view_as_combo_box), FALSE); -#endif gtk_box_pack_end (GTK_BOX (view_as_menu_vbox), view_as_combo_box, TRUE, FALSE, 0); gtk_widget_show (view_as_combo_box); g_signal_connect_object (view_as_combo_box, "changed", diff --git a/src/caja-window-menus.c b/src/caja-window-menus.c index 6e46fd5a..8eefea3e 100644 --- a/src/caja-window-menus.c +++ b/src/caja-window-menus.c @@ -575,19 +575,11 @@ action_caja_manual_callback (GtkAction *action, error = NULL; window = CAJA_WINDOW (user_data); -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (window), CAJA_IS_DESKTOP_WINDOW (window) ? "help:mate-user-guide" : "help:mate-user-guide/goscaja-1", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (window)), - CAJA_IS_DESKTOP_WINDOW (window) - ? "help:mate-user-guide" - : "help:mate-user-guide/goscaja-1", - gtk_get_current_event_time (), &error); -#endif if (error) { diff --git a/src/caja-window.c b/src/caja-window.c index 10e71b35..ac22b6d8 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -133,20 +133,11 @@ caja_window_init (CajaWindow *window) GtkWidget *menu; GtkWidget *statusbar; -#if GTK_CHECK_VERSION (3, 20, 0) static const gchar css_custom[] = "#caja-extra-view-widget {" " background-color: " EXTRA_VIEW_WIDGETS_BACKGROUND ";" "}"; -#else - static const gchar css_custom[] = - "#statusbar-no-border {" - " -GtkStatusbar-shadow-type: none;" - "}" - "#caja-extra-view-widget {" - " background-color: " EXTRA_VIEW_WIDGETS_BACKGROUND ";" - "}"; -#endif + GError *error = NULL; GtkCssProvider *provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, css_custom, -1, &error); diff --git a/src/caja-x-content-bar.c b/src/caja-x-content-bar.c index 8c834215..0e2c916d 100644 --- a/src/caja-x-content-bar.c +++ b/src/caja-x-content-bar.c @@ -307,11 +307,7 @@ caja_x_content_bar_init (CajaXContentBar *bar) gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_HORIZONTAL); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (bar->priv->label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (bar->priv->label), 0.0, 0.5); -#endif gtk_box_pack_start (GTK_BOX (bar), bar->priv->label, TRUE, TRUE, 0); bar->priv->button = gtk_button_new (); diff --git a/src/caja-zoom-control.c b/src/caja-zoom-control.c index 8f8ffdd6..c21e06e4 100644 --- a/src/caja-zoom-control.c +++ b/src/caja-zoom-control.c @@ -144,13 +144,8 @@ menu_position_under_widget (GtkMenu *menu, GtkRequisition req; GtkRequisition menu_req; GdkRectangle monitor; -#if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor_num; GdkDisplay *display; -#else - int monitor_num; - GdkScreen *screen; -#endif GtkAllocation allocation; widget = GTK_WIDGET (user_data); @@ -163,21 +158,11 @@ menu_position_under_widget (GtkMenu *menu, gtk_widget_get_preferred_size (widget, &req, NULL); gtk_widget_get_allocation (widget, &allocation); -#if GTK_CHECK_VERSION (3, 22, 0) display = gtk_widget_get_display (GTK_WIDGET (menu)); monitor_num = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (widget)); if (monitor_num == NULL) monitor_num = gdk_display_get_monitor (display, 0); gdk_monitor_get_geometry (monitor_num, &monitor); -#else - screen = gtk_widget_get_screen (GTK_WIDGET (menu)); - monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget)); - if (monitor_num < 0) - { - monitor_num = 0; - } - gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); -#endif gdk_window_get_origin (gtk_widget_get_window (widget), x, y); if (!gtk_widget_get_has_window (widget)) @@ -324,11 +309,7 @@ caja_zoom_control_init (CajaZoomControl *zoom_control) image = gtk_image_new_from_icon_name ("zoom-out", GTK_ICON_SIZE_MENU); zoom_control->details->zoom_out = gtk_button_new (); -#if GTK_CHECK_VERSION (3, 20, 0) gtk_widget_set_focus_on_click (zoom_control->details->zoom_out, FALSE); -#else - gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_out), FALSE); -#endif gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_out), GTK_RELIEF_NONE); gtk_widget_set_tooltip_text (zoom_control->details->zoom_out, @@ -344,11 +325,7 @@ caja_zoom_control_init (CajaZoomControl *zoom_control) zoom_control->details->zoom_out, FALSE, FALSE, 0); zoom_control->details->zoom_button = gtk_button_new (); -#if GTK_CHECK_VERSION (3, 20, 0) gtk_widget_set_focus_on_click (zoom_control->details->zoom_button, FALSE); -#else - gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_button), FALSE); -#endif gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_button), GTK_RELIEF_NONE); gtk_widget_set_tooltip_text (zoom_control->details->zoom_button, @@ -387,11 +364,7 @@ caja_zoom_control_init (CajaZoomControl *zoom_control) image = gtk_image_new_from_icon_name ("zoom-in", GTK_ICON_SIZE_MENU); zoom_control->details->zoom_in = gtk_button_new (); -#if GTK_CHECK_VERSION (3, 20, 0) gtk_widget_set_focus_on_click (zoom_control->details->zoom_in, FALSE); -#else - gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_in), FALSE); -#endif gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_in), GTK_RELIEF_NONE); gtk_widget_set_tooltip_text (zoom_control->details->zoom_in, diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index 26b2751f..a790d3f8 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -316,7 +316,6 @@ fm_desktop_icon_view_handle_middle_click (CajaIconContainer *icon_container, FMDesktopIconView *desktop_icon_view) { XButtonEvent x_event; -#if GTK_CHECK_VERSION (3, 20, 0) GdkDevice *keyboard = NULL, *pointer = NULL, *cur; GdkSeat *seat; @@ -346,45 +345,6 @@ fm_desktop_icon_view_handle_middle_click (CajaIconContainer *icon_container, if (keyboard != NULL) { gdk_seat_ungrab (seat); } -#else - GdkDevice *keyboard = NULL, *pointer = NULL, *cur; - GdkDeviceManager *manager; - GList *list, *l; - - manager = gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (icon_container))); - list = gdk_device_manager_list_devices (manager, GDK_DEVICE_TYPE_MASTER); - - for (l = list; l != NULL; l = l->next) { - cur = l->data; - - if (pointer == NULL && (gdk_device_get_source (cur) == GDK_SOURCE_MOUSE)) { - pointer = cur; - } - - if (keyboard == NULL && (gdk_device_get_source (cur) == GDK_SOURCE_KEYBOARD)) { - keyboard = cur; - } - - if (pointer != NULL && keyboard != NULL) { - break; - } - } - - g_list_free (list); - - /* During a mouse click we have the pointer and keyboard grab. - * We will send a fake event to the root window which will cause it - * to try to get the grab so we need to let go ourselves. - */ - - if (pointer != NULL) { - gdk_device_ungrab (pointer, GDK_CURRENT_TIME); - } - - if (keyboard != NULL) { - gdk_device_ungrab (keyboard, GDK_CURRENT_TIME); - } -#endif /* Stop the event because we don't want anyone else dealing with it. */ gdk_flush (); @@ -637,9 +597,7 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view) gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (desktop_icon_view), GTK_SHADOW_NONE); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (desktop_icon_view), FALSE); -#endif fm_directory_view_ignore_hidden_file_preferences (FM_DIRECTORY_VIEW (desktop_icon_view)); diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 82d1f234..75e42397 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -1170,15 +1170,9 @@ pattern_select_response_cb (GtkWidget *dialog, int response, gpointer user_data) break; case GTK_RESPONSE_HELP : error = NULL; -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (dialog), "help:mate-user-guide/caja-select-pattern", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)), - "help:mate-user-guide/caja-select-pattern", - gtk_get_current_event_time (), &error); -#endif if (error) { eel_show_error_dialog (_("There was an error displaying help."), error->message, GTK_WINDOW (dialog)); @@ -1362,11 +1356,7 @@ action_save_search_as_callback (GtkAction *action, gtk_widget_show (grid); label = gtk_label_new_with_mnemonic (_("Search _name:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); gtk_widget_show (label); entry = gtk_entry_new (); @@ -1382,11 +1372,7 @@ action_save_search_as_callback (GtkAction *action, gtk_widget_show (entry); label = gtk_label_new_with_mnemonic (_("_Folder:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.5); -#endif gtk_container_add (GTK_CONTAINER (grid), label); gtk_widget_show (label); @@ -2006,9 +1992,7 @@ fm_directory_view_init (FMDirectoryView *view) gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (view), NULL); gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (view), NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_ETCHED_IN); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (view), FALSE); -#endif set_up_scripts_directory_global (); scripts_directory = caja_directory_get_by_uri (scripts_directory_uri); diff --git a/src/file-manager/fm-ditem-page.c b/src/file-manager/fm-ditem-page.c index 08f87b20..cdcf4fd0 100644 --- a/src/file-manager/fm-ditem-page.c +++ b/src/file-manager/fm-ditem-page.c @@ -341,11 +341,7 @@ build_grid (GtkWidget *container, label = gtk_label_new (label_text); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); g_free (label_text); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_size_group_add_widget (label_size_group, label); entry = gtk_entry_new (); diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index 4b416187..aadb3463 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -3318,9 +3318,9 @@ fm_icon_view_create (CajaWindowSlotInfo *slot) "window-slot", slot, "compact", FALSE, NULL); -#if GTK_CHECK_VERSION (3, 20, 0) + gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (view)), GTK_STYLE_CLASS_VIEW); -#endif + return CAJA_VIEW (view); } @@ -3333,9 +3333,9 @@ fm_compact_view_create (CajaWindowSlotInfo *slot) "window-slot", slot, "compact", TRUE, NULL); -#if GTK_CHECK_VERSION (3, 20, 0) + gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (view)), GTK_STYLE_CLASS_VIEW); -#endif + return CAJA_VIEW (view); } diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index 12fa8e5b..32d965a1 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -2552,12 +2552,8 @@ create_column_editor (FMListView *view) label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), str); gtk_label_set_line_wrap (GTK_LABEL (label), FALSE); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0); gtk_label_set_yalign (GTK_LABEL (label), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0, 0); -#endif gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0); diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 1ae66b62..7bfa219b 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -1372,11 +1372,7 @@ attach_label (GtkGrid *grid, gtk_label_set_selectable (GTK_LABEL (label_field), TRUE); } -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label_field), 0); -#else - gtk_misc_set_alignment (GTK_MISC (label_field), 0, 0.5); -#endif gtk_widget_show (label_field); if (ellipsize_text) { gtk_widget_set_hexpand (label_field, TRUE); @@ -3421,10 +3417,10 @@ create_emblems_page (FMPropertiesWindow *window) scroller = eel_scrolled_wrap_table_new (TRUE, GTK_SHADOW_NONE, &emblems_table); gtk_container_set_border_width (GTK_CONTAINER (emblems_table), 12); -/*stop GTK 3.22 builds from ballooning the properties dialog to full screen height */ -#if GTK_CHECK_VERSION (3, 22, 0) + + /* stop GTK 3.22 builds from ballooning the properties dialog to full screen height */ gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (scroller), 300); -#endif + gtk_widget_show (scroller); gtk_notebook_append_page (window->details->notebook, @@ -5405,17 +5401,10 @@ real_response (GtkDialog *dialog, switch (response) { case GTK_RESPONSE_HELP: -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (dialog), "help:mate-user-guide/goscaja-51", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)), - "help:mate-user-guide/goscaja-51", - gtk_get_current_event_time (), - &error); -#endif if (error != NULL) { eel_show_error_dialog (_("There was an error displaying help."), error->message, GTK_WINDOW (dialog)); diff --git a/src/file-manager/fm-tree-view.c b/src/file-manager/fm-tree-view.c index ea42c420..643ae185 100644 --- a/src/file-manager/fm-tree-view.c +++ b/src/file-manager/fm-tree-view.c @@ -1591,9 +1591,7 @@ fm_tree_view_init (FMTreeView *view) gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (view), NULL); gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (view), NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_IN); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (view), FALSE); -#endif gtk_widget_show (GTK_WIDGET (view)); |