! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Show current width and height of area
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-screenshooter
Component:
General

Comments

Description limero1337 2016-06-25 19:53:08 CEST
Created attachment 6713 
Cursor on OS X when taking an area screenshot

On OS X, when you drag the cursor to create a screenshot of a specific area, the current width and height of the area is shown next to the cursor. This let's the user quickly measure something on the screen without external programs and get a screenshot of an area with requested dimensions.

A feature similar to this should be implemented to Xfce4-screenshooter either as the default when creating a screenshot of an area or with a specific option set.

Attached is a picture on how it looks on OS X.
Comment 1 Simon Steinbeiss editbugs 2018-04-30 22:37:22 CEST
Created attachment 7693 
Patch that shows the width and height in composited environments
Comment 2 Andre Miranda editbugs 2018-05-01 02:40:41 CEST
It works neatly!

Just a couple of questions:
1) shouldn't we free css_string and coords, and perhaps unref css_provider and context?
2) when the cursor reaches the edge, the user can't see the values. Probably it would be over-engineering to handle this. What do you think?
3) I prefer the "%d x %d" format, is there any advantage to keep the line break?
Comment 3 Simon Steinbeiss editbugs 2018-05-01 07:47:29 CEST
ad 1) Yeah, sounds like a good idea (remember: I said hackidy-hacky implementation ;)) Might also be nicer to put the window and the label inside a struct or something or try to pass it around instead of making it a global var.
ad 2) That's the reason for 3) to some extent, because it makes the size label more compact and you're less likely to hit the right screen edge. I would also not try to handle this corner-case (pun intended) because it'd then have to overlay the area you wanna take a screenshot of and that could be irritating.

Finally I haven't made this optional (which was my original intention), not sure whether you want to.
Comment 4 Andre Miranda editbugs 2018-09-23 03:22:17 CEST
Created attachment 7995 
Updated patch

Updated patch:
1) coords and css_provider are now accordingly handled.
2) when the cursor reaches the edge, the size window is shifted so it won't be out of screen.
3) I went for the "%d x %d" format, now that the label won't be out of screen.

And other smaller improvements here and there.
Comment 5 Simon Steinbeiss editbugs 2018-12-22 21:36:18 CET
So this patch works quite nicely. I like how the label flips around when you reach the screen edges.

A few things I noticed:
* I noticed that the margin to the right is a bit more than to the left of the cursor (very minor)
* The actual format is "%dx%d", I guess if you really don't care about the width "%d x %d" would be better. I know "%d\n%d" is a bit unconventional, but I felt it was easily readable. (minor)
* I also preferred the text shadow with the 2px blur, a bit smoother than the current hard edge (very minor, opinion)

So all in all the patch is ready to go! All the above points are decisions that are up to you as the maintainer.
Well done!
Comment 6 Git Bot editbugs 2018-12-27 01:17:36 CET
Andre Miranda referenced this bugreport in commit 31bed658702f0e9a16ed5bcb712499fa39716c36

Show width and height of selection area (Bug #12664)

https://git.xfce.org/apps/xfce4-screenshooter/commit?id=31bed658702f0e9a16ed5bcb712499fa39716c36
Comment 7 Andre Miranda editbugs 2018-12-27 01:25:46 CET
(In reply to Simon Steinbeiss from comment #5)
> So this patch works quite nicely. I like how the label flips around when you
> reach the screen edges.
I'm glad you liked it :)

> A few things I noticed:
> * I noticed that the margin to the right is a bit more than to the left of
> the cursor (very minor)
I improved how the offset is calculated and now it uses monospace font.

> * The actual format is "%dx%d", I guess if you really don't care about the
> width "%d x %d" would be better. I know "%d\n%d" is a bit unconventional,
> but I felt it was easily readable. (minor)
Ok, went with spaces, I don't like macOS' format.

> * I also preferred the text shadow with the 2px blur, a bit smoother than
> the current hard edge (very minor, opinion)
That blur is barely visible and when that text is over a white part of screen, the crisp shadow provides better contrast.

> So all in all the patch is ready to go! All the above points are decisions
> that are up to you as the maintainer.
> Well done!

Thank you for the original implementation!

Bug #12664

Reported by:
limero1337
Reported on: 2016-06-25
Last modified on: 2018-12-27

People

Assignee:
Andre Miranda
CC List:
2 users

Version

Attachments

Additional information