summaryrefslogtreecommitdiff
path: root/src/nautilus-canvas-view.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for the SelectionEvent previewer signalCosimo Cecchi2019-08-291-0/+13
| | | | | | | And handle it by moving the selection in the current view. Once in a following commit we have the previewer follow the view selection, we'll achieve the desired effect of moving the preview with the selection.
* canvas-view: Remove can-accept-item leftoversErnestas Kulik2019-04-051-11/+0
| | | | Missed in cfb82a53a28b4e461361068967d109ceec2f46ec.
* file: Drop NAUTILUS_FILE_SORT_NONEAntónio Fernandes2018-12-071-7/+0
| | | | | | | | This was needed for manual layout, which was still used for handling desktop icons. Non-desktop views still have code to gracefully handle this value. With the refactoring from the last commit, we can finally drop this.
* file: Centralize getting default sort orderAntónio Fernandes2018-12-071-9/+2
| | | | | | | | | | | | nautilus_file_get_default_sort_type() has a misleading name. It doesn't actually get the default sort type for any folder, but only for certain special folders. For regular folders, the default comes from GSettings keys, but this is implemented in the views instead, with a lot of reduncant code. So, let's do that in nautilus_file_get_default_sort_type() directly, and clearly document it.
* files-view: Re-add _NETSCAPE_URL drop supportBastien Nocera2018-11-211-0/+14
| | | | | | | | | In dropping the support for creating website links from Firefox drops, commit 0e0f5b9 also removed the ability to handle _NETSCAPE_URLs at all. Re-add the necessary bits for drag'n'drop downloads to work as they did in GNOME 3.28. Closes: #687
* clipboard: Use text based clipboard onlyCarlos Soriano2018-08-021-7/+6
| | | | | | | | Now that we have better integration with the shell extension, and it simplifies regular clipboard handling. A nice feature is that now you can perform operations on GEdit or any other text editor by writing the correct commands :D
* nautilus-canvas-container: Remove the "include visible area" logic.Xiang Fan2018-07-131-6/+0
| | | | | | | | | | | | | | canvas_set_scroll_region_include_visible_area() was added in ec054c80981e26b71c8bb2e6853b035dc2063e7d to fix https://bugzilla.gnome.org/show_bug.cgi?id=42068 ("Dragging icons adjusts scroll area in a way that causes immediate scrolling"). This is no longer the case, because now icons remain in place when being dragged and are not allowed to be rearranged. ec054c80981e26b71c8bb2e6853b035dc2063e7d causes issues relating to extra scrolling space (#340), hence the removal. Fixes #340.
* file: Remove get_target_uriCarlos Soriano2018-05-091-1/+1
| | | | | | It's now effectively the same as get_uri since NautilusLink is gone. We need to think whether those need to be get_activation_uri though.
* general: Remove NautilusLinkCarlos Soriano2018-05-091-15/+0
| | | | | | | | | It was used for desktop files, netscape url links and other links. However this is not really useful anymore with the desktop gone, so it makes sense to remove it from Nautilus and have a big clean up. This also was one of the blockers for the backend rework.
* files-view: Avoid leaking selection list and dataAlexandru Fazakas2018-02-271-5/+3
| | | | | | | | | | | | | | Sometimes, while working with the files_view_get_selection function, the freeing is not done properly. We leak a lot of objects as of this and we need a way to fix it. To avoid leaking, we implemented g_autoptr support for NautilusFile in order to have at our disposal automatic, deep cleanup whenever we use the function. In this patch, we changed all calls to use g_autolist appropriately and bumped the glib dependency up to 2.55.1 (in order for us to use g_autolist). Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/226
* general: Run uncrustifyCarlos Soriano2018-02-131-1/+1
|
* files-view: Avoid futile castingAntónio Fernandes2018-01-301-5/+5
| | | | | | | | | | We are casting (cost GdkEvent *) to (GdkEvent *) back and forth, all because some files-view functions don't take a pointer to const GdkEvent as argument. But those functions don't actually change the event, so, make them take a pointer to const GdkEvent instead and drop unnecessary casting.
* files-view: Open context menu on longpressJan-Michael Brummer2018-01-301-4/+41
| | | | | | | | | | | | | An important portion of file management functionality is exclusively available through context menus. Currently, when using a touchscreen, there is no way to open a context menu. Fix this adding a longpress gesture to popup context menus on canvas view and list view. Closes: https://gitlab.gnome.org/GNOME/nautilus/issues/178
* canvas-view: Share common code for rectangle computationAntónio Fernandes2018-01-301-33/+34
| | | | | Make internal function for both _reveal_rectangle_for_context_menu() and _compute_rename_popover_pointing_to() to avoid code duplication.
* files-view: Pop up context menu near selectionAntónio Fernandes2018-01-301-0/+48
| | | | | | | | | | | | | | | | | | Context menus pop up where the pointer is, which is at the selection if the pointing device is used to open the menu. However, if the <Menu> key or <Shift>+<F10> keyboard shortcut are used, context menus still shows up wherever the pointer is, which may not be near the selected item at all. Instead, when the context menu is activated from the keyboard, show it next to the selected item. If multiple items are selected, show it next to the focused item. If the focus is not on a selected item, show it next to the selected item which is sorted the lowest. In all cases, scroll as necessary to make sure the whole item is visible. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=102666
* Revert "nautilus-canvas-view, nautilus-view-icon-controller: Add longpress ↵António Fernandes2018-01-281-41/+4
| | | | | | | | | | | | gesture to open context popup menu" This reverts commit e874ae70604de5f4893f011b0bf1c2eb339dd356. That commit has an incomplete commit message and didn't actually add the gesture to view-icon-controller. A reworked version of that commit will be reaplied at the end of this patch set.
* nautilus-canvas-view, nautilus-view-icon-controller: Add longpress gesture ↵Jan-Michael Brummer2018-01-231-4/+41
| | | | to open context popup menu
* general: Fix some details from the desktop removalCarlos Soriano2018-01-021-2/+0
| | | | Basically unused vars, etc.
* general: remove desktop supportErnestas Kulik2018-01-021-627/+59
|
* files-view: disable the reset zoom button by defaultDiana Grecu2017-06-241-0/+13
| | | | | | | | | The reset zoom button is sensitive even though the zoom percentage is already at 100%. Let the button be inactive if the zoom percentage is already at 100%. https://bugzilla.gnome.org/show_bug.cgi?id=771481
* views: handle keyboard activation in files-viewErnestas Kulik2017-05-141-9/+3
| | | | | | | | | | Each view handles keyboard activation on its own by listening to key-press-event, yet there are actions in files-view that could handle it. This commit makes it so, additionally swapping the accelerators for opening in new tab and window to make things more consistent throughout the application (and others, too, e.g. Firefox). https://bugzilla.gnome.org/show_bug.cgi?id=782600
* files-view: Remove directory parameter from add_files signalCarlos Soriano2017-03-301-4/+1
| | | | | It's not longer necessary. This patch removes it and also fixes a compiler warning.
* general: add recency sort for recent filesCarlos Soriano2017-02-201-0/+7
| | | | | | | | | | | | | | | | The sort order is based on atime currently, which is problematic, because some daemons (i.e. dropbox) randomly accesses files and changes atime... Instead we should just take into account when the user accessed. Recently glib and gvfs added a new attribute in the recent namespaces G_FILE_ATTRIBUTE_RECENT_MODIFIED or "recent::modified" that we can use to sort correctly the files in Recent. This patch adds this attribute and corresponding columns etc. to the file data and views and makes it the default sorting when in Recent. https://bugzilla.gnome.org/show_bug.cgi?id=777507
* canvas-view: fix default zoom level to LARGECarlos Soriano2017-02-151-1/+1
| | | | | We have been using the LARGE as default level for some time, make sure we return that in case of errors.
* views: add flow box based viewCarlos Soriano2017-02-151-8/+12
| | | | | | | | | | | | | | | | | | | | | | | After all the rework on the window slots, views, and splitting the desktop, we are finally able to add a flow box based view for Nautilus. The GtkFlowBox is still not performance enough to be added as the default view, not even as an alternative in the user preferences. However, since the work on this is one of the biggest for Nautilus and gtk+, the decision was to merge a prototype in order to open the development, testing and iteration of the code in order to make it good enough for, in a not so far away future, have it as the main view. The work merged is not finished, and is an experiment and prototype in more things than just the GtkFlowBox, we want to create a single shared model with a complete MVC pattern between all the views. This will need quite a few iterations to get it right, but once is done right, I hope it's going to be good enough as an example to any application that wants multiple types of views with the new widgets of gtk+. This patch adds the GtkFlowBox view to be optionally used under a gsetting called use-experimental-views, turned off by default.
* canvas-view: port to G_DECLARE* type declarationRohit Kaushik2017-02-031-48/+81
| | | | | | | | This patch reduces the manual definition of macros and ports it to G_Declare type declaration, which make the code cleaner and easier to read and understand. https://bugzilla.gnome.org/show_bug.cgi?id=777607
* general: format code with newer UncrustifyCarlos Soriano2016-11-301-82/+81
| | | | | Some issues were fixed, and now we can rerun Uncrustify to format correctly more part of the code.
* view: make icon getter staticCarlos Soriano2016-11-231-14/+1
| | | | | | | | | | | | | | We were relying on the current view to return the icon to put in the toolbar, however that requires a view instance and also we cannot control really what icon we want to show in which circumstances. We want more control about that, so we need a single entry point where we can get the icon to show depending on the known view types we have. So this patch converts the view property to a static method. https://bugzilla.gnome.org/show_bug.cgi?id=771075
* canvas-view: don't crash on view leaksCarlos Soriano2016-10-051-10/+11
| | | | | | | | | | | | | Similar to previous commit but for the canvas view. Although we all love how Nautilus keeps us on the belt crashing when there is a leak, users are not happy about that. So let's make nautilus more docile and don't crash in case there is a view leak. For that, disconnect all signals in the dispose handler rather than in finalize. https://bugzilla.gnome.org/show_bug.cgi?id=772462
* general: rework clipboard handlingCarlos Soriano2016-09-291-35/+84
| | | | | | | | | | | | | | | | | | | | | | | We were using a custom clipboard monitor, due to some old behaviour in 2004 where not all X servers supported XFIXES, which allows to monitor global clipboard changes between processes, which are needed in Nautilus for copy, paste and link operations, and their availability check. Since Nautilus was a single process, it was working for most of the time. However recently we split the desktop in a different process, so we were not able to correctly set the GDK action for clipboard, since we were relying on sharing the same clipboard in the same process. In order to fix this, this patch reworks the clipboard handling to a more modern way, using the owner-changed signal present in XFIXES. This fixes the clipboard changing between the desktop and Nautilus and interproccess clipboard handling, fixes small corner cases, and in the way this patch makes the code design and ownership of clipboard more clearer. https://bugzilla.gnome.org/show_bug.cgi?id=771046
* general: run uncrustifyCarlos Soriano2016-08-291-1228/+1350
| | | | | | | | And make the style of Nautilus the same for all files. Hopefully we can fix all the style issues we can find in the next days, so expect a little of movement on this. https://bugzilla.gnome.org/show_bug.cgi?id=770564
* files-view: correct method nameRazvan Chitu2016-08-191-2/+2
| | | | | | | The method 'compute_rename_popover_relative_to' has a misleading name because it actually computes the item that the popover will point to. https://bugzilla.gnome.org/show_bug.cgi?id=769336
* files-view: obsolete restoring default zoom levelErnestas Kulik2016-06-241-13/+0
| | | | | | | | Restoring to the default zoom level does not work anymore, as Nautilus sets the default level to the current one. This commit removes the restore functionality. https://bugzilla.gnome.org/show_bug.cgi?id=763948
* canvas-view: improve usability of sort optionsNeil Herald2016-06-221-172/+91
| | | | | | | | | | | | | | | | | The sort options shown on the toolbar menu aren't very intuitive. For example, 'last modified, reverse order' can be interpreted a number of ways. They also require the user to set both the sort order and whether the sort should be reversed. These issues have been addressed by replacing the sort order items that are often sorted in either ascending and descending order (e.g. name) with options that are better to use (e.g. A-Z and Z-A). Options that are generally only sorted one way (e.g. type) have been changed to sort in ascending/descending as appropriate for the option. This is part of the toolbar menu redesign to improve the usability of the menus. https://bugzilla.gnome.org/show_bug.cgi?id=764632
* toolbar-view-menu: replace zoom slider with buttonsNeil Herald2016-06-221-0/+20
| | | | | | | | | | Convert the zoom slider into a horizontal button list, with a button in the middle to show the current zoom level percentage. This is part of the toolbar menu redesign to improve the usability of the menus. https://bugzilla.gnome.org/show_bug.cgi?id=764632
* Only save zoom level if the user has updated itMike Gorse2016-06-201-3/+6
| | | | | | | | | Don't write the zoom level to gsettings if the user has not made a change from the system default. This allows an update to be installed and then rolled back without a system default from the update having been written to the user's configuration. https://bugzilla.gnome.org/show_bug.cgi?id=767878
* files-view: reveal file after renaming or creatingCarlos Soriano2016-04-271-0/+2
| | | | | | | | | | | | | | We want to reveal the file that was just renamed. In order to do that, we have to make sure the view has the icon and all changes were acknowledge, and only then, reveal the file. In this patch, we implement this creating a hash table that will hold any file that needs to be revealed when the view acknowledges it. Functions using this will be the renaming of files, the creation of folders, and the creation of folders with selection. https://bugzilla.gnome.org/show_bug.cgi?id=764137
* general: merge libnautilus-private to srcwip/csoriano/private-to-srcCarlos Soriano2016-04-251-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And fix make distcheck. Although libnautilus-private seem self contained, it was actually depending on the files on src/ for dnd. Not only that, but files in libnautilus-private also were depending on dnd files, which you can guess it's wrong. Before the desktop split, this was working because the files were distributed, but now was a problem since we reestructured the code, and now nautilus being a library make distcheck stop working. First solution was try to fix this inter dependency of files, but at some point I realized that there was no real point on splitting some of those files, because for example, is perfectly fine for dnd to need to access the window functions, and it's perfectly fine for the widgets in the private library to need to access to all dnd functions. So seems to me the private library of nautilus is somehow an artificial split, which provides more problems than solutions. We needed libnautilus-private to have a private library that we could isolate from extensions, but I don't think it worth given the problems it provides, and also, this not so good logical split. Right now, since with the desktop split we created a libnautilus to be used by the desktop part of nautilus, extensions have access to all the API of nautilus. We will think in future how this can be handled if we want. So for now, merge the libnautilus-private into src, and let's rethink a better logic to split the code and the private parts of nautilus than what we had. Thanks a lot to Rafael Fonseca for helping in get this done. https://bugzilla.gnome.org/show_bug.cgi?id=765543
* canvas-view: allow creation of canvas view container subclassesCarlos Soriano2016-04-141-4/+16
| | | | | | | This will be used by the desktop, so it can use its own canvas-view-container. https://bugzilla.gnome.org/show_bug.cgi?id=712620
* canvas-view: remove unneeded desktop dependencyCarlos Soriano2016-04-141-2/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=712620
* file-dnd: move dnd handling to fileCarlos Soriano2016-04-141-1/+0
| | | | | | | | | | | | | | | | | We are requiring file handling like special casing subclasses in the dnd handling. We are currently doing it outside of nautilus class... which makes overriding on subclasses impossible. This design goes against inheritance design, so there is no point on making it that way if it defeats this purpose. So merge the handling of file dnd inside the file class itself, and in upcoming patches we will override that handling in order to use inheritance instead of special casing in the parent. https://bugzilla.gnome.org/show_bug.cgi?id=712620
* file: rename get_drop_target_uriCarlos Soriano2016-04-141-1/+1
| | | | | | | | | | | | | | | | | This get target uri is used for those which we have special handling on the activation uri, instead of the usual glib attribute G_FILE_ATTRIBUTE_STANDARD_TARGET_URI. So it behaves like a supergroup of those which have G_FILE_ATTRIBUTE_STANDARD_TARGET_URI, but we use it in the same way. We use for handling special files like desktop links on drag and drop, etc. However, this is useful for other parts of nautilus, and we will use it in a upcoming patch, so we can rename it in order to communicate the wide nature of the function. https://bugzilla.gnome.org/show_bug.cgi?id=712620
* files-view: remove unused get_icon_locations vfuncCarlos Soriano2016-04-141-11/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=712620
* files-view: remove unused can_rename_file vfuncCarlos Soriano2016-04-141-7/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=712620
* general: remove vim modelinesCarlos Soriano2016-04-041-1/+0
| | | | | | | | | | | | | Vim and emacs modelines are used to specify some of the code style in the code. However, this is misleading and poorly supported since nautilus had a mix of code style for some time. Also, the mode lines doesn't specify the whole code style, so we will need to use a different tool as well to specify the whole code style. For that, we can just use a different tool for everything. So remove the mode lines, and in a short future we will reestyle the nautilus code to have a single code style, and use a tool like editorconfig to specify the whole code style.
* do not switch focus to new tabsRazvan Chitu2016-03-291-0/+1
| | | | | | | | | | In Nautilus, when a location is opened in a new tab, the new tab gets automatically focused. This behavior is not consistent with other tab-based applications, such as browsers - Epiphany, Firefox, Chromium to name a few. It is also a regression, since this behavior was not present in 3.14. In order to fix this, set a flag so the new tab is not made active. https://bugzilla.gnome.org/show_bug.cgi?id=764035
* canvas-view: update modelineCarlos Soriano2016-03-141-1/+1
|
* general: add another zoom levelCarlos Soriano2016-02-241-4/+4
| | | | | | | | | | | | | | | | In icon view, add a smaller zoom level to be able for dense views, and increase the default padding to allow the labels enough space. Now levels are 48px, 64px, 96px and 128px for icon view, instead of only 64px, 96px and 128px, but with the increased padding the 64px and 48px are useful. List view also gains a bigger level, and they become 16px, 32px, 48px, 64px. Also, adjust the label max width to be larger, but inside the icon itself. This fixes the label not taking advantage of all the width the icon provides, and also a few cases where icons were misaligned.
* search: use a separate view setting for searchCarlos Soriano2016-02-121-2/+2
| | | | | | | | | | | | So we can select what type of view do we want for search independently of what we normally use. This is needed since we default to switch to list view for search, but we would like to allow users to select a different view. However, instead of adding a preference in the preference dialog, we can do it more straightforward and change the setting when we are in search. On the way, rework all the enums and views id for a saner code...
* canvas-view: improve comment wordingCarlos Soriano2015-12-111-2/+2
|