summaryrefslogtreecommitdiff
path: root/src/file-manager
diff options
context:
space:
mode:
authormonsta <[email protected]>2018-01-29 17:28:30 +0300
committerraveit65 <[email protected]>2018-01-31 11:47:27 +0100
commit26a21fa2cb70a13b7e96ae43d4de825ad7663dc9 (patch)
treed61f2df112ee55e68de510d5c95b2531ba1fa922 /src/file-manager
parent0045e373ee71efb8ae9979adc4ef88d5dc90b2ea (diff)
downloadcaja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.bz2
caja-26a21fa2cb70a13b7e96ae43d4de825ad7663dc9.tar.xz
require GTK+ 3.22 and GLib 2.50
Diffstat (limited to 'src/file-manager')
-rw-r--r--src/file-manager/fm-desktop-icon-view.c42
-rw-r--r--src/file-manager/fm-directory-view.c16
-rw-r--r--src/file-manager/fm-ditem-page.c4
-rw-r--r--src/file-manager/fm-icon-view.c8
-rw-r--r--src/file-manager/fm-list-view.c4
-rw-r--r--src/file-manager/fm-properties-window.c17
-rw-r--r--src/file-manager/fm-tree-view.c2
7 files changed, 7 insertions, 86 deletions
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));