Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement to the pin tool #954

Open
hosiet opened this issue Sep 21, 2020 · 22 comments
Open

Improvement to the pin tool #954

hosiet opened this issue Sep 21, 2020 · 22 comments
Labels
Enhancement Feature requests and code enhancements Help Wanted Issues that the main devs need some help from community. Similar to "Good first issue" but harder.

Comments

@hosiet
Copy link
Member

hosiet commented Sep 21, 2020

Currently flameshot provides a simple implementation of image pinning. However, this implementation is quite simple. Once the image is pinned, it floats at the top of the desktop and can be dragged around, but that's basically everything. In order to close this pinned image, one will have to use the "Esc" key or double click on the image. Otherwise the only possible way is to close from the window list. This is not friendly to tablet users who have limited access to the keyboard.

I think the following improvements can be made:

  • Allow right click on the pinned image; a menu should pop out giving options to close the pinned image or save it as an image file on disk.
  • Document the usage of pin tool somewhere. I doubt users ever know the behavior of "double click to close".
@borgmanJeremy
Copy link
Contributor

This sounds like a great idea.

  1. Will right click work well on tablets? We have gotten a fair amount of feedback when features do not work well on touch interfaces. Perhaps a long press would activate it?

  2. For demonstrating the new features I think we can tie in a "Tip of the Day" to the welcome screen @mmahmoudian is working on.

@hosiet
Copy link
Member Author

hosiet commented Sep 22, 2020

1: I had some touchscreen laptops in the past; at least on Windows a long press will be automatically interpreted as right click.

2: That looks too heavy to me. We are not a full-featured IDE with tip-of-the-day window on startup...

@borgmanJeremy
Copy link
Contributor

Okay lets start working on just the menu part and for the tip of the day stuff we can discuss on #887

@mmahmoudian
Copy link
Member

I myself didn't know that double click works on pinned image.
it is clear that we suffer from poor documentation. the website should be also re-structured to have a dedicated section for UI and CLI.

About tip of the day, I agree that might be over-doing it, but I can also see some merits in it. The main question is how heavy would it get it we implement that in the welcome screen? if there is a dedicated box to show two lines of text randomly chosen from a pool.

@borgmanJeremy borgmanJeremy added Enhancement Feature requests and code enhancements Help Wanted Issues that the main devs need some help from community. Similar to "Good first issue" but harder. labels Sep 22, 2020
@holazt
Copy link
Member

holazt commented Sep 22, 2020

About the advanced features of Pin tools:

  1. right-click to bring up the editing tools back.
  2. accept external image drag and drop to replace the pinned image.
  3. when the mouse wheel is scrolling and zooming, the pin widget shows the zoom percentage on the top left corner of the image.

@mmahmoudian
Copy link
Member

@ZetaoYang I have flameshot-git (r576.f34def6-1 AUR) installed and none of the things you mentioned worked:

  1. right-click did not bring up any tools (double-right-clicking closed the pined window)
  2. drag and drop didn't work from Firefox and Pinta
  3. mouse wheel change the zoom (this is also something I didn't know), but no percentage were shown anywhere

@holazt
Copy link
Member

holazt commented Sep 23, 2020

@ZetaoYang I have flameshot-git (r576.f34def6-1 AUR) installed and none of the things you mentioned worked:

  1. right-click did not bring up any tools (double-right-clicking closed the pined window)
  2. drag and drop didn't work from Firefox and Pinta
  3. mouse wheel change the zoom (this is also something I didn't know), but no percentage were shown anywhere

I mean new features that flameshot can add in the future.

@mmahmoudian
Copy link
Member

@ZetaoYang 😅 seems I got too excited too early

@AlexP11223
Copy link
Contributor

AlexP11223 commented Sep 23, 2020

I and others from #554 want a way to remove border. It is implemented in #622 but we did not find a good way so far to introduce such setting except adding a separate option in the app settings. Preferably without the need to set it manually for each pin every time. It is not possible to add it in the side panel via a tool-specific widget like for Text because pin activates immediately. And using the global thickness value is not ideal too because then we would need to adjust it all the time when choosing other tools.

@mmahmoudian
Copy link
Member

I just realized that you cannot pin the image if the "close after capture" is on. Reported it as a [logical] bug in #964

@pauloo27
Copy link

pauloo27 commented Oct 1, 2020

About the advanced features of Pin tools:

  1. right-click to bring up the editing tools back.
  2. accept external image drag and drop to replace the pinned image.
  3. when the mouse wheel is scrolling and zooming, the pin widget shows the zoom percentage on the top left corner of the image.

What about having a command like flameshot pin <file> to pin from a file? I tried to do this once but (as expected from someone that doesn't know C/C++ and Qt) I couldn't make it work.

@mmahmoudian
Copy link
Member

@pauloo27 Two points here:

  1. I think you should create a new issue for this as a feature request as it is slightly off-topic here.
  2. This is my personal opinion: Flameshot is an screenshot app and it is not image viewer. Therefore, I suggest using an image viewer that is suggest in https://suckless.org/rocks/ . For example, feh.

@Robou
Copy link

Robou commented Oct 12, 2020

I just discovered this whole feature by reading this github issue section, even though I use flameshot on a daily basis since a couple of years haha. 🤣

  1. Allow right click on the pinned image; a menu should pop out giving options to close the pinned image or save it as an image file on disk.

  2. Document the usage of pin tool somewhere. I doubt users ever know the behavior of "double click to close".

  1. Good idea!
  2. I think the on-hover tooltips can be greatly enhanced and used more intensively.

I see several possibilities :

  1. More text displayed on hovering the buttons by writing more text on the on-hover Tooltips.
  2. Implementing a new tool beside the other tools, or accessible from the system-tray menu, with all the documentation on a single page or on a mini-wiki.
  3. Implementing a "What's this" mode: adding a new "?" button beside all the other tools, by using the QWhatsThis class instead of the basic QToolTip class. So you click the "What's this?" tool and the click on the tool you want to learn the usage, and then there is a small pop-up documenting the tool and all of its secrets.
  4. If it is only for documenting the Pin Tool, there could be a last solution : place a "?" button in a corner of the pinned image in order to have a popup with the instructions.

@MyriaCore
Copy link

What about having a command like flameshot pin <file> to pin from a file? I tried to do this once but (as expected from someone that doesn't know C/C++ and Qt) I couldn't make it work.

@pauloo27 @mmahmoudian A corollary of this is proposed over at #1100, in a way that I feel is more productive than exposing the pin tool specifically.

@AlexP11223
Copy link
Contributor

AlexP11223 commented Oct 25, 2020

#1100 probably can't allow #954 (comment) because it would probably need to have the titlebar in order to be movable while having editing tools, so it would still need to have some kind of pin mode (remove titlebar and tools).

Also saving + re-openning file is less convenient than just clicking the Pin tool.

@MyriaCore
Copy link

MyriaCore commented Oct 25, 2020

@AlexP11223 Funny, I was just writing up a border-removal proposal in a seperate issue. Thanks for your contribution!

I'm now realizing this might have been a communication issue, though. I didn't mean for my comment here to be part of #622 (comment), I was just trying to say that it would effectively deliver what @pauloo27 was describing in a way that might alleviate @mmahmoudian's concern that we'd be reducing flameshot to an image viewer.

NGL, it was kinda a weird decision to roll #622's discussion in here, since the challenges there are specific to that PR, and don't appear directly related to the issue topic, which seems to be more about improving the pin tool's docs and expanding flameshot's capabilities after an image has been pinned.

@fabianski7
Copy link

I use this tool to make "diffs" of screenshots by placing one side of the other, and often end up with multiple flameshot windows open. If it was possible to group all screenshots taken in a single window, grouped by tabs (like a browser), this would be ideal to avoid the accumulation of multiple windows of the same program

@mmahmoudian
Copy link
Member

mmahmoudian commented Feb 20, 2021

@fabianski7
I personally don't mind having it as an option, but imho it should by default act as it does at the moment as this is the intuitive way of pinning.

For your case, for the time being I can also suggest having CopyQ to store all your screenshots and then putting them in any order you want in something line LibreDraw or LibreImpress.

@aurirjr
Copy link

aurirjr commented Apr 13, 2021

I use pin eveyday, awesome tool. Anyone finds rotation useful? How about rotation while holding... ctrl? Wheel: Zooming. Ctrl+Wheel: Rotation.

@veracioux
Copy link
Contributor

veracioux commented Oct 12, 2021

I think #1565 provides an opportunity for a definitive solution, by virtue of the windowed capture mode implemented there.

Let me describe it with a scenario:

  • Open the capture GUI (as you normally would)
  • Select a region and pin it to the screen (as you normally would). Let's call this the original pin.
  • Perform some action on the pin window (right click, press Space or other, we should discuss this) that will open a capture GUI in windowed mode. The window should appear exactly where the original pin was and its contents the same as the original pin.
  • The newly opened capture GUI can be used as usual. You select a region and edit it as you wish. After that you can:
    • Accept the capture using the "Accept" button in Expand role of CaptureRequest and add Accept tool #1955. Except in this case the other "final actions" like save, copy etc. don't disappear. After you do that, the original pin will be closed and the newly selected screenshot pinned instead.
    • Save, copy pin and all the other actions you have normally available. In this case the original pin should remain on the screen.

When #1565 is merged, I think implementing this will be a piece of cake.

@mmahmoudian
Copy link
Member

Summary of the thread

Here I have summarized the current state of the ideas in this issue, and have added my personal opinion about some of them. Some sentences are slightly modified to fit in this summary.

OP

As @toofar kindly pointed out, the #2519 have addressed most part of the initial feature request of this issue.

The second part (documentation) can now be addressed partly using the website we have, and hopefully, partly with the "tip of the day" + "welcome screen".

Other ideas that was suggested along the way

@ZetaoYang

About the advanced features of Pin tools:

  • right-click to bring up the editing tools back.
  • accept external image drag and drop to replace the pinned image.
  • when the mouse wheel is scrolling and zooming, the pin widget shows the zoom percentage on the top left corner of the image.

Perhaps the second one is slightly out of context of a screenshot software, and also there are many good minimalistic image viewers (sxiv, imv, pqiv, feh, ...)

@pauloo27

CLI like flameshot pin to pin from a file?

Same as above

@Robou

  • Implementing a new tool beside the other tools, or accessible from the system-tray menu, with all the documentation on a single page or on a mini-wiki
  • Implementing a "What's this" mode by adding a new "?" button beside all the other tools, using the QWhatsThis class instead of the basic QToolTip class
  • place a "?" button in a corner of the pinned image in order to have a popup with the instructions

Even a keybinding can be added to trigger the "what is this" (my suggestion: ?

@fabianski7

  • group all screenshots taken in a single window, grouped by tabs (like a browser)

@aurirjr

  • rotation of the pin. Wheel: Zooming. Ctrl+Wheel: Rotation.

@veracioux

toofar added a commit to toofar/flameshot that referenced this issue Dec 27, 2023
Add a method to allow editing a pinned screenshot by initiating a new
screenshot over top of the pinned image, and then closing the old pinned image
on success.

This adds a new context menu to pinned screenshots. When selected the
PinWidget will call the daemon to do the work. Thus this functionality only
works when flameshot is running in daemon mode. The context menu options don't
show up when not running in daemon mode (I don't know why they don't show up,
other ones like the rotate and opacity ones also don't show up).

This is not the ideal method of doing this, it doesn't actually edit the
screenshot at all. I call it the "bait and switch" method of editing. The only
previous attempt that I've soon to do this got caught up in dealing with
screens with different DPI (pull/1565). While it would be amazing to be able
to limit the whole "grab" region to be less than a screen, or even just one
screen, I think this method of editing a pin in the full desktop cature mode
is a step forward. It sure is for my workflow anyhow.

I'm not familiar with c++ or this codebase so if there looks to be anything
weird in this PR it's probably due to ignorance.

I'm calling FlameshotDaemon from PinWidget, I'm not sure if I should be doing
that or trying to access the Flameshot singleton directly, I just copied off
of another tool which called `FlameshotDaemon::copyToClipboard()`.

I'm not sure if doing `.geometry() - .layout()->contentsMargins()` is the
correct way to get the image geometry, I was guided by what attributes I could
see in GammaRay while inspecting a running flameshot.

The method of disconnecting from the signals from within the lambdas is from
here: https://stackoverflow.com/questions/14828678/disconnecting-lambda-functions-in-qt5

I contemplated calling the method in Flameshot "replacePin" or
"captureFromPin" or something more technically accurate. But I figured the
signature could stay a bit optimistic and if people would like the behaviour
to be firmed up to match the goal in the future that could be done. Eg add
functionality to the CaptureWidget to make it so you can't modify the capture
region, change the grab region to be less than the whole desktop etc.

Known issues:

* you can move/resize the selection region, eg not just edit a pin but create
  a completely different one of a different region of the screen

Relates to: flameshot-org#954
toofar added a commit to toofar/flameshot that referenced this issue Dec 27, 2023
Add a method to allow editing a pinned screenshot by initiating a new
screenshot over top of the pinned image, and then closing the old pinned image
on success.

This adds a new context menu to pinned screenshots. When selected the
PinWidget will call the daemon to do the work. Thus this functionality only
works when flameshot is running in daemon mode. The context menu options don't
show up when not running in daemon mode (I don't know why they don't show up,
other ones like the rotate and opacity ones also don't show up).

This is not the ideal method of doing this, it doesn't actually edit the
screenshot at all. I call it the "bait and switch" method of editing. The only
previous attempt that I've soon to do this got caught up in dealing with
screens with different DPI (pull/1565). While it would be amazing to be able
to limit the whole "grab" region to be less than a screen, or even just one
screen, I think this method of editing a pin in the full desktop cature mode
is a step forward. It sure is for my workflow anyhow.

I'm not familiar with c++ or this codebase so if there looks to be anything
weird in this PR it's probably due to ignorance.

I'm calling FlameshotDaemon from PinWidget, I'm not sure if I should be doing
that or trying to access the Flameshot singleton directly, I just copied off
of another tool which called `FlameshotDaemon::copyToClipboard()`.

I'm not sure if doing `.geometry() - .layout()->contentsMargins()` is the
correct way to get the image geometry, I was guided by what attributes I could
see in GammaRay while inspecting a running flameshot.

The method of disconnecting from the signals from within the lambdas is from
here: https://stackoverflow.com/questions/14828678/disconnecting-lambda-functions-in-qt5

I contemplated calling the method in Flameshot "replacePin" or
"captureFromPin" or something more technically accurate. But I figured the
signature could stay a bit optimistic and if people would like the behaviour
to be firmed up to match the goal in the future that could be done. Eg add
functionality to the CaptureWidget to make it so you can't modify the capture
region, change the grab region to be less than the whole desktop etc.

Known issues:

* you can move/resize the selection region, eg not just edit a pin but create
  a completely different one of a different region of the screen

Relates to: flameshot-org#954
toofar added a commit to toofar/flameshot that referenced this issue Dec 27, 2023
Add a method to allow editing a pinned screenshot by initiating a new
screenshot over top of the pinned image, and then closing the old pinned image
on success.

This adds a new context menu to pinned screenshots. When selected the
PinWidget will call the daemon to do the work. Thus this functionality only
works when flameshot is running in daemon mode. The context menu options don't
show up when not running in daemon mode (I don't know why they don't show up,
other ones like the rotate and opacity ones also don't show up).

This is not the ideal method of doing this, it doesn't actually edit the
screenshot at all. I call it the "bait and switch" method of editing. The only
previous attempt that I've soon to do this got caught up in dealing with
screens with different DPI (pull/1565). While it would be amazing to be able
to limit the whole "grab" region to be less than a screen, or even just one
screen, I think this method of editing a pin in the full desktop cature mode
is a step forward. It sure is for my workflow anyhow.

I'm not familiar with c++ or this codebase so if there looks to be anything
weird in this PR it's probably due to ignorance.

I'm calling FlameshotDaemon from PinWidget, I'm not sure if I should be doing
that or trying to access the Flameshot singleton directly, I just copied off
of another tool which called `FlameshotDaemon::copyToClipboard()`.

I'm not sure if doing `.geometry() - .layout()->contentsMargins()` is the
correct way to get the image geometry, I was guided by what attributes I could
see in GammaRay while inspecting a running flameshot.

The method of disconnecting from the signals from within the lambdas is from
here: https://stackoverflow.com/questions/14828678/disconnecting-lambda-functions-in-qt5

I contemplated calling the method in Flameshot "replacePin" or
"captureFromPin" or something more technically accurate. But I figured the
signature could stay a bit optimistic and if people would like the behaviour
to be firmed up to match the goal in the future that could be done. Eg add
functionality to the CaptureWidget to make it so you can't modify the capture
region, change the grab region to be less than the whole desktop etc.

Known issues:

* you can move/resize the selection region, eg not just edit a pin but create
  a completely different one of a different region of the screen

Relates to: flameshot-org#954
@mmahmoudian
Copy link
Member

Update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and code enhancements Help Wanted Issues that the main devs need some help from community. Similar to "Good first issue" but harder.
Projects
None yet
Development

No branches or pull requests