[nautilus/wip/ernestask/long-live-the-desktop: 2/5] general: remove desktop support
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/ernestask/long-live-the-desktop: 2/5] general: remove desktop support
- Date: Wed, 13 Dec 2017 18:20:20 +0000 (UTC)
commit 639110e8edc46e8387122392349c113aa12080aa
Author: Ernestas Kulik <ernestask gnome org>
Date: Tue Dec 12 16:56:29 2017 +0200
general: remove desktop support
build-aux/flatpak/org.gnome.Nautilus.json | 1 -
config.h.meson | 1 -
data/.gitignore | 2 -
data/meson.build | 24 -
data/nautilus-autostart.desktop.in | 7 -
data/nautilus-classic.desktop.in | 11 -
data/org.gnome.nautilus.gschema.xml | 56 +-
data/run-uncrustify.sh | 2 +-
docs/nautilus.1 | 7 +-
meson.build | 8 -
meson_options.txt | 3 -
nautilus-desktop/.gitignore | 1 -
nautilus-desktop/main-desktop.c | 49 --
nautilus-desktop/meson.build | 30 -
nautilus-desktop/nautilus-desktop-application.c | 280 -------
nautilus-desktop/nautilus-desktop-application.h | 36 -
.../nautilus-desktop-canvas-view-container.c | 215 -----
.../nautilus-desktop-canvas-view-container.h | 35 -
nautilus-desktop/nautilus-desktop-canvas-view.c | 794 ------------------
nautilus-desktop/nautilus-desktop-canvas-view.h | 54 --
nautilus-desktop/nautilus-desktop-directory-file.c | 568 -------------
nautilus-desktop/nautilus-desktop-directory-file.h | 53 --
nautilus-desktop/nautilus-desktop-directory.c | 588 --------------
nautilus-desktop/nautilus-desktop-directory.h | 58 --
nautilus-desktop/nautilus-desktop-icon-file.c | 550 -------------
nautilus-desktop/nautilus-desktop-icon-file.h | 60 --
nautilus-desktop/nautilus-desktop-link-monitor.c | 460 -----------
nautilus-desktop/nautilus-desktop-link-monitor.h | 60 --
nautilus-desktop/nautilus-desktop-link.c | 482 -----------
nautilus-desktop/nautilus-desktop-link.h | 77 --
nautilus-desktop/nautilus-desktop-metadata.c | 90 ---
nautilus-desktop/nautilus-desktop-metadata.h | 43 -
nautilus-desktop/nautilus-desktop-window-slot.c | 69 --
nautilus-desktop/nautilus-desktop-window-slot.h | 36 -
nautilus-desktop/nautilus-desktop-window.c | 533 ------------
nautilus-desktop/nautilus-desktop-window.h | 59 --
po/POTFILES.in | 6 -
src/meson.build | 11 +-
src/nautilus-application.c | 4 +-
src/nautilus-bookmark.c | 3 +-
src/nautilus-canvas-container.c | 889 +--------------------
src/nautilus-canvas-container.h | 15 +-
src/nautilus-canvas-dnd.c | 21 +-
src/nautilus-canvas-private.h | 12 -
src/nautilus-canvas-view.c | 311 +------
src/nautilus-desktop-item-properties.c | 563 -------------
src/nautilus-desktop-item-properties.h | 46 --
src/nautilus-global-preferences.c | 2 -
src/nautilus-global-preferences.h | 14 -
src/nautilus-icon-names.h | 7 -
src/nautilus-metadata.c | 2 -
src/nautilus-metadata.h | 3 -
src/nautilus-properties-window.c | 17 -
src/resources/css/Adwaita.css | 23 -
src/resources/css/nautilus.css | 7 -
.../ui/nautilus-files-view-context-menus.ui | 5 -
56 files changed, 73 insertions(+), 7290 deletions(-)
---
diff --git a/build-aux/flatpak/org.gnome.Nautilus.json b/build-aux/flatpak/org.gnome.Nautilus.json
index 87b2792d1..03b667658 100644
--- a/build-aux/flatpak/org.gnome.Nautilus.json
+++ b/build-aux/flatpak/org.gnome.Nautilus.json
@@ -84,7 +84,6 @@
"builddir": true,
"name": "nautilus",
"config-opts": [
- "-Denable-desktop=false",
"-Denable-selinux=false",
"--libdir=/app/lib"
],
diff --git a/config.h.meson b/config.h.meson
index ad2817675..8dbcaef67 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -4,7 +4,6 @@
#mesondefine HAVE_EXEMPI
#mesondefine HAVE_SELINUX
#mesondefine HAVE_X11_XF86KEYSYM_H
-#mesondefine ENABLE_DESKTOP
#mesondefine ENABLE_PACKAGEKIT
#mesondefine LOCALEDIR
#mesondefine NAUTILUS_DATADIR
diff --git a/data/.gitignore b/data/.gitignore
index fe14726f1..89808d77c 100644
--- a/data/.gitignore
+++ b/data/.gitignore
@@ -1,7 +1,5 @@
/lineup-parameters
/nautilus-autorun-software.desktop
-/nautilus-autostart.desktop
-/nautilus-classic.desktop
/org.freedesktop.FileManager1.service
/org.gnome.Nautilus.appdata.xml
/org.gnome.Nautilus.desktop
diff --git a/data/meson.build b/data/meson.build
index a67999761..e185428f4 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -22,24 +22,6 @@ desktop_autorun_software = i18n.merge_file ('desktop-autorun-software',
po_dir: po_dir,
type: 'desktop')
-desktop_autostart = i18n.merge_file ('desktop-autostart',
- input: 'nautilus-autostart.desktop.in',
- output: 'nautilus-autostart.desktop',
- install: true,
- install_dir: join_paths (sysconfdir, 'xdg', 'autostart'),
- po_dir: po_dir,
- type: 'desktop')
-
-if get_option ('enable-desktop')
- desktop_classic = i18n.merge_file ('desktop-classic',
- input: 'nautilus-classic.desktop.in',
- output: 'nautilus-classic.desktop',
- install: true,
- install_dir: desktopdir,
- po_dir: po_dir,
- type: 'desktop')
-endif
-
appdata = i18n.merge_file ('appdata',
input: 'org.gnome.Nautilus.appdata.xml.in',
output: 'org.gnome.Nautilus.appdata.xml',
@@ -72,12 +54,6 @@ if desktop_file_validate.found ()
args: [desktop.full_path ()])
test ('validate-desktop-autorun-software', desktop_file_validate,
args: [desktop_autorun_software.full_path ()])
- test ('validate-desktop-autostart', desktop_file_validate,
- args: [desktop_autostart.full_path ()])
- if get_option ('enable-desktop')
- test ('validate-desktop-classic', desktop_file_validate,
- args: [desktop_classic.full_path ()])
- endif
endif
appstream_util = find_program ('appstream-util', required: false)
diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml
index 4cbb7647b..d4ca8f2a3 100644
--- a/data/org.gnome.nautilus.gschema.xml
+++ b/data/org.gnome.nautilus.gschema.xml
@@ -68,7 +68,6 @@
<child schema="org.gnome.nautilus.compression" name="compression"/>
<child schema="org.gnome.nautilus.icon-view" name="icon-view"/>
<child schema="org.gnome.nautilus.list-view" name="list-view"/>
- <child schema="org.gnome.nautilus.desktop" name="desktop"/>
<child schema="org.gnome.nautilus.window-state" name="window-state"/>
</schema>
@@ -231,7 +230,7 @@
<key type="as" name="captions">
<default>[ 'none', 'none', 'none' ]</default>
<summary>List of possible captions on icons</summary>
- <description>A list of captions below an icon in the icon view and the desktop. The actual number of
captions shown depends on the zoom level. Some possible values are: “size”, “type”, “date_modified”, “owner”,
“group”, “permissions”, and “mime_type”.</description>
+ <description>A list of captions below an icon in the icon view. The actual number of captions shown
depends on the zoom level. Some possible values are: “size”, “type”, “date_modified”, “owner”, “group”,
“permissions”, and “mime_type”.</description>
</key>
<key name="default-zoom-level" enum="org.gnome.nautilus.CanvasZoomLevel">
<default>'large'</default>
@@ -269,59 +268,6 @@
</key>
</schema>
- <schema path="/org/gnome/nautilus/desktop/" id="org.gnome.nautilus.desktop" gettext-domain="nautilus">
- <key type="s" name="font">
- <default l10n="messages" context="desktop-font">''</default>
- <summary>Desktop font</summary>
- <description>The font description used for the icons on the desktop.</description>
- </key>
- <key type="b" name="home-icon-visible">
- <default>true</default>
- <summary>Home icon visible on desktop</summary>
- <description>If this is set to true, an icon linking to the home folder will be put on the
desktop.</description>
- </key>
- <key type="b" name="trash-icon-visible">
- <default>true</default>
- <summary>Trash icon visible on desktop</summary>
- <description>If this is set to true, an icon linking to the Trash will be put on the
desktop.</description>
- </key>
- <key type="b" name="volumes-visible">
- <default>true</default>
- <summary>Show mounted volumes on the desktop</summary>
- <description>If this is set to true, icons linking to mounted volumes will be put on the
desktop.</description>
- </key>
- <key type="b" name="network-icon-visible">
- <default>false</default>
- <summary>Network Servers icon visible on the desktop</summary>
- <description>If this is set to true, an icon linking to the Network Servers view will be put on the
desktop.</description>
- </key>
- <key type="s" name="home-icon-name">
- <default l10n="messages" context="home-icon-name">'Home'</default>
- <summary>Desktop home icon name</summary>
- <description>This name can be set if you want a custom name for the home icon on the
desktop.</description>
- </key>
- <key type="s" name="trash-icon-name">
- <default l10n="messages" context="trash-icon-name">'Trash'</default>
- <summary>Desktop Trash icon name</summary>
- <description>This name can be set if you want a custom name for the Trash icon on the
desktop.</description>
- </key>
- <key type="s" name="network-icon-name">
- <default l10n="messages" context="network-icon-name">'Network Servers'</default>
- <summary>Network servers icon name</summary>
- <description>This name can be set if you want a custom name for the network servers icon on the
desktop.</description>
- </key>
- <key type="i" name="text-ellipsis-limit">
- <default>3</default>
- <summary>Text Ellipsis Limit</summary>
- <description>An integer specifying how parts of overlong file names should be replaced by ellipses on
the desktop. If the number is larger than 0, the file name will not exceed the given number of lines. If the
number is 0 or smaller, no limit is imposed on the number of displayed lines.</description>
- </key>
- <key type="b" name="background-fade">
- <default>true</default>
- <summary>Fade the background on change</summary>
- <description>If set to true, then Nautilus will use a fade effect to change the desktop
background.</description>
- </key>
- </schema>
-
<schema path="/org/gnome/nautilus/window-state/" id="org.gnome.nautilus.window-state"
gettext-domain="nautilus">
<key type="s" name="geometry">
<default>''</default>
diff --git a/data/run-uncrustify.sh b/data/run-uncrustify.sh
index 39bb29006..4f98b5db2 100755
--- a/data/run-uncrustify.sh
+++ b/data/run-uncrustify.sh
@@ -2,7 +2,7 @@
DATA=$(dirname "$BASH_SOURCE")
if [ -x "$DATA/lineup-parameters" ];
then
- for DIR in "$DATA/../"{src,nautilus-desktop,test,libnautilus-extension,eel,nautilus-sendto-extension}
+ for DIR in "$DATA/../"{src,test,libnautilus-extension,eel,nautilus-sendto-extension}
do
for FILE in $(find "$DIR" -name "*.c")
do
diff --git a/docs/nautilus.1 b/docs/nautilus.1
index f274f5836..70304a1d2 100644
--- a/docs/nautilus.1
+++ b/docs/nautilus.1
@@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH Nautilus 1 "23 September 2016"
+.TH Nautilus 1 "12 December 2017"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -51,11 +51,6 @@ Always open a new window for browsing specified URIs.
Only create windows for explicitly specified URIs.
.TP
-.B \-\-no-desktop
-Never manage the desktop (ignore the GSettings preference). \fBDeprecated\fR - the
-desktop is managed in a separate binary.
-
-.TP
.BR \-q ", " \-\-quit
Quit Nautilus.
diff --git a/meson.build b/meson.build
index 576edbe35..d89f1405d 100644
--- a/meson.build
+++ b/meson.build
@@ -63,10 +63,6 @@ conf.set_quoted ('LOCALEDIR', join_paths (prefix, localedir))
conf.set_quoted ('NAUTILUS_DATADIR', join_paths (datadir, 'nautilus'))
conf.set_quoted ('NAUTILUS_EXTENSIONDIR', join_paths (prefix, extensiondir))
-if get_option ('enable-desktop')
- conf.set10 ('ENABLE_DESKTOP', true)
-endif
-
if get_option ('enable-packagekit')
conf.set10 ('ENABLE_PACKAGEKIT', true)
endif
@@ -110,10 +106,6 @@ if get_option ('enable-gtk-doc')
subdir ('docs')
endif
-if get_option ('enable-desktop')
- subdir ('nautilus-desktop')
-endif
-
if get_option ('enable-nst-extension')
subdir ('nautilus-sendto-extension')
endif
diff --git a/meson_options.txt b/meson_options.txt
index 783061463..21bc5db45 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,9 +7,6 @@ option ('enable-nst-extension',
option ('enable-selinux',
type: 'boolean',
value: true)
-option ('enable-desktop',
- type: 'boolean',
- value: true)
option ('enable-packagekit',
type: 'boolean',
value: true)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1da446029..70a535ab4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -13,11 +13,6 @@ eel/eel-vfs-extensions.c
libnautilus-extension/nautilus-column.c
libnautilus-extension/nautilus-menu-item.c
libnautilus-extension/nautilus-property-page.c
-nautilus-desktop/nautilus-desktop-application.c
-nautilus-desktop/nautilus-desktop-directory-file.c
-nautilus-desktop/nautilus-desktop-icon-file.c
-nautilus-desktop/nautilus-desktop-link.c
-nautilus-desktop/nautilus-desktop-window.c
nautilus-sendto-extension/nautilus-nste.c
src/nautilus-application.c
src/nautilus-autorun-software.c
@@ -33,7 +28,6 @@ src/nautilus-clipboard.c
src/nautilus-column-chooser.c
src/nautilus-column-utilities.c
src/nautilus-compress-dialog-controller.c
-src/nautilus-desktop-item-properties.c
src/nautilus-directory.c
src/nautilus-dnd.c
src/nautilus-error-reporting.c
diff --git a/src/meson.build b/src/meson.build
index aca423ac7..1847f6d48 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,3 @@
-built_sources = []
gdbus_sources = []
enums = []
@@ -6,8 +5,6 @@ gdbus_sources += gnome.gdbus_codegen ('nautilus-freedesktop-generated',
join_paths (meson.source_root (), 'data',
'freedesktop-dbus-interfaces.xml'),
interface_prefix: 'org.freedesktop',
namespace: 'NautilusFreedesktop')
-# The header is used in nautilus-desktop.
-built_sources += gdbus_sources
gdbus_sources += gnome.gdbus_codegen ('nautilus-generated',
join_paths (meson.source_root (), 'data', 'dbus-interfaces.xml'),
@@ -36,12 +33,11 @@ resources = gnome.compile_resources ('nautilus-resources',
source_dir: 'resources',
c_name: 'nautilus',
extra_args: '--manual-register')
-built_sources += resources[1]
libnautilus_sources = [
enums,
gdbus_sources,
- resources[0],
+ resources,
'animation/egg-animation.c',
'animation/egg-animation.h',
'animation/egg-frame-source.c',
@@ -66,8 +62,6 @@ libnautilus_sources = [
'nautilus-container-max-width.h',
'nautilus-dbus-manager.c',
'nautilus-dbus-manager.h',
- 'nautilus-desktop-item-properties.c',
- 'nautilus-desktop-item-properties.h',
'nautilus-error-reporting.c',
'nautilus-error-reporting.h',
'nautilus-preferences-window.c',
@@ -295,8 +289,7 @@ libnautilus_include_dirs = include_directories ('.')
libnautilus_dep = declare_dependency (link_with: libnautilus,
include_directories: [nautilus_include_dirs,
libnautilus_include_dirs],
- dependencies: nautilus_deps,
- sources: built_sources)
+ dependencies: nautilus_deps)
nautilus = executable ('nautilus',
'nautilus-main.c',
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index adcb7d3e7..08b8f229e 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -948,9 +948,7 @@ const GOptionEntry options[] =
/* dummy, only for compatibility reasons */
{ "browser", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, NULL,
NULL, NULL },
- { "no-desktop", '\0', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, NULL,
- NULL, NULL },
- /* ditto */
+ /* ditto */
{ "geometry", 'g', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, NULL,
N_("Create the initial window with the given geometry."), N_("GEOMETRY") },
{ "version", '\0', 0, G_OPTION_ARG_NONE, NULL,
diff --git a/src/nautilus-bookmark.c b/src/nautilus-bookmark.c
index 5c51fdbc0..0deb72b68 100644
--- a/src/nautilus-bookmark.c
+++ b/src/nautilus-bookmark.c
@@ -213,8 +213,7 @@ nautilus_bookmark_get_is_builtin (NautilusBookmark *bookmark)
}
/* exclude XDG locations which are not in our builtin list */
- if (xdg_type == G_USER_DIRECTORY_DESKTOP &&
- !g_settings_get_boolean (gnome_background_preferences, NAUTILUS_PREFERENCES_SHOW_DESKTOP))
+ if (xdg_type == G_USER_DIRECTORY_DESKTOP)
{
return FALSE;
}
diff --git a/src/nautilus-canvas-container.c b/src/nautilus-canvas-container.c
index b85a2adc2..f40b950da 100644
--- a/src/nautilus-canvas-container.c
+++ b/src/nautilus-canvas-container.c
@@ -307,12 +307,8 @@ icon_set_position (NautilusCanvasIcon *icon,
*/
container_x = 0;
container_y = 0;
- container_width = gdk_screen_width () - container_x
- - container->details->left_margin
- - container->details->right_margin;
- container_height = gdk_screen_height () - container_y
- - container->details->top_margin
- - container->details->bottom_margin;
+ container_width = gdk_screen_width () - container_x;
+ container_height = gdk_screen_height () - container_y;
pixels_per_unit = EEL_CANVAS (container)->pixels_per_unit;
/* Clip the position of the icon within our desktop bounds */
container_left = container_x / pixels_per_unit;
@@ -528,16 +524,6 @@ icon_toggle_selected (NautilusCanvasContainer *container,
{
container->details->stretch_icon = NULL;
nautilus_canvas_item_set_show_stretch_handles (icon->item, FALSE);
- /* snap the icon if necessary */
- if (container->details->keep_aligned)
- {
- nautilus_canvas_container_move_icon (container,
- icon,
- icon->x, icon->y,
- icon->scale,
- FALSE, TRUE, TRUE);
- }
-
emit_stretch_ended (container, icon);
}
@@ -1188,16 +1174,9 @@ nautilus_canvas_container_update_scroll_region (NautilusCanvasContainer *contain
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
eel_canvas_set_scroll_region
(EEL_CANVAS (container),
- (double) -container->details->left_margin / pixels_per_unit,
- (double) -container->details->top_margin / pixels_per_unit,
- ((double) (allocation.width - 1)
- - container->details->left_margin
- - container->details->right_margin)
- / pixels_per_unit,
- ((double) (allocation.height - 1)
- - container->details->top_margin
- - container->details->bottom_margin)
- / pixels_per_unit);
+ 0.0, 0.0,
+ ((double) (allocation.width - 1)) / pixels_per_unit,
+ ((double) (allocation.height - 1)) / pixels_per_unit);
return;
}
@@ -1219,25 +1198,8 @@ nautilus_canvas_container_update_scroll_region (NautilusCanvasContainer *contain
/* Add border at the "end"of the layout (i.e. after the icons), to
* ensure we get some space when scrolled to the end.
- * For horizontal layouts, we add a bottom border.
- * Vertical layout is used by the compact view so the end
- * depends on the RTL setting.
*/
- if (nautilus_canvas_container_is_layout_vertical (container))
- {
- if (nautilus_canvas_container_is_layout_rtl (container))
- {
- x1 -= ICON_PAD_LEFT + CONTAINER_PAD_LEFT;
- }
- else
- {
- x2 += ICON_PAD_RIGHT + CONTAINER_PAD_RIGHT;
- }
- }
- else
- {
- y2 += ICON_PAD_BOTTOM + CONTAINER_PAD_BOTTOM;
- }
+ y2 += ICON_PAD_BOTTOM + CONTAINER_PAD_BOTTOM;
/* Auto-layout assumes a 0, 0 scroll origin and at least allocation->width.
* Then we lay out to the right or to the left, so
@@ -1603,30 +1565,6 @@ snap_position (NautilusCanvasContainer *container,
*y = baseline_y - icon_height;
}
-static int
-compare_icons_by_position (gconstpointer a,
- gconstpointer b)
-{
- NautilusCanvasIcon *icon_a, *icon_b;
- int x1, y1, x2, y2;
- int center_a;
- int center_b;
-
- icon_a = (NautilusCanvasIcon *) a;
- icon_b = (NautilusCanvasIcon *) b;
-
- icon_get_bounding_box (icon_a, &x1, &y1, &x2, &y2,
- BOUNDS_USAGE_FOR_DISPLAY);
- center_a = x1 + (x2 - x1) / 2;
- icon_get_bounding_box (icon_b, &x1, &y1, &x2, &y2,
- BOUNDS_USAGE_FOR_DISPLAY);
- center_b = x1 + (x2 - x1) / 2;
-
- return center_a == center_b ?
- icon_a->y - icon_b->y :
- center_a - center_b;
-}
-
static PlacementGrid *
placement_grid_new (NautilusCanvasContainer *container,
gboolean tight)
@@ -1855,56 +1793,6 @@ find_empty_location (NautilusCanvasContainer *container,
*y = icon_position.y0;
}
-static void
-align_icons (NautilusCanvasContainer *container)
-{
- GList *unplaced_icons;
- GList *l;
- PlacementGrid *grid;
-
- unplaced_icons = g_list_copy (container->details->icons);
-
- unplaced_icons = g_list_sort (unplaced_icons,
- compare_icons_by_position);
-
- if (nautilus_canvas_container_is_layout_rtl (container))
- {
- unplaced_icons = g_list_reverse (unplaced_icons);
- }
-
- grid = placement_grid_new (container, TRUE);
-
- if (!grid)
- {
- return;
- }
-
- for (l = unplaced_icons; l != NULL; l = l->next)
- {
- NautilusCanvasIcon *icon;
- int x, y;
-
- icon = l->data;
- x = icon->saved_ltr_x;
- y = icon->y;
- find_empty_location (container, grid,
- icon, x, y, &x, &y);
-
- icon_set_position (icon, x, y);
- icon->saved_ltr_x = icon->x;
- placement_grid_mark_icon (grid, icon);
- }
-
- g_list_free (unplaced_icons);
-
- placement_grid_free (grid);
-
- if (nautilus_canvas_container_is_layout_rtl (container))
- {
- nautilus_canvas_container_set_rtl_positions (container);
- }
-}
-
static double
get_mirror_x_position (NautilusCanvasContainer *container,
NautilusCanvasIcon *icon,
@@ -1940,221 +1828,11 @@ nautilus_canvas_container_set_rtl_positions (NautilusCanvasContainer *container)
}
static void
-lay_down_icons_vertical_desktop (NautilusCanvasContainer *container,
- GList *icons)
-{
- GList *p, *placed_icons, *unplaced_icons;
- int total, new_length, placed;
- NautilusCanvasIcon *icon;
- int height, max_width, column_width, icon_width, icon_height;
- int x, y, x1, x2, y1, y2;
- EelDRect icon_rect;
- GtkAllocation allocation;
-
- /* We can't get the right allocation if the size hasn't been allocated yet */
- g_return_if_fail (container->details->has_been_allocated);
-
- /* Get container dimensions */
- gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
- height = CANVAS_HEIGHT (container, allocation);
-
- /* Determine which icons have and have not been placed */
- placed_icons = NULL;
- unplaced_icons = NULL;
-
- total = g_list_length (container->details->icons);
- new_length = g_list_length (icons);
- placed = total - new_length;
- if (placed > 0)
- {
- PlacementGrid *grid;
- /* Add only placed icons in list */
- for (p = container->details->icons; p != NULL; p = p->next)
- {
- icon = p->data;
- if (icon_is_positioned (icon))
- {
- icon_set_position (icon, icon->saved_ltr_x, icon->y);
- placed_icons = g_list_prepend (placed_icons, icon);
- }
- else
- {
- icon->x = 0;
- icon->y = 0;
- unplaced_icons = g_list_prepend (unplaced_icons, icon);
- }
- }
- placed_icons = g_list_reverse (placed_icons);
- unplaced_icons = g_list_reverse (unplaced_icons);
-
- grid = placement_grid_new (container, FALSE);
-
- if (grid)
- {
- for (p = placed_icons; p != NULL; p = p->next)
- {
- placement_grid_mark_icon
- (grid, (NautilusCanvasIcon *) p->data);
- }
-
- /* Place unplaced icons in the best locations */
- for (p = unplaced_icons; p != NULL; p = p->next)
- {
- icon = p->data;
-
- icon_rect = nautilus_canvas_item_get_icon_rectangle (icon->item);
-
- /* Start the icon in the first column */
- x = DESKTOP_PAD_HORIZONTAL + (SNAP_SIZE_X / 2) - ((icon_rect.x1 - icon_rect.x0) / 2);
- y = DESKTOP_PAD_VERTICAL + SNAP_SIZE_Y - (icon_rect.y1 - icon_rect.y0);
-
- find_empty_location (container,
- grid,
- icon,
- x, y,
- &x, &y);
-
- icon_set_position (icon, x, y);
- icon->saved_ltr_x = x;
- placement_grid_mark_icon (grid, icon);
- }
-
- placement_grid_free (grid);
- }
-
- g_list_free (placed_icons);
- g_list_free (unplaced_icons);
- }
- else
- {
- /* There are no placed icons. Just lay them down using our rules */
- x = DESKTOP_PAD_HORIZONTAL;
-
- while (icons != NULL)
- {
- int center_x;
- int baseline;
- int icon_height_for_bound_check;
- gboolean should_snap;
-
- should_snap = container->details->keep_aligned;
-
- y = DESKTOP_PAD_VERTICAL;
-
- max_width = 0;
-
- /* Calculate max width for column */
- for (p = icons; p != NULL; p = p->next)
- {
- icon = p->data;
-
- icon_get_bounding_box (icon, &x1, &y1, &x2, &y2,
- BOUNDS_USAGE_FOR_LAYOUT);
- icon_width = x2 - x1;
- icon_height = y2 - y1;
-
- icon_get_bounding_box (icon, NULL, &y1, NULL, &y2,
- BOUNDS_USAGE_FOR_ENTIRE_ITEM);
- icon_height_for_bound_check = y2 - y1;
-
- if (should_snap)
- {
- /* Snap the baseline to a grid position */
- icon_rect = nautilus_canvas_item_get_icon_rectangle (icon->item);
- baseline = y + (icon_rect.y1 - icon_rect.y0);
- baseline = SNAP_CEIL_VERTICAL (baseline);
- y = baseline - (icon_rect.y1 - icon_rect.y0);
- }
-
- /* Check and see if we need to move to a new column */
- if (y != DESKTOP_PAD_VERTICAL && y + icon_height_for_bound_check > height)
- {
- break;
- }
-
- if (max_width < icon_width)
- {
- max_width = icon_width;
- }
-
- y += icon_height + DESKTOP_PAD_VERTICAL;
- }
-
- y = DESKTOP_PAD_VERTICAL;
-
- center_x = x + max_width / 2;
- column_width = max_width;
- if (should_snap)
- {
- /* Find the grid column to center on */
- center_x = SNAP_CEIL_HORIZONTAL (center_x);
- column_width = (center_x - x) + (max_width / 2);
- }
-
- /* Lay out column */
- for (p = icons; p != NULL; p = p->next)
- {
- icon = p->data;
- icon_get_bounding_box (icon, &x1, &y1, &x2, &y2,
- BOUNDS_USAGE_FOR_LAYOUT);
- icon_height = y2 - y1;
-
- icon_get_bounding_box (icon, NULL, &y1, NULL, &y2,
- BOUNDS_USAGE_FOR_ENTIRE_ITEM);
- icon_height_for_bound_check = y2 - y1;
-
- icon_rect = nautilus_canvas_item_get_icon_rectangle (icon->item);
-
- if (should_snap)
- {
- baseline = y + (icon_rect.y1 - icon_rect.y0);
- baseline = SNAP_CEIL_VERTICAL (baseline);
- y = baseline - (icon_rect.y1 - icon_rect.y0);
- }
-
- /* Check and see if we need to move to a new column */
- if (y != DESKTOP_PAD_VERTICAL && y > height - icon_height_for_bound_check &&
- /* Make sure we lay out at least one icon per column, to make progress */
- p != icons)
- {
- x += column_width + DESKTOP_PAD_HORIZONTAL;
- break;
- }
-
- icon_set_position (icon,
- center_x - (icon_rect.x1 - icon_rect.x0) / 2,
- y);
-
- icon->saved_ltr_x = icon->x;
- y += icon_height + DESKTOP_PAD_VERTICAL;
- }
- icons = p;
- }
- }
-
- /* These modes are special. We freeze all of our positions
- * after we do the layout.
- */
- /* FIXME bugzilla.gnome.org 42478:
- * This should not be tied to the direction of layout.
- * It should be a separate switch.
- */
- nautilus_canvas_container_freeze_icon_positions (container);
-}
-
-static void
lay_down_icons (NautilusCanvasContainer *container,
GList *icons,
double start_y)
{
- if (container->details->is_desktop)
- {
- lay_down_icons_vertical_desktop (container, icons);
- }
- else
- {
- lay_down_icons_horizontal (container, icons, start_y);
- }
+ lay_down_icons_horizontal (container, icons, start_y);
}
static void
@@ -2437,11 +2115,6 @@ nautilus_canvas_container_move_icon (NautilusCanvasContainer *container,
if (!details->auto_layout)
{
- if (details->keep_aligned && snap)
- {
- snap_position (container, icon, &x, &y);
- }
-
if (x != icon->x || y != icon->y)
{
icon_set_position (icon, x, y);
@@ -2668,76 +2341,16 @@ get_rubber_color (NautilusCanvasContainer *container,
GdkRGBA *bgcolor,
GdkRGBA *bordercolor)
{
- Atom real_type;
- gint result = -1;
- gint real_format;
- gulong items_read = 0;
- gulong items_left = 0;
- gchar *colors;
- Atom representative_colors_atom;
- Display *display;
-
- if (nautilus_canvas_container_get_is_desktop (container))
- {
- representative_colors_atom = gdk_x11_get_xatom_by_name ("_GNOME_BACKGROUND_REPRESENTATIVE_COLORS");
- display = gdk_x11_display_get_xdisplay (gdk_display_get_default ());
-
- gdk_error_trap_push ();
- result = XGetWindowProperty (display,
- GDK_ROOT_WINDOW (),
- representative_colors_atom,
- 0L,
- G_MAXLONG,
- False,
- XA_STRING,
- &real_type,
- &real_format,
- &items_read,
- &items_left,
- (guchar **) &colors);
- gdk_error_trap_pop_ignored ();
- }
-
- if (result == Success && items_read)
- {
- /* by treating the result as a nul-terminated string, we
- * select the first colour in the list.
- */
- GdkRGBA read;
- gdouble shade;
+ GtkStyleContext *context;
- gdk_rgba_parse (&read, colors);
- XFree (colors);
+ context = gtk_widget_get_style_context (GTK_WIDGET (container));
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_RUBBERBAND);
- /* Border
- *
- * We shade darker colours to be slightly lighter and
- * lighter ones to be slightly darker.
- */
- shade = read.green < 0.5 ? 1.1 : 0.9;
- bordercolor->red = read.red * shade;
- bordercolor->green = read.green * shade;
- bordercolor->blue = read.blue * shade;
- bordercolor->alpha = 1.0;
+ gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, bgcolor);
+ gtk_style_context_get_border_color (context, GTK_STATE_FLAG_NORMAL, bordercolor);
- /* Background */
- *bgcolor = read;
- bgcolor->alpha = 0.6;
- }
- else
- {
- /* Fallback to the style context if we can't get the Atom */
- GtkStyleContext *context;
-
- context = gtk_widget_get_style_context (GTK_WIDGET (container));
- gtk_style_context_save (context);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_RUBBERBAND);
-
- gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, bgcolor);
- gtk_style_context_get_border_color (context, GTK_STATE_FLAG_NORMAL, bordercolor);
-
- gtk_style_context_restore (context);
- }
+ gtk_style_context_restore (context);
}
static void
@@ -3339,40 +2952,6 @@ next_row_rightmost (NautilusCanvasContainer *container,
}
static gboolean
-next_column_bottommost (NautilusCanvasContainer *container,
- NautilusCanvasIcon *start_icon,
- NautilusCanvasIcon *best_so_far,
- NautilusCanvasIcon *candidate,
- void *data)
-{
- /* sort out icons that are not on the right of the current column */
- if (compare_with_start_column (container, candidate) >= 0)
- {
- return FALSE;
- }
-
- if (best_so_far != NULL)
- {
- if (compare_icons_horizontal_first (container,
- best_so_far,
- candidate) > 0)
- {
- /* candidate is above best choice, but below the current row */
- return TRUE;
- }
-
- if (compare_icons_vertical_first (container,
- best_so_far,
- candidate) < 0)
- {
- return TRUE;
- }
- }
-
- return best_so_far == NULL;
-}
-
-static gboolean
previous_row_rightmost (NautilusCanvasContainer *container,
NautilusCanvasIcon *start_icon,
NautilusCanvasIcon *best_so_far,
@@ -3477,123 +3056,6 @@ same_column_below_highest (NautilusCanvasContainer *container,
}
static gboolean
-previous_column_highest (NautilusCanvasContainer *container,
- NautilusCanvasIcon *start_icon,
- NautilusCanvasIcon *best_so_far,
- NautilusCanvasIcon *candidate,
- void *data)
-{
- /* sort out icons that are not before the current column */
- if (compare_with_start_column (container, candidate) <= 0)
- {
- return FALSE;
- }
-
- if (best_so_far != NULL)
- {
- if (compare_icons_horizontal (container,
- best_so_far,
- candidate) < 0)
- {
- /* candidate is right of the best choice, but left of the current column */
- return TRUE;
- }
-
- if (compare_icons_vertical (container,
- best_so_far,
- candidate) > 0)
- {
- return TRUE;
- }
- }
-
- return best_so_far == NULL;
-}
-
-
-static gboolean
-next_column_highest (NautilusCanvasContainer *container,
- NautilusCanvasIcon *start_icon,
- NautilusCanvasIcon *best_so_far,
- NautilusCanvasIcon *candidate,
- void *data)
-{
- /* sort out icons that are not after the current column */
- if (compare_with_start_column (container, candidate) >= 0)
- {
- return FALSE;
- }
-
- if (best_so_far != NULL)
- {
- if (compare_icons_horizontal_first (container,
- best_so_far,
- candidate) > 0)
- {
- /* candidate is left of the best choice, but right of the current column */
- return TRUE;
- }
-
- if (compare_icons_vertical_first (container,
- best_so_far,
- candidate) > 0)
- {
- return TRUE;
- }
- }
-
- return best_so_far == NULL;
-}
-
-static gboolean
-previous_column_lowest (NautilusCanvasContainer *container,
- NautilusCanvasIcon *start_icon,
- NautilusCanvasIcon *best_so_far,
- NautilusCanvasIcon *candidate,
- void *data)
-{
- /* sort out icons that are not before the current column */
- if (compare_with_start_column (container, candidate) <= 0)
- {
- return FALSE;
- }
-
- if (best_so_far != NULL)
- {
- if (compare_icons_horizontal_first (container,
- best_so_far,
- candidate) < 0)
- {
- /* candidate is right of the best choice, but left of the current column */
- return TRUE;
- }
-
- if (compare_icons_vertical_first (container,
- best_so_far,
- candidate) < 0)
- {
- return TRUE;
- }
- }
-
- return best_so_far == NULL;
-}
-
-static gboolean
-last_column_lowest (NautilusCanvasContainer *container,
- NautilusCanvasIcon *start_icon,
- NautilusCanvasIcon *best_so_far,
- NautilusCanvasIcon *candidate,
- void *data)
-{
- if (best_so_far == NULL)
- {
- return TRUE;
- }
- return compare_icons_horizontal_first (container, best_so_far, candidate) < 0;
-}
-
-static gboolean
closest_in_90_degrees (NautilusCanvasContainer *container,
NautilusCanvasIcon *start_icon,
NautilusCanvasIcon *best_so_far,
@@ -3811,11 +3273,7 @@ keyboard_end (NautilusCanvasContainer *container,
from = find_best_selected_icon (container, NULL,
leftmost_in_top_row,
NULL);
- to = find_best_icon (container, NULL,
- nautilus_canvas_container_is_layout_vertical (container) ?
- last_column_lowest :
- rightmost_in_bottom_row,
- NULL);
+ to = find_best_icon (container, NULL, rightmost_in_bottom_row, NULL);
keyboard_move_to (container, to, from, event);
}
@@ -3959,23 +3417,14 @@ keyboard_right (NautilusCanvasContainer *container,
GdkEventKey *event)
{
IsBetterCanvasFunction fallback;
- IsBetterCanvasFunction next_column_fallback;
fallback = NULL;
if (container->details->auto_layout &&
- !nautilus_canvas_container_is_layout_vertical (container) &&
!is_rectangle_selection_event (event))
{
fallback = next_row_leftmost;
}
- next_column_fallback = NULL;
- if (nautilus_canvas_container_is_layout_vertical (container) &&
- gtk_widget_get_direction (GTK_WIDGET (container)) != GTK_TEXT_DIR_RTL)
- {
- next_column_fallback = next_column_bottommost;
- }
-
/* Right selects the next icon in the same row.
* Control-Right sets the keyboard focus to the next icon in the same row.
*/
@@ -3987,7 +3436,7 @@ keyboard_right (NautilusCanvasContainer *container,
rightmost_in_top_row : leftmost_in_top_row,
same_row_right_side_leftmost,
fallback,
- next_column_fallback,
+ NULL,
closest_in_90_degrees);
}
@@ -3996,23 +3445,14 @@ keyboard_left (NautilusCanvasContainer *container,
GdkEventKey *event)
{
IsBetterCanvasFunction fallback;
- IsBetterCanvasFunction previous_column_fallback;
fallback = NULL;
if (container->details->auto_layout &&
- !nautilus_canvas_container_is_layout_vertical (container) &&
!is_rectangle_selection_event (event))
{
fallback = previous_row_rightmost;
}
- previous_column_fallback = NULL;
- if (nautilus_canvas_container_is_layout_vertical (container) &&
- gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
- {
- previous_column_fallback = previous_column_lowest;
- }
-
/* Left selects the next icon in the same row.
* Control-Left sets the keyboard focus to the next icon in the same row.
*/
@@ -4024,7 +3464,7 @@ keyboard_left (NautilusCanvasContainer *container,
rightmost_in_top_row : leftmost_in_top_row,
same_row_left_side_rightmost,
fallback,
- previous_column_fallback,
+ NULL,
closest_in_90_degrees);
}
@@ -4032,35 +3472,16 @@ static void
keyboard_down (NautilusCanvasContainer *container,
GdkEventKey *event)
{
- IsBetterCanvasFunction fallback;
IsBetterCanvasFunction next_row_fallback;
- fallback = NULL;
- if (container->details->auto_layout &&
- nautilus_canvas_container_is_layout_vertical (container) &&
- !is_rectangle_selection_event (event))
+ next_row_fallback = NULL;
+ if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
{
- if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
- {
- fallback = previous_column_highest;
- }
- else
- {
- fallback = next_column_highest;
- }
+ next_row_fallback = next_row_leftmost;
}
-
- next_row_fallback = NULL;
- if (!nautilus_canvas_container_is_layout_vertical (container))
+ else
{
- if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
- {
- next_row_fallback = next_row_leftmost;
- }
- else
- {
- next_row_fallback = next_row_rightmost;
- }
+ next_row_fallback = next_row_rightmost;
}
/* Down selects the next icon in the same column.
@@ -4073,7 +3494,7 @@ keyboard_down (NautilusCanvasContainer *container,
nautilus_canvas_container_is_layout_rtl (container) ?
rightmost_in_top_row : leftmost_in_top_row,
same_column_below_highest,
- fallback,
+ NULL,
next_row_fallback,
closest_in_90_degrees);
}
@@ -4082,23 +3503,6 @@ static void
keyboard_up (NautilusCanvasContainer *container,
GdkEventKey *event)
{
- IsBetterCanvasFunction fallback;
-
- fallback = NULL;
- if (container->details->auto_layout &&
- nautilus_canvas_container_is_layout_vertical (container) &&
- !is_rectangle_selection_event (event))
- {
- if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
- {
- fallback = next_column_bottommost;
- }
- else
- {
- fallback = previous_column_lowest;
- }
- }
-
/* Up selects the next icon in the same column.
* Control-Up sets the keyboard focus to the next icon in the same column.
*/
@@ -4109,7 +3513,7 @@ keyboard_up (NautilusCanvasContainer *container,
nautilus_canvas_container_is_layout_rtl (container) ?
rightmost_in_top_row : leftmost_in_top_row,
same_column_above_lowest,
- fallback,
+ NULL,
NULL,
closest_in_90_degrees);
}
@@ -4227,9 +3631,6 @@ finalize (GObject *object)
g_signal_handlers_disconnect_by_func (nautilus_icon_view_preferences,
text_ellipsis_limit_changed_container_callback,
object);
- g_signal_handlers_disconnect_by_func (nautilus_desktop_preferences,
- text_ellipsis_limit_changed_container_callback,
- object);
g_hash_table_destroy (details->icon_set);
details->icon_set = NULL;
@@ -4457,13 +3858,7 @@ style_updated (GtkWidget *widget)
container = NAUTILUS_CANVAS_CONTAINER (widget);
- /* Don't chain up to parent, if this is a desktop container,
- * because that resets the background of the window.
- */
- if (!nautilus_canvas_container_get_is_desktop (container))
- {
- GTK_WIDGET_CLASS (nautilus_canvas_container_parent_class)->style_updated (widget);
- }
+ GTK_WIDGET_CLASS (nautilus_canvas_container_parent_class)->style_updated (widget);
if (gtk_widget_get_realized (widget))
{
@@ -5332,20 +4727,10 @@ nautilus_canvas_container_constructor (GType type,
construct_params);
container = NAUTILUS_CANVAS_CONTAINER (object);
- if (nautilus_canvas_container_get_is_desktop (container))
- {
- g_signal_connect_swapped (nautilus_desktop_preferences,
- "changed::" NAUTILUS_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT,
- G_CALLBACK (text_ellipsis_limit_changed_container_callback),
- container);
- }
- else
- {
- g_signal_connect_swapped (nautilus_icon_view_preferences,
- "changed::" NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
- G_CALLBACK (text_ellipsis_limit_changed_container_callback),
- container);
- }
+ g_signal_connect_swapped (nautilus_icon_view_preferences,
+ "changed::" NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
+ G_CALLBACK (text_ellipsis_limit_changed_container_callback),
+ container);
return object;
}
@@ -5770,7 +5155,6 @@ handle_scale_factor_changed (GObject *object,
static int text_ellipsis_limits[NAUTILUS_CANVAS_ZOOM_LEVEL_N_ENTRIES];
-static int desktop_text_ellipsis_limit;
static gboolean
get_text_ellipsis_limit_for_zoom (char **strs,
@@ -5853,15 +5237,6 @@ text_ellipsis_limit_changed_callback (gpointer callback_data)
}
static void
-desktop_text_ellipsis_limit_changed_callback (gpointer callback_data)
-{
- int pref;
-
- pref = g_settings_get_int (nautilus_desktop_preferences,
NAUTILUS_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT);
- desktop_text_ellipsis_limit = pref;
-}
-
-static void
nautilus_canvas_container_init (NautilusCanvasContainer *container)
{
NautilusCanvasContainerDetails *details;
@@ -5891,12 +5266,6 @@ nautilus_canvas_container_init (NautilusCanvasContainer *container)
NULL);
text_ellipsis_limit_changed_callback (NULL);
- g_signal_connect_swapped (nautilus_icon_view_preferences,
- "changed::" NAUTILUS_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT,
- G_CALLBACK (desktop_text_ellipsis_limit_changed_callback),
- NULL);
- desktop_text_ellipsis_limit_changed_callback (NULL);
-
setup_prefs = TRUE;
}
}
@@ -6224,24 +5593,8 @@ nautilus_canvas_container_get_first_visible_icon (NautilusCanvasContainer *conta
&x1, &y1, &x2, &y2);
compare_lt = FALSE;
- if (nautilus_canvas_container_is_layout_vertical (container))
- {
- pos = &x1;
- if (nautilus_canvas_container_is_layout_rtl (container))
- {
- compare_lt = TRUE;
- better_icon = x1 < x + ICON_PAD_LEFT;
- }
- else
- {
- better_icon = x2 > x + ICON_PAD_LEFT;
- }
- }
- else
- {
- pos = &y1;
- better_icon = y2 > y + ICON_PAD_TOP;
- }
+ pos = &y1;
+ better_icon = y2 > y + ICON_PAD_TOP;
if (better_icon)
{
if (best_icon == NULL)
@@ -6308,21 +5661,7 @@ nautilus_canvas_container_scroll_to_canvas (NautilusCanvasContainer *container,
item_get_canvas_bounds (EEL_CANVAS_ITEM (icon->item), &bounds);
}
- if (nautilus_canvas_container_is_layout_vertical (container))
- {
- if (nautilus_canvas_container_is_layout_rtl (container))
- {
- gtk_adjustment_set_value (hadj, bounds.x1 - allocation.width);
- }
- else
- {
- gtk_adjustment_set_value (hadj, bounds.x0);
- }
- }
- else
- {
- gtk_adjustment_set_value (vadj, bounds.y0);
- }
+ gtk_adjustment_set_value (vadj, bounds.y0);
}
l = l->next;
@@ -6605,14 +5944,7 @@ nautilus_canvas_container_update_visible_icons (NautilusCanvasContainer *contain
&x1,
&y1);
- if (nautilus_canvas_container_is_layout_vertical (container))
- {
- visible = x1 >= min_x && x0 <= max_x;
- }
- else
- {
- visible = y1 >= min_y && y0 <= max_y;
- }
+ visible = y1 >= min_y && y0 <= max_y;
if (visible)
{
@@ -6632,20 +5964,14 @@ static void
handle_vadjustment_changed (GtkAdjustment *adjustment,
NautilusCanvasContainer *container)
{
- if (!nautilus_canvas_container_is_layout_vertical (container))
- {
- nautilus_canvas_container_update_visible_icons (container);
- }
+ nautilus_canvas_container_update_visible_icons (container);
}
static void
handle_hadjustment_changed (GtkAdjustment *adjustment,
NautilusCanvasContainer *container)
{
- if (nautilus_canvas_container_is_layout_vertical (container))
- {
- nautilus_canvas_container_update_visible_icons (container);
- }
+ nautilus_canvas_container_update_visible_icons (container);
}
@@ -6855,15 +6181,8 @@ finish_adding_new_icons (NautilusCanvasContainer *container)
g_assert (!container->details->auto_layout);
sort_icons (container, &no_position_icons);
- if (nautilus_canvas_container_get_is_desktop (container))
- {
- lay_down_icons (container, no_position_icons, CONTAINER_PAD_TOP);
- }
- else
- {
- get_all_icon_bounds (container, NULL, NULL, NULL, &bottom, BOUNDS_USAGE_FOR_LAYOUT);
- lay_down_icons (container, no_position_icons, bottom + ICON_PAD_BOTTOM);
- }
+ get_all_icon_bounds (container, NULL, NULL, NULL, &bottom, BOUNDS_USAGE_FOR_LAYOUT);
+ lay_down_icons (container, no_position_icons, bottom + ICON_PAD_BOTTOM);
g_list_free (no_position_icons);
}
@@ -7223,11 +6542,9 @@ nautilus_canvas_container_get_icons_bounding_box (NautilusCanvasContainer *conta
icon_get_bounding_box ((NautilusCanvasIcon *) node->data,
&x1, &y1, &x2, &y2,
BOUNDS_USAGE_FOR_DISPLAY);
- g_array_index (result, GdkRectangle, index).x = x1 * EEL_CANVAS (container)->pixels_per_unit +
- container->details->left_margin;
+ g_array_index (result, GdkRectangle, index).x = x1 * EEL_CANVAS (container)->pixels_per_unit;
g_array_index (result, GdkRectangle, index).width = (x2 - x1) * EEL_CANVAS
(container)->pixels_per_unit;
- g_array_index (result, GdkRectangle, index).y = y1 * EEL_CANVAS (container)->pixels_per_unit +
- container->details->top_margin;
+ g_array_index (result, GdkRectangle, index).y = y1 * EEL_CANVAS (container)->pixels_per_unit;
g_array_index (result, GdkRectangle, index).height = (y2 - y1) * EEL_CANVAS
(container)->pixels_per_unit;
}
@@ -7799,64 +7116,6 @@ nautilus_canvas_container_set_auto_layout (NautilusCanvasContainer *container,
g_signal_emit (container, signals[LAYOUT_CHANGED], 0);
}
-gboolean
-nautilus_canvas_container_is_keep_aligned (NautilusCanvasContainer *container)
-{
- return container->details->keep_aligned;
-}
-
-static gboolean
-align_icons_callback (gpointer callback_data)
-{
- NautilusCanvasContainer *container;
-
- container = NAUTILUS_CANVAS_CONTAINER (callback_data);
- align_icons (container);
- container->details->align_idle_id = 0;
-
- return FALSE;
-}
-
-static void
-unschedule_align_icons (NautilusCanvasContainer *container)
-{
- if (container->details->align_idle_id != 0)
- {
- g_source_remove (container->details->align_idle_id);
- container->details->align_idle_id = 0;
- }
-}
-
-static void
-schedule_align_icons (NautilusCanvasContainer *container)
-{
- if (container->details->align_idle_id == 0
- && container->details->has_been_allocated)
- {
- container->details->align_idle_id = g_idle_add
- (align_icons_callback, container);
- }
-}
-
-void
-nautilus_canvas_container_set_keep_aligned (NautilusCanvasContainer *container,
- gboolean keep_aligned)
-{
- if (container->details->keep_aligned != keep_aligned)
- {
- container->details->keep_aligned = keep_aligned;
-
- if (keep_aligned && !container->details->auto_layout)
- {
- schedule_align_icons (container);
- }
- else
- {
- unschedule_align_icons (container);
- }
- }
-}
-
/* Switch from automatic to manual layout, freezing all the icons in their
* current positions instead of restoring canvas positions from the last manual
* layout as set_auto_layout does.
@@ -7956,49 +7215,6 @@ nautilus_canvas_container_set_is_fixed_size (NautilusCanvasContainer *container,
container->details->is_fixed_size = is_fixed_size;
}
-gboolean
-nautilus_canvas_container_get_is_desktop (NautilusCanvasContainer *container)
-{
- g_return_val_if_fail (NAUTILUS_IS_CANVAS_CONTAINER (container), FALSE);
-
- return container->details->is_desktop;
-}
-
-void
-nautilus_canvas_container_set_is_desktop (NautilusCanvasContainer *container,
- gboolean is_desktop)
-{
- g_return_if_fail (NAUTILUS_IS_CANVAS_CONTAINER (container));
-
- container->details->is_desktop = is_desktop;
-
- if (is_desktop)
- {
- GtkStyleContext *context;
-
- context = gtk_widget_get_style_context (GTK_WIDGET (container));
- gtk_style_context_add_class (context, "nautilus-desktop");
- }
-}
-
-void
-nautilus_canvas_container_set_margins (NautilusCanvasContainer *container,
- int left_margin,
- int right_margin,
- int top_margin,
- int bottom_margin)
-{
- g_return_if_fail (NAUTILUS_IS_CANVAS_CONTAINER (container));
-
- container->details->left_margin = left_margin;
- container->details->right_margin = right_margin;
- container->details->top_margin = top_margin;
- container->details->bottom_margin = bottom_margin;
-
- /* redo layout of icons as the margins have changed */
- schedule_redo_layout (container);
-}
-
/* handle theme changes */
void
@@ -8638,28 +7854,12 @@ nautilus_canvas_container_is_layout_rtl (NautilusCanvasContainer *container)
return (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL);
}
-gboolean
-nautilus_canvas_container_is_layout_vertical (NautilusCanvasContainer *container)
-{
- g_return_val_if_fail (NAUTILUS_IS_CANVAS_CONTAINER (container), FALSE);
-
- /* we only do vertical layout in the desktop nowadays */
- return container->details->is_desktop;
-}
-
int
nautilus_canvas_container_get_max_layout_lines_for_pango (NautilusCanvasContainer *container)
{
int limit;
- if (nautilus_canvas_container_get_is_desktop (container))
- {
- limit = desktop_text_ellipsis_limit;
- }
- else
- {
- limit = text_ellipsis_limits[container->details->zoom_level];
- }
+ limit = text_ellipsis_limits[container->details->zoom_level];
if (limit <= 0)
{
@@ -8674,14 +7874,7 @@ nautilus_canvas_container_get_max_layout_lines (NautilusCanvasContainer *contain
{
int limit;
- if (nautilus_canvas_container_get_is_desktop (container))
- {
- limit = desktop_text_ellipsis_limit;
- }
- else
- {
- limit = text_ellipsis_limits[container->details->zoom_level];
- }
+ limit = text_ellipsis_limits[container->details->zoom_level];
if (limit <= 0)
{
diff --git a/src/nautilus-canvas-container.h b/src/nautilus-canvas-container.h
index 635349d7e..e66e64679 100644
--- a/src/nautilus-canvas-container.h
+++ b/src/nautilus-canvas-container.h
@@ -243,9 +243,6 @@ gboolean nautilus_canvas_container_is_auto_layout (Nauti
void nautilus_canvas_container_set_auto_layout (NautilusCanvasContainer
*container,
gboolean
auto_layout);
-gboolean nautilus_canvas_container_is_keep_aligned (NautilusCanvasContainer
*container);
-void nautilus_canvas_container_set_keep_aligned (NautilusCanvasContainer
*container,
- gboolean
keep_aligned);
void nautilus_canvas_container_sort (NautilusCanvasContainer
*container);
void nautilus_canvas_container_freeze_icon_positions (NautilusCanvasContainer
*container);
@@ -286,9 +283,6 @@ void nautilus_canvas_container_enable_linger_selection (Nauti
gboolean nautilus_canvas_container_get_is_fixed_size (NautilusCanvasContainer
*container);
void nautilus_canvas_container_set_is_fixed_size (NautilusCanvasContainer
*container,
gboolean
is_fixed_size);
-gboolean nautilus_canvas_container_get_is_desktop (NautilusCanvasContainer
*container);
-void nautilus_canvas_container_set_is_desktop (NautilusCanvasContainer
*container,
- gboolean
is_desktop);
void nautilus_canvas_container_reset_scroll_region (NautilusCanvasContainer
*container);
void nautilus_canvas_container_set_font (NautilusCanvasContainer
*container,
const char *font);
@@ -301,7 +295,6 @@ char* nautilus_canvas_container_get_icon_description (Nauti
NautilusCanvasIconData
*data);
gboolean nautilus_canvas_container_is_layout_rtl (NautilusCanvasContainer
*container);
-gboolean nautilus_canvas_container_is_layout_vertical (NautilusCanvasContainer *container);
gboolean nautilus_canvas_container_get_store_layout_timestamps (NautilusCanvasContainer
*container);
void nautilus_canvas_container_set_store_layout_timestamps (NautilusCanvasContainer
*container,
@@ -311,14 +304,10 @@ void nautilus_canvas_container_widget_to_file_operation_position (N
GdkPoint
*position);
guint nautilus_canvas_container_get_icon_size_for_zoom_level (NautilusCanvasZoomLevel
zoom_level);
-#define CANVAS_WIDTH(container,allocation) ((allocation.width \
- - container->details->left_margin \
- - container->details->right_margin) \
+#define CANVAS_WIDTH(container,allocation) (allocation.width \
/ EEL_CANVAS (container)->pixels_per_unit)
-#define CANVAS_HEIGHT(container,allocation) ((allocation.height \
- - container->details->top_margin \
- - container->details->bottom_margin) \
+#define CANVAS_HEIGHT(container,allocation) (allocation.height \
/ EEL_CANVAS (container)->pixels_per_unit)
#endif /* NAUTILUS_CANVAS_CONTAINER_H */
diff --git a/src/nautilus-canvas-dnd.c b/src/nautilus-canvas-dnd.c
index 7ef7dd56e..ccf71d675 100644
--- a/src/nautilus-canvas-dnd.c
+++ b/src/nautilus-canvas-dnd.c
@@ -537,14 +537,7 @@ get_data_on_first_target_we_support (GtkWidget *widget,
gtk_target_list_add_text_targets (drop_types_list_root, NAUTILUS_ICON_DND_TEXT);
}
- if (nautilus_canvas_container_get_is_desktop (NAUTILUS_CANVAS_CONTAINER (widget)))
- {
- list = drop_types_list_root;
- }
- else
- {
- list = drop_types_list;
- }
+ list = drop_types_list;
target = gtk_drag_dest_find_target (widget, context, list);
if (target != GDK_NONE)
@@ -1674,11 +1667,6 @@ check_hover_timer (NautilusCanvasContainer *container,
return;
}
- if (nautilus_canvas_container_get_is_desktop (container))
- {
- return;
- }
-
remove_hover_timer (dnd_info);
settings = gtk_widget_get_settings (GTK_WIDGET (container));
@@ -1980,12 +1968,7 @@ nautilus_canvas_dnd_init (NautilusCanvasContainer *container)
* (But not a source, as drags starting from this widget will be
* implemented by dealing with events manually.)
*/
- n_elements = G_N_ELEMENTS (drop_types);
- if (!nautilus_canvas_container_get_is_desktop (container))
- {
- /* Don't set up rootwindow drop */
- n_elements -= 1;
- }
+ n_elements = G_N_ELEMENTS (drop_types) - 1;
gtk_drag_dest_set (GTK_WIDGET (container),
0,
drop_types, n_elements,
diff --git a/src/nautilus-canvas-private.h b/src/nautilus-canvas-private.h
index 0f3ad706b..8081bacc4 100644
--- a/src/nautilus-canvas-private.h
+++ b/src/nautilus-canvas-private.h
@@ -203,9 +203,6 @@ struct NautilusCanvasContainerDetails {
gboolean single_click_mode;
gboolean auto_layout;
- /* Should the container keep icons aligned to a grid */
- gboolean keep_aligned;
-
/* Set to TRUE after first allocation has been done */
gboolean has_been_allocated;
@@ -215,9 +212,6 @@ struct NautilusCanvasContainerDetails {
/* Is the container fixed or resizable */
gboolean is_fixed_size;
- /* Is the container for a desktop window */
- gboolean is_desktop;
-
/* Ignore the visible area the next time the scroll region is recomputed */
gboolean reset_scroll_region_trigger;
@@ -225,12 +219,6 @@ struct NautilusCanvasContainerDetails {
double world_x;
double world_y;
- /* margins to follow, used for the desktop panel avoidance */
- int left_margin;
- int right_margin;
- int top_margin;
- int bottom_margin;
-
/* a11y items used by canvas items */
guint a11y_item_action_idle_handler;
GQueue* a11y_item_action_queue;
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 5b2683b44..570f506cd 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -56,17 +56,6 @@
#include <sys/wait.h>
#include <unistd.h>
-enum
-{
- PROP_SUPPORTS_AUTO_LAYOUT = 1,
- PROP_SUPPORTS_SCALING,
- PROP_SUPPORTS_KEEP_ALIGNED,
- PROP_SUPPORTS_MANUAL_LAYOUT,
- NUM_PROPERTIES
-};
-
-static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
-
typedef gboolean (*SortCriterionMatchFunc) (NautilusFile *file);
typedef struct
@@ -96,11 +85,6 @@ typedef struct
GtkWidget *canvas_container;
- gboolean supports_auto_layout;
- gboolean supports_manual_layout;
- gboolean supports_scaling;
- gboolean supports_keep_aligned;
-
/* FIXME: Needed for async operations. Suposedly we would use cancellable and gtask,
* sadly gtkclipboard doesn't support that.
* We follow this pattern for checking validity of the object in the views.
@@ -192,7 +176,6 @@ static void nautilus_canvas_view_set_directory_sort_by (Nautilus
NautilusFile *file,
const SortCriterion *sort);
static void nautilus_canvas_view_update_click_mode (NautilusCanvasView *canvas_view);
-static gboolean nautilus_canvas_view_supports_scaling (NautilusCanvasView *canvas_view);
static void nautilus_canvas_view_reveal_selection (NautilusFilesView *view);
static const SortCriterion *get_sort_criterion_by_metadata_text (const char *metadata_text,
gboolean reversed);
@@ -254,24 +237,12 @@ nautilus_canvas_view_get_canvas_container (NautilusCanvasView *canvas_view)
}
static gboolean
-nautilus_canvas_view_supports_manual_layout (NautilusCanvasView *view)
-{
- NautilusCanvasViewPrivate *priv;
-
- g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
-
- priv = nautilus_canvas_view_get_instance_private (view);
-
- return priv->supports_manual_layout;
-}
-
-static gboolean
get_stored_icon_position_callback (NautilusCanvasContainer *container,
NautilusFile *file,
NautilusCanvasPosition *position,
NautilusCanvasView *canvas_view)
{
- char *position_string, *scale_string;
+ char *position_string;
gboolean position_good;
char c;
@@ -280,11 +251,6 @@ get_stored_icon_position_callback (NautilusCanvasContainer *container,
g_assert (position != NULL);
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
- if (!nautilus_canvas_view_supports_manual_layout (canvas_view))
- {
- return FALSE;
- }
-
/* Get the current position of this canvas from the metadata. */
position_string = nautilus_file_get_metadata
(file, NAUTILUS_METADATA_KEY_ICON_POSITION, "");
@@ -293,26 +259,7 @@ get_stored_icon_position_callback (NautilusCanvasContainer *container,
&position->x, &position->y, &c) == 2;
g_free (position_string);
- /* If it is the desktop directory, maybe the gnome-libs metadata has information about it */
-
- /* Disable scaling if not on the desktop */
- if (nautilus_canvas_view_supports_scaling (canvas_view))
- {
- /* Get the scale of the canvas from the metadata. */
- scale_string = nautilus_file_get_metadata
- (file, NAUTILUS_METADATA_KEY_ICON_SCALE, "1");
- position->scale = g_ascii_strtod (scale_string, NULL);
- if (errno != 0)
- {
- position->scale = 1.0;
- }
-
- g_free (scale_string);
- }
- else
- {
- position->scale = 1.0;
- }
+ position->scale = 1.0;
return position_good;
}
@@ -497,42 +444,6 @@ nautilus_canvas_view_file_changed (NautilusFilesView *view,
NAUTILUS_CANVAS_ICON_DATA (file));
}
-static gboolean
-nautilus_canvas_view_supports_auto_layout (NautilusCanvasView *view)
-{
- NautilusCanvasViewPrivate *priv;
-
- g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
-
- priv = nautilus_canvas_view_get_instance_private (view);
-
- return priv->supports_auto_layout;
-}
-
-static gboolean
-nautilus_canvas_view_supports_scaling (NautilusCanvasView *view)
-{
- NautilusCanvasViewPrivate *priv;
-
- g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
-
- priv = nautilus_canvas_view_get_instance_private (view);
-
- return priv->supports_scaling;
-}
-
-static gboolean
-nautilus_canvas_view_supports_keep_aligned (NautilusCanvasView *view)
-{
- NautilusCanvasViewPrivate *priv;
-
- g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
-
- priv = nautilus_canvas_view_get_instance_private (view);
-
- return priv->supports_keep_aligned;
-}
-
static const SortCriterion *
nautilus_canvas_view_get_directory_sort_by (NautilusCanvasView *canvas_view,
NautilusFile *file)
@@ -541,11 +452,6 @@ nautilus_canvas_view_get_directory_sort_by (NautilusCanvasView *canvas_view,
g_autofree char *sort_by = NULL;
gboolean reversed;
- if (!nautilus_canvas_view_supports_auto_layout (canvas_view))
- {
- return get_sort_criterion_by_metadata_text ("name", FALSE);
- }
-
default_sort = get_default_sort_order (file);
g_return_val_if_fail (default_sort != NULL, NULL);
@@ -592,11 +498,6 @@ nautilus_canvas_view_set_directory_sort_by (NautilusCanvasView *canvas_view,
{
const SortCriterion *default_sort_criterion;
- if (!nautilus_canvas_view_supports_auto_layout (canvas_view))
- {
- return;
- }
-
default_sort_criterion = get_default_sort_order (file);
g_return_if_fail (default_sort_criterion != NULL);
@@ -611,56 +512,9 @@ nautilus_canvas_view_set_directory_sort_by (NautilusCanvasView *canvas_view,
}
static gboolean
-get_default_directory_keep_aligned (void)
-{
- return TRUE;
-}
-
-static gboolean
-nautilus_canvas_view_get_directory_keep_aligned (NautilusCanvasView *canvas_view,
- NautilusFile *file)
-{
- if (!nautilus_canvas_view_supports_keep_aligned (canvas_view))
- {
- return FALSE;
- }
-
- return nautilus_file_get_boolean_metadata
- (file,
- NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED,
- get_default_directory_keep_aligned ());
-}
-
-static void
-nautilus_canvas_view_set_directory_keep_aligned (NautilusCanvasView *canvas_view,
- NautilusFile *file,
- gboolean keep_aligned)
-{
- if (!nautilus_canvas_view_supports_keep_aligned (canvas_view))
- {
- return;
- }
-
- nautilus_file_set_boolean_metadata
- (file, NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED,
- get_default_directory_keep_aligned (),
- keep_aligned);
-}
-
-static gboolean
nautilus_canvas_view_get_directory_auto_layout (NautilusCanvasView *canvas_view,
NautilusFile *file)
{
- if (!nautilus_canvas_view_supports_auto_layout (canvas_view))
- {
- return FALSE;
- }
-
- if (!nautilus_canvas_view_supports_manual_layout (canvas_view))
- {
- return TRUE;
- }
-
return nautilus_file_get_boolean_metadata
(file, NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT, TRUE);
}
@@ -670,12 +524,6 @@ nautilus_canvas_view_set_directory_auto_layout (NautilusCanvasView *canvas_view,
NautilusFile *file,
gboolean auto_layout)
{
- if (!nautilus_canvas_view_supports_auto_layout (canvas_view) ||
- !nautilus_canvas_view_supports_manual_layout (canvas_view))
- {
- return;
- }
-
nautilus_file_set_boolean_metadata
(file, NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT,
TRUE,
@@ -772,10 +620,6 @@ nautilus_canvas_view_begin_loading (NautilusFilesView *view)
sort = nautilus_canvas_view_get_directory_sort_by (canvas_view, file);
update_sort_criterion (canvas_view, sort, FALSE);
- nautilus_canvas_container_set_keep_aligned
- (get_canvas_container (canvas_view),
- nautilus_canvas_view_get_directory_keep_aligned (canvas_view, file));
-
/* We must set auto-layout last, because it invokes the layout_changed
* callback, which works incorrectly if the other layout criteria are
* not already set up properly (see bug 6500, e.g.)
@@ -984,28 +828,6 @@ nautilus_canvas_view_get_selection (NautilusFilesView *view)
}
static void
-action_keep_aligned (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
-{
- NautilusFile *file;
- NautilusCanvasView *canvas_view;
- gboolean keep_aligned;
-
- canvas_view = NAUTILUS_CANVAS_VIEW (user_data);
- file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view));
- keep_aligned = g_variant_get_boolean (state);
-
- nautilus_canvas_view_set_directory_keep_aligned (canvas_view,
- file,
- keep_aligned);
- nautilus_canvas_container_set_keep_aligned (get_canvas_container (canvas_view),
- keep_aligned);
-
- g_simple_action_set_state (action, state);
-}
-
-static void
action_sort_order_changed (GSimpleAction *action,
GVariant *value,
gpointer user_data)
@@ -1102,7 +924,6 @@ layout_changed_callback (NautilusCanvasContainer *container,
const GActionEntry canvas_view_entries[] =
{
- { "keep-aligned", NULL, NULL, "true", action_keep_aligned },
{ "sort", NULL, "s", "'name'", action_sort_order_changed },
{ "zoom-to-level", NULL, NULL, "1", action_zoom_to_level }
};
@@ -1168,8 +989,8 @@ static void
nautilus_canvas_view_update_actions_state (NautilusFilesView *view)
{
GActionGroup *view_action_group;
+ GVariant *sort_state;
GAction *action;
- gboolean keep_aligned;
NautilusCanvasView *canvas_view;
NautilusCanvasViewPrivate *priv;
@@ -1179,45 +1000,33 @@ nautilus_canvas_view_update_actions_state (NautilusFilesView *view)
NAUTILUS_FILES_VIEW_CLASS (nautilus_canvas_view_parent_class)->update_actions_state (view);
view_action_group = nautilus_files_view_get_action_group (view);
- if (nautilus_canvas_view_supports_auto_layout (canvas_view))
- {
- GVariant *sort_state;
-
- /* When we change the sort action state, even using the same value, it triggers
- * the sort action changed handler, which reveals the selection, since we expect
- * the selection to be visible when the user changes the sort order. But we may
- * need to update the actions state for others reason than an actual sort change,
- * so we need to prevent to trigger the sort action changed handler for those cases.
- * To achieve this, check if the action state value actually changed before setting
- * it
- */
- sort_state = g_action_group_get_action_state (view_action_group, "sort");
-
- if (g_strcmp0 (g_variant_get_string (sort_state, NULL),
- priv->sort->action_target_name) != 0)
- {
- g_action_group_change_action_state (view_action_group,
- "sort",
- g_variant_new_string (priv->sort->action_target_name));
- }
- g_variant_unref (sort_state);
+ /* When we change the sort action state, even using the same value, it triggers
+ * the sort action changed handler, which reveals the selection, since we expect
+ * the selection to be visible when the user changes the sort order. But we may
+ * need to update the actions state for others reason than an actual sort change,
+ * so we need to prevent to trigger the sort action changed handler for those cases.
+ * To achieve this, check if the action state value actually changed before setting
+ * it
+ */
+ sort_state = g_action_group_get_action_state (view_action_group, "sort");
+
+ if (g_strcmp0 (g_variant_get_string (sort_state, NULL),
+ priv->sort->action_target_name) != 0)
+ {
+ g_action_group_change_action_state (view_action_group,
+ "sort",
+ g_variant_new_string (priv->sort->action_target_name));
}
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "sort");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
!showing_recent_directory (view) &&
!showing_search_directory (view));
- action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "keep-aligned");
- g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
- priv->supports_keep_aligned);
- if (priv->supports_keep_aligned)
- {
- keep_aligned = nautilus_canvas_container_is_keep_aligned (get_canvas_container (canvas_view));
- g_action_change_state (action, g_variant_new_boolean (keep_aligned));
- }
update_sort_action_state_hint (canvas_view);
+
+ g_variant_unref (sort_state);
}
static void
@@ -1935,52 +1744,6 @@ nautilus_canvas_view_get_id (NautilusFilesView *view)
}
static void
-nautilus_canvas_view_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- NautilusCanvasView *canvas_view;
- NautilusCanvasViewPrivate *priv;
-
- canvas_view = NAUTILUS_CANVAS_VIEW (object);
- priv = nautilus_canvas_view_get_instance_private (canvas_view);
-
- switch (prop_id)
- {
- case PROP_SUPPORTS_AUTO_LAYOUT:
- {
- priv->supports_auto_layout = g_value_get_boolean (value);
- }
- break;
-
- case PROP_SUPPORTS_MANUAL_LAYOUT:
- {
- priv->supports_manual_layout = g_value_get_boolean (value);
- }
- break;
-
- case PROP_SUPPORTS_SCALING:
- {
- priv->supports_scaling = g_value_get_boolean (value);
- }
- break;
-
- case PROP_SUPPORTS_KEEP_ALIGNED:
- {
- priv->supports_keep_aligned = g_value_get_boolean (value);
- }
- break;
-
- default:
- {
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- }
- break;
- }
-}
-
-static void
nautilus_canvas_view_dispose (GObject *object)
{
NautilusCanvasView *canvas_view;
@@ -2014,7 +1777,6 @@ nautilus_canvas_view_class_init (NautilusCanvasViewClass *klass)
nautilus_files_view_class = NAUTILUS_FILES_VIEW_CLASS (klass);
oclass = G_OBJECT_CLASS (klass);
- oclass->set_property = nautilus_canvas_view_set_property;
oclass->dispose = nautilus_canvas_view_dispose;
GTK_WIDGET_CLASS (klass)->destroy = nautilus_canvas_view_destroy;
@@ -2051,37 +1813,6 @@ nautilus_canvas_view_class_init (NautilusCanvasViewClass *klass)
nautilus_files_view_class->get_view_id = nautilus_canvas_view_get_id;
nautilus_files_view_class->get_first_visible_file = canvas_view_get_first_visible_file;
nautilus_files_view_class->scroll_to_file = canvas_view_scroll_to_file;
-
- properties[PROP_SUPPORTS_AUTO_LAYOUT] =
- g_param_spec_boolean ("supports-auto-layout",
- "Supports auto layout",
- "Whether this view supports auto layout",
- TRUE,
- G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY);
- properties[PROP_SUPPORTS_MANUAL_LAYOUT] =
- g_param_spec_boolean ("supports-manual-layout",
- "Supports manual layout",
- "Whether this view supports manual layout",
- FALSE,
- G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY);
- properties[PROP_SUPPORTS_SCALING] =
- g_param_spec_boolean ("supports-scaling",
- "Supports scaling",
- "Whether this view supports scaling",
- FALSE,
- G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY);
- properties[PROP_SUPPORTS_KEEP_ALIGNED] =
- g_param_spec_boolean ("supports-keep-aligned",
- "Supports keep aligned",
- "Whether this view supports keep aligned",
- FALSE,
- G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY);
-
- g_object_class_install_properties (oclass, NUM_PROPERTIES, properties);
}
static void
diff --git a/src/nautilus-global-preferences.c b/src/nautilus-global-preferences.c
index 94326b94a..d24db28c3 100644
--- a/src/nautilus-global-preferences.c
+++ b/src/nautilus-global-preferences.c
@@ -36,7 +36,6 @@ GSettings *nautilus_preferences;
GSettings *nautilus_compression_preferences;
GSettings *nautilus_icon_view_preferences;
GSettings *nautilus_list_view_preferences;
-GSettings *nautilus_desktop_preferences;
GSettings *nautilus_window_state;
GSettings *gtk_filechooser_preferences;
GSettings *gnome_lockdown_preferences;
@@ -61,7 +60,6 @@ nautilus_global_preferences_init (void)
nautilus_window_state = g_settings_new ("org.gnome.nautilus.window-state");
nautilus_icon_view_preferences = g_settings_new ("org.gnome.nautilus.icon-view");
nautilus_list_view_preferences = g_settings_new ("org.gnome.nautilus.list-view");
- nautilus_desktop_preferences = g_settings_new ("org.gnome.nautilus.desktop");
/* Some settings such as show hidden files are shared between Nautilus and GTK file chooser */
gtk_filechooser_preferences = g_settings_new_with_path ("org.gtk.Settings.FileChooser",
"/org/gtk/settings/file-chooser/");
diff --git a/src/nautilus-global-preferences.h b/src/nautilus-global-preferences.h
index 7c19ba1fd..3bfa87731 100644
--- a/src/nautilus-global-preferences.h
+++ b/src/nautilus-global-preferences.h
@@ -101,7 +101,6 @@ typedef enum
/* ellipsization preferences */
#define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT "text-ellipsis-limit"
-#define NAUTILUS_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT "text-ellipsis-limit"
/* List View */
#define NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL "default-zoom-level"
@@ -139,25 +138,12 @@ typedef enum
NAUTILUS_SIMPLE_SEARCH_BAR
} NautilusSearchBarMode;
-#define NAUTILUS_PREFERENCES_DESKTOP_FONT "font"
-#define NAUTILUS_PREFERENCES_DESKTOP_HOME_VISIBLE "home-icon-visible"
-#define NAUTILUS_PREFERENCES_DESKTOP_HOME_NAME "home-icon-name"
-#define NAUTILUS_PREFERENCES_DESKTOP_TRASH_VISIBLE "trash-icon-visible"
-#define NAUTILUS_PREFERENCES_DESKTOP_TRASH_NAME "trash-icon-name"
-#define NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE "volumes-visible"
-#define NAUTILUS_PREFERENCES_DESKTOP_NETWORK_VISIBLE "network-icon-visible"
-#define NAUTILUS_PREFERENCES_DESKTOP_NETWORK_NAME "network-icon-name"
-#define NAUTILUS_PREFERENCES_DESKTOP_BACKGROUND_FADE "background-fade"
-
/* bulk rename utility */
#define NAUTILUS_PREFERENCES_BULK_RENAME_TOOL "bulk-rename-tool"
/* Lockdown */
#define NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE "disable-command-line"
-/* Desktop background */
-#define NAUTILUS_PREFERENCES_SHOW_DESKTOP "show-desktop-icons"
-
/* Recent files */
#define NAUTILUS_PREFERENCES_RECENT_FILES_ENABLED "remember-recent-files"
diff --git a/src/nautilus-icon-names.h b/src/nautilus-icon-names.h
index 64574662c..f6f75a953 100644
--- a/src/nautilus-icon-names.h
+++ b/src/nautilus-icon-names.h
@@ -21,13 +21,6 @@
#define NAUTILUS_ICON_FOLDER_TEMPLATES "folder-templates-symbolic"
#define NAUTILUS_ICON_FOLDER_VIDEOS "folder-videos-symbolic"
-/* Icons for desktop */
-#define NAUTILUS_DESKTOP_ICON_DESKTOP "user-desktop"
-#define NAUTILUS_DESKTOP_ICON_TRASH "user-trash"
-#define NAUTILUS_DESKTOP_ICON_TRASH_FULL "user-trash-full"
-#define NAUTILUS_DESKTOP_ICON_HOME "user-home"
-#define NAUTILUS_DESKTOP_ICON_NETWORK "network-workgroup"
-
/* Fullcolor icons */
#define NAUTILUS_ICON_FULLCOLOR_FOLDER "folder"
#define NAUTILUS_ICON_FULLCOLOR_FOLDER_REMOTE "folder-remote"
diff --git a/src/nautilus-metadata.c b/src/nautilus-metadata.c
index bee04e7ca..e3a54eeba 100644
--- a/src/nautilus-metadata.c
+++ b/src/nautilus-metadata.c
@@ -27,9 +27,7 @@ static char *used_metadata_names[] =
NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT,
NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY,
NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED,
- NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED,
NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP,
- NAUTILUS_METADATA_KEY_DESKTOP_ICON_SIZE,
NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN,
NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED,
NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS,
diff --git a/src/nautilus-metadata.h b/src/nautilus-metadata.h
index c4a303ec5..35e18c3bc 100644
--- a/src/nautilus-metadata.h
+++ b/src/nautilus-metadata.h
@@ -37,11 +37,8 @@
#define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT "nautilus-icon-view-auto-layout"
#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY "nautilus-icon-view-sort-by"
#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED "nautilus-icon-view-sort-reversed"
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED "nautilus-icon-view-keep-aligned"
#define NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP "nautilus-icon-view-layout-timestamp"
-#define NAUTILUS_METADATA_KEY_DESKTOP_ICON_SIZE "nautilus-desktop-icon-size"
-
#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN "nautilus-list-view-sort-column"
#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED "nautilus-list-view-sort-reversed"
#define NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS "nautilus-list-view-visible-columns"
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 40ad2554d..173f3dfd0 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -23,7 +23,6 @@
#include "nautilus-properties-window.h"
-#include "nautilus-desktop-item-properties.h"
#include "nautilus-error-reporting.h"
#include "nautilus-mime-actions.h"
@@ -3155,22 +3154,6 @@ create_basic_page (NautilusPropertiesWindow *window)
gtk_widget_grab_focus (GTK_WIDGET (window->details->name_field));
}
- if (nautilus_desktop_item_properties_should_show (window->details->target_files))
- {
- GtkSizeGroup *label_size_group;
- GtkWidget *box;
-
- label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (label_size_group,
- GTK_WIDGET (window->details->name_label));
- box = nautilus_desktop_item_properties_make_box (label_size_group,
- window->details->target_files);
-
- gtk_grid_attach_next_to (window->details->basic_grid, box,
- GTK_WIDGET (window->details->name_label),
- GTK_POS_BOTTOM, 2, 1);
- }
-
if (should_show_file_type (window))
{
append_title_and_ellipsizing_value (window, grid,
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 789b89d2b..098d0914a 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -18,29 +18,6 @@
color: mix (@theme_selected_fg_color, @theme_selected_bg_color, 0.20);
}
-.nautilus-desktop.nautilus-canvas-item {
- color: @theme_selected_fg_color;
- text-shadow: 1px 1px black;
-}
-
-.nautilus-desktop.nautilus-canvas-item:active {
- color: @theme_text_color;
-}
-
-.nautilus-desktop.nautilus-canvas-item:selected {
- color: @theme_selected_fg_color;
-}
-
-.nautilus-desktop.nautilus-canvas-item:active,
-.nautilus-desktop.nautilus-canvas-item:hover,
-.nautilus-desktop.nautilus-canvas-item:selected {
- text-shadow: none;
-}
-
-.nautilus-desktop.nautilus-canvas-item:selected:backdrop {
- color: @theme_unfocused_selected_fg_color;
-}
-
/* Toolbar */
/* Here we use the .button background-image colors from Adwaita, but ligthen them,
diff --git a/src/resources/css/nautilus.css b/src/resources/css/nautilus.css
index 4f875e1e2..a85df669a 100644
--- a/src/resources/css/nautilus.css
+++ b/src/resources/css/nautilus.css
@@ -3,13 +3,6 @@
-gtk-outline-radius: 20px;
}
-.nautilus-desktop-window,
-.nautilus-desktop-window paned,
-.nautilus-desktop-window notebook,
-.nautilus-desktop-window notebook > stack {
- background: transparent;
-}
-
.nautilus-menu-sort-heading {
min-height: 26px;
padding-left: 5px;
diff --git a/src/resources/ui/nautilus-files-view-context-menus.ui
b/src/resources/ui/nautilus-files-view-context-menus.ui
index ba392663c..6469595bf 100644
--- a/src/resources/ui/nautilus-files-view-context-menus.ui
+++ b/src/resources/ui/nautilus-files-view-context-menus.ui
@@ -39,11 +39,6 @@
</section>
<section>
<item>
- <attribute name="label" translatable="yes">_Keep aligned</attribute>
- <attribute name="action">view.keep-aligned</attribute>
- <attribute name="hidden-when">action-disabled</attribute>
- </item>
- <item>
<attribute name="label" translatable="yes">Organize _Desktop by Name</attribute>
<attribute name="action">view.organize-desktop-by-name</attribute>
<attribute name="hidden-when">action-disabled</attribute>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]