Added showing coordinates when using Move Tool.
ClosedPublic

Authored by tantsevov on Jul 20 2016, 8:57 PM.

Details

Reviewers
dkazakov
Group Reviewers
Krita
Summary

Bug fix https://bugs.kde.org/show_bug.cgi?id=143306
Coordinates showing in floating message in format: X: x px, Y: y px.
X, Y means position of Left Top vertix.
Also there are two spin bars, which you can use for setting image position by keyboard (not only arrows)

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
tantsevov updated this revision to Diff 5369.Jul 20 2016, 8:57 PM
tantsevov retitled this revision from to Added showing coordinates when using Move Tool..
tantsevov updated this object.
tantsevov edited the test plan for this revision. (Show Details)
tantsevov added a reviewer: Krita.

Hi, @tantsevov!

Codewise, there are two minor issues, but they are not very serious. People can start testing this patch.

We need painters to check what they think about it. I have only two UIX related comments:

  1. The floating box looks ugly and eats the space of the working area of a user.
  2. The text in a message "%1 px, %2 px (%3 px, %4 px)" can be made more understandable somehow (we need to ask @timotheegiet, @Deevad and @scottpetrovic about how to do that)
plugins/tools/basictools/kis_tool_move.cc
291

Better use a projection(), because that is what the user sees when the layer is moves.

totalBounds |= node->projection()->nonDefaultPixelArea();

Try to add a transparency mask to a layer and test :)

332

There is a simple idiom for things like that in Qt:

totalTopLeft = QPoint();
dkazakov requested changes to this revision.Jul 21 2016, 6:07 AM
dkazakov added a reviewer: dkazakov.

Found an inconvenient thing

plugins/tools/basictools/kis_tool_move.cc
312

Btw, here I would expect m_accumulatedOffset.x()/y() added, to see the total offset of multiple drags. Right now you show an offset of a single drag only. It is hardly interesting for a user.

This revision now requires changes to proceed.Jul 21 2016, 6:07 AM
tantsevov updated this revision to Diff 5376.Jul 21 2016, 8:25 AM
tantsevov edited edge metadata.

Added showing total offset. Taken into account comments on the code.

I tested the last patch, I don't think it looks ugly (it looks the same as other notifications like zoom..), but it would be much better with labels for each value to directly know what they are.

Something like:

New position
X: value ; Y: value
Move distance:
X: value ; Y: value

tantsevov updated this revision to Diff 5387.Jul 21 2016, 11:11 AM
tantsevov edited edge metadata.

Added ability to switch method of showing coordinates in status bar. You can switch it by "choice" in code.

Also, I think an option to enable/disable this notification in the move tool options could be useful.

Also, I think an option to enable/disable this notification in the move tool options could be useful.

Can you please check new version with status bar?

I tested the last patch with coordinates in status bar, replacing all status bar content.
It seems to work good, but:
-it won't be visible in canvas only mode
-it goes away too fast maybe

Also, regardless of this, the notification should also be triggered when moving with arrow keys
(which allows to move precisely, when move tool is selected...)

tantsevov updated this revision to Diff 5423.Jul 22 2016, 10:28 AM
tantsevov marked 3 inline comments as done.

Now I kept only floating message. Coordinates showing when you move something with your computer mouse or with keys. This ability is switchable. You can toggle it on/off in Tool Option or by shortcut. Now it's Ctrl+Alt+Shift+C, but I can change it if someone tell me the right combination.
P. S. Changed format of message, as @timotheegiet advised. Now it has this format:
New position
X: value ; Y: value
Move distance:
X: value ; Y: value

tantsevov updated this revision to Diff 5454.Jul 22 2016, 9:35 PM

Update! =) Changed message format. Now it shows only position coordinates in format: X: x px, Y: y px. Also added two spin boxes for this cordinates, like in Transform Tool.

Ok. Found new bug =(. Don't try last patch please.

dkazakov added inline comments.Jul 23 2016, 8:21 AM
plugins/tools/basictools/kis_tool_move.cc
474

This function seems to be unused :)

tantsevov updated this revision to Diff 5463.Jul 23 2016, 3:11 PM
tantsevov updated this object.

Fixed bug which i founded today.

This revision looks very good, the only missing piece is a mouse-over message with the shortcut info on "Show coordinates on canvas" and its checkbox.

tantsevov updated this revision to Diff 5466.Jul 23 2016, 5:33 PM
tantsevov marked an inline comment as done.

Added tooltip for checkbox.

Good you added the tooltip, now add the current shortcut in it and it's good to go.

tantsevov updated this revision to Diff 5471.Jul 23 2016, 7:13 PM

Fixed bug with updating coordinates after switching nodes with active Move Tool. Now it updates correct (I hope).

dkazakov accepted this revision.Jul 23 2016, 9:20 PM
dkazakov edited edge metadata.

The patch works perfectly, thank you @tantsevov! I will push it as soon as the kde git will become up again :)

This revision is now accepted and ready to land.Jul 23 2016, 9:20 PM
rempt added a subscriber: rempt.Jul 24 2016, 9:27 AM

Very neat work!

dkazakov closed this revision.Aug 17 2016, 7:04 AM