Skip to content

FR: Styles module: Add option to suppress preview#20255

Merged
TurboGit merged 15 commits intodarktable-org:masterfrom
deekayhd:styles_switch_preview
Feb 11, 2026
Merged

FR: Styles module: Add option to suppress preview#20255
TurboGit merged 15 commits intodarktable-org:masterfrom
deekayhd:styles_switch_preview

Conversation

@deekayhd
Copy link
Copy Markdown
Contributor

@deekayhd deekayhd commented Jan 31, 2026

This pull request is a solution proposal for the feature request #20176.
The tooltip of a style in the styles module in lighttable view contains a preview of the style applied to the selected image. Especially, on computers without a GPU it may take some time until the preview is rendered and shown. During this time the UI is non-reacting. This is especially annoying when accidentally hovering over a style while moving the mouse.
This pull request introduces a new toggle to switch off the preview.

image

The default setting of the new toggle is TRUE, so that the current default behaviour is not changed. Also, the state of the switch is not stored; it will be set again in a new darktable session.

I am aware of the discussion about guidelines for the suggestion of new features. This feature request originated from a discussion on pixls.us linked in the corresponding issue #20176. I am not sure if there is already any consensus about a new guideline, but since this is only a minor change, I thought that providing a PR does not harm.

closes #20176

@wpferguson
Copy link
Copy Markdown
Member

Do you know that if you turn off tooltips the previews wont display?

@deekayhd
Copy link
Copy Markdown
Contributor Author

Do you know that if you turn off tooltips the previews wont display?

Yes, I am aware of that. This was also suggested on pixls.us. But then, also the information about the modules involved in the preset is no longer shown. Furthermore, this affects all tooltips, which may not be desirable.

@wpferguson
Copy link
Copy Markdown
Member

Also, the state of the switch is not stored; it will be set again in a new darktable session.

I think I would store it. If a user goes to the effort to turn it off, then I think they expect it to stay off until they turn it back on.

Tested and it works fine.

@deekayhd
Copy link
Copy Markdown
Contributor Author

deekayhd commented Feb 1, 2026

I think I would store it.

Ok, you convinced me. I added storing the last state.

@TurboGit TurboGit added this to the 5.6 milestone Feb 2, 2026
@TurboGit TurboGit added priority: low core features work as expected, only secondary/optional features don't feature: new new features to add scope: UI user interface and interactions scope: DAM managing files, collections, archiving, metadata, etc. labels Feb 2, 2026
@TurboGit
Copy link
Copy Markdown
Member

TurboGit commented Feb 7, 2026

@deekayhd :

And as we are at it, why not use a combobox with 3 options:

  • no preview
  • small preview
  • large preview

The "small preview" being what we have today. The "no preview" your proposal here, and "large preview" to have a larger preview as being asked in pixlus.

@deekayhd
Copy link
Copy Markdown
Contributor Author

deekayhd commented Feb 7, 2026

@TurboGit Yes, why not, I am looking into it. Do you have a suggestion what the best size for large would be? I think the current size for the preview is 250. Maybe 500? Or make it a setting in darktablerc? I would not add it as a preference on the UI, though.

@TurboGit
Copy link
Copy Markdown
Member

TurboGit commented Feb 7, 2026

@TurboGit Yes, why not, I am looking into it. Do you have a suggestion what the best size for large would be? I think the current size for the preview is 250. Maybe 500? Or make it a setting in darktablerc? I would not add it as a preference on the UI, though.

Yes I would say between 400 & 500 I suppose. Let's start with 500 and will adjust the setting if needed.

@deekayhd
Copy link
Copy Markdown
Contributor Author

deekayhd commented Feb 7, 2026

The UI now looks like this:
image
And the combobox
image
In darktableconfig.xml.in min, max, and default values for the preview size are already defined. For the large perview the max value is taken and default remains at the current size.'
The sizes default and large also affect the preview size in the darkroom view. However, when preview is set to "no" in the light table, the preview is still at the default size in the darkroom. I think it does not make much sense to switch it off in darkroom.
See my last commits for the current version.

@TurboGit
Copy link
Copy Markdown
Member

TurboGit commented Feb 9, 2026

@deekayhd : Also the GitLab-CI failed because of an ambiguous code:

CMakeFiles/lib_darktable.dir/gui/styles_dialog.c.o.d -o bin/CMakeFiles/lib_darktable.dir/gui/styles_dialog.c.o -c /__w/darktable/darktable/src/src/gui/styles_dialog.c
/__w/darktable/darktable/src/src/gui/styles_dialog.c:1027:8: fatal error: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
 1027 |     if(!preview_mode==DT_STYLE_PREVIEW_NO) 
      |        ^            ~~
/__w/darktable/darktable/src/src/gui/styles_dialog.c:1027:8: note: add parentheses after the '!' to evaluate the comparison first
 1027 |     if(!preview_mode==DT_STYLE_PREVIEW_NO) 
      |        ^                                 
      |         (                                )
/__w/darktable/darktable/src/src/gui/styles_dialog.c:1027:8: note: add parentheses around left hand side expression to silence this warning
 1027 |     if(!preview_mode==DT_STYLE_PREVIEW_NO) 
      |        ^            
      |        (            )
1 error generated.

You probably meant:

if(preview_mode != DT_STYLE_PREVIEW_NO)

STYLE: Note the spaces around !=.

@deekayhd
Copy link
Copy Markdown
Contributor Author

deekayhd commented Feb 9, 2026

Also the GitLab-CI failed because of an ambiguous code:

Aah, forgot the parenthesis, sorry.
Still wondering, why 2 checks ended successfully.

Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to me now, thanks!

@TurboGit TurboGit merged commit c7be219 into darktable-org:master Feb 11, 2026
5 checks passed
@deekayhd
Copy link
Copy Markdown
Contributor Author

Thank you for merging.
Suggestion for release notes:
In the styles module, a new option has been added to control the preview size in the tooltip. The available options are: no preview, default size, and large size.

@deekayhd
Copy link
Copy Markdown
Contributor Author

deekayhd commented Mar 3, 2026

added PR #840 for enhancement of documentation.

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

Labels

documentation: pending a documentation work is required feature: new new features to add priority: low core features work as expected, only secondary/optional features don't scope: DAM managing files, collections, archiving, metadata, etc. scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Styles module: Add option to suppress preview

3 participants