Code Monkey home page Code Monkey logo

Comments (10)

Tudmotu avatar Tudmotu commented on May 24, 2024

Hi @erzzo
This is a very good suggestion (which was also raised in #37), and something that I would like to do some when, but unfortunately I don't have the time to implement this at the moment.
If you would like to implement this, I would greatly appreciate it and will help you with it as much as i can 😃

from gnome-shell-extension-clipboard-indicator.

danboid avatar danboid commented on May 24, 2024

I have just come here to request the exact same feature - it seems errzo beat me by a mere 9 hours! :)

I'm a heavy user of parcellite under X desktops, especially its 'persistent history' feature which is essentially what errzo is requesting here. It's the killer feature of clipboard tools for me.

I don't know any js but I know python and shell so I should be able to work it out easily enough. I'll have a go at adding this soon if no-one beats me to it.

from gnome-shell-extension-clipboard-indicator.

erzzo avatar erzzo commented on May 24, 2024

The stage is your's @danboid 👍

from gnome-shell-extension-clipboard-indicator.

danboid avatar danboid commented on May 24, 2024

I've had a quick look at this. I am new to both JS and Clutter/GNOME dev. Understanding JS won't be a problem, it is learning Clutter that represents the real effort in getting started here. My only experience with GUI programming so far has been PyQt but that seems to be much better documented than Clutter's JS bindings - in fact right now I'm under the impression that there isn't any official documentation for using Clutter via JS? The nearest I've found to some clutter/JS docs is this:

http://mathematicalcoffee.blogspot.co.uk/2012/09/gnome-shell-javascript-source.html

That's from 2012 though so in FOSS terms its archaic. Is there not some more recent docs?

I envision this feature to work as follows. The clipboard menu will have two areas: the 'normal' items in the upper area and the pinned/persistent items in the lower area. The items in the upper/normal section can be activated, removed or moved into the persistent list, whereas the pinned items can only be activated or removed.

My main question right now (apart from the docs issue) is how does @Tudmotu recommend I try implementing moving items into the persistent list? My preferred choice would be the user could right-click on an entry then choose 'Move to persistent' (or however we choose to phrase it - I don't think 'pin' is a good choice as it is getting moved) but I don't think that is an option because the popupmenu items don't seem to support being right-clicked so I think that leaves us with either adding a new icon to the right side of every upper menu item (next to the remove icon) or doing it via drag n' drop. The drag and drop method would mean less UI clutter but might not be as obvious and maybe isn't even possible within the GNOME popup menu?

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 24, 2024

Some when, a long time ago (couple of years), someone made a fork of this extension with this exact functionality - a drag-n-drop favorites section. At the time, I tried to merge it, but it was too diverged for me to be able to do that. I don't remember who that was or where their repository is unfortunately...

Anyway, drag-n-drop is possible, but I personally would prefer a ⭐ / bookmark icon next to the X button (but at a safe distance from it).

The implementation would require some changes to the cache file structure, to contain two lists: favorites and regular history. When the "favorite" button is clicked on an item, it will be moved from the regular to the favorites and back.
We need to add another menu section that will display the favorite clips, and we need to make sure the keyboard shortcuts support navigating between favorites/regular list (when you reach the end of the favorites, it moves to the regular list, when it reaches the end of the regular list it moves back to the favorites)

@danboid - you can find the clutter reference here: https://developer.gnome.org/clutter/stable/
It is for C, but the JS bindings are basically the same.
You can also find the GJS reference here: http://devdocs.baznga.org/
But generally speaking, there is not a lot of documentation.

from gnome-shell-extension-clipboard-indicator.

 avatar commented on May 24, 2024

Hello,

To implement favorites in PR #92, I add a boolean to each items which is toggle by a ⭐️ icon. Favorites are never automatically deleted except by clicking on the X icon next to it.

Those items are not moved to another menu as @Tudmotu suggest to let the list in order of history. I would like to know if you think it's enough or create another menu is required for a good enhancement.

from gnome-shell-extension-clipboard-indicator.

danboid avatar danboid commented on May 24, 2024

I'm glad I didn't get started on this seeing as freeroot seems to have done it already. It looks like his modifications do what I want although I haven't been able to get his PR code to work under GNOME 3.26.1 - GNOME Shell fails to load.

The only small advantage I can think of for having a separate list for favourites is that it makes it a little quicker to select them via the keyboard / directional arrows if they're all grouped together at the top or bottom but it could also be argued having just one contiguous fave list is cleaner.

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 24, 2024

I think we can start with favorites without a separate menu (as @freeroot implemented), and see in the future if we want to put the effort into a different section.

from gnome-shell-extension-clipboard-indicator.

 avatar commented on May 24, 2024

@danboid I forget to compile schemas again. It done so now it works again.

@Tudmotu I can add quickly a menu for favorites just below search. But, I believe in this case that search function will not filter favorites. If it's not a problem and if there is no other supposed issues, I can start to code it to finalize this PR.

from gnome-shell-extension-clipboard-indicator.

danboid avatar danboid commented on May 24, 2024

freeroot is right in saying the faves list would be best placed under the search box ie at the top of the menu/list.

I would be happy if the search only searched the non-fave items - in fact I think thats the best way for it to work. Personally, I think I'm unlikely to have so many faves that I need to search through them.

I've hit a couple of probs with the current code but I'll discuss them in the comments for the PR.

from gnome-shell-extension-clipboard-indicator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.