Skip to content

Button to straighten horizon#21024

Open
stnKrisna wants to merge 10 commits into
darktable-org:masterfrom
stnKrisna:button-to-straighten-horizon
Open

Button to straighten horizon#21024
stnKrisna wants to merge 10 commits into
darktable-org:masterfrom
stnKrisna:button-to-straighten-horizon

Conversation

@stnKrisna
Copy link
Copy Markdown
Contributor

I've added a simple button that allows you to simply straighten horizon. Similar to how we can use right-click + drag. I think this should help new users easily adopt darktable.

image

@TurboGit
Copy link
Copy Markdown
Member

@lefth : Would that works for you regarding the similar PR (#20585) you've opened?

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

We already have the "double-click" on any slider to reset to defaults....

@stnKrisna
Copy link
Copy Markdown
Contributor Author

Improve visibility of the button
image

@TurboGit @lefth My change uses the same codepath as the right-click to straighten and it works within the "quick access" panel as well.
image

@stnKrisna
Copy link
Copy Markdown
Contributor Author

Implemented the requested feature under https://discuss.pixls.us/t/straighten-with-two-times-right-click/56648/13 and #20648
image

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

Honestly - maybe i am a bit stupid and don't get the point about this but - i don't understand the "problem" :-)

A simple left-double-click on any slider resets that to default - so here to zero. Why would an extra button/icon help in any way?

BTW i also don't get the one-line-problem in the same thread :-)

@stnKrisna
Copy link
Copy Markdown
Contributor Author

@jenshannoschwalm This has nothing to do with reseting the rotation value back to zero. The problem right now is that attempting to fix the horizon/rotating the photo is hard if you want precision. You'd have to toggle the overlay and fiddle with the slider or use right-click + drag to draw the line.

Im basically bringing this to darktable: https://youtu.be/gjyhUjhV1KU?t=33

Issue #20648 and discussion https://discuss.pixls.us/t/straighten-with-two-times-right-click/56648/13 with over 400 views

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

Aah, just compiled, tested and can see what it's about and how it works :-) Might indeed help. Sorry for the noise.

@stnKrisna
Copy link
Copy Markdown
Contributor Author

@jenshannoschwalm No worries

@TurboGit Im happy with the changes. Feel free to merge :)

@lefth
Copy link
Copy Markdown
Contributor

lefth commented May 16, 2026

I'd suggest the button needs to enable the module. Otherwise when you click it when the module is disabled, it changes the cursor but doesn't actually work. It feels broken in this case. And shouldn't the button background also change to the highlighted state when it's on? That's how the other two-state buttons work.

I'd suggest minor changes to the tooltip: to place the first point,\nthen right-click again to finish and rotate the image

Does that sound good to @TurboGit and/or @jenshannoschwalm?

About the UX: at first, I wanted to say this was redundant with the existing feature (right click and drag already exists), but left click and drag really is a lot easier to do quickly and accurately on a PC touchpad. I think it will be helpful.

And would @stnKrisna be willing to make a PR to add the new button to the docs here? https://github.com/darktable-org/dtdocs/blob/master/content/module-reference/processing-modules/rotate-perspective.md#rotate

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

I'd suggest the button needs to enable the module. Otherwise when you click it when the module is disabled, it changes the cursor but doesn't actually work.

I agree

And shouldn't the button background also change to the highlighted state when it's on? That's how the other two-state buttons work.

Isn't that already the case ?

@stnKrisna
Copy link
Copy Markdown
Contributor Author

Isn't that already the case ?

The button change state, yes. But not the background. I follow the eyedropper button on the exposure module. Probably just bad icon for the button

@lefth
Copy link
Copy Markdown
Contributor

lefth commented May 16, 2026

I follow the eyedropper button on the exposure module.

Oh, that's a good point. This button is more similar to the eye dropper button than most other button types.

@stnKrisna
Copy link
Copy Markdown
Contributor Author

I think we need a better icon for this button 😅

@stnKrisna
Copy link
Copy Markdown
Contributor Author

@lefth Both suggestions has been implemented

@TurboGit TurboGit added this to the 5.8 milestone May 16, 2026
@TurboGit TurboGit added feature: new new features to add scope: image processing correcting pixels labels May 16, 2026
@lefth
Copy link
Copy Markdown
Contributor

lefth commented May 17, 2026

I noticed another minor issue. With other pickers, the picking state is reset when the module is collapsed. It would make sense to do the same for this feature. I sometimes do that as a quick way to cancel the mouse operation, rather than clicking the dropper icon again.

I think we need a better icon for this button 😅

I think it's fine! If you want to tweak it, I'd put it a bit lower, but nobody has complained yet...

@lowieCOOL
Copy link
Copy Markdown

Does this also work for vertical references like the right click + drag? I use vertical most of the time.

@stnKrisna
Copy link
Copy Markdown
Contributor Author

@lowieCOOL Yep. It should work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: new new features to add scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants