Skip to content

feat: Add --dark flag to iv for Dark Mode#5019

Open
sh4shv4t wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
sh4shv4t:iv-dark-mode
Open

feat: Add --dark flag to iv for Dark Mode#5019
sh4shv4t wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
sh4shv4t:iv-dark-mode

Conversation

@sh4shv4t
Copy link

Fixes #4710

Description

This PR implements the core Dark Mode logic for the iv viewer.

Current Implementation:

  • Added a --dark command-line argument.
  • Sets the Qt style to "Fusion" and applies a custom dark QPalette.
  • Verified on Windows 11.

Note on Preferences:
I noticed the request in the issue to add this to the Preferences Menu for persistence. I wanted to submit the CLI implementation first to verify that the Fusion style and color palette meet the project's visual standards.

Once this styling is approved, I am happy to add the Preferences toggle and persistence logic in a follow-up commit to this PR.

Tests

  • Ran iv.exe --dark test_image.jpg: Verified the UI loaded in dark mode.
  • Ran iv.exe test_image.jpg: Verified the UI loaded in standard mode.

Checklist:

  • I have read the guidelines on contributions and code review procedures.
  • I have updated the documentation (The --help output is automatically updated).
  • I am sure that this PR's changes are tested somewhere in the testsuite (Verified manually).
  • I have run and passed the testsuite in CI before submitting the PR (Verified build locally).
  • My code follows the prevailing code style of this project.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 28, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: sh4shv4t / name: Shashvat Singh (72ec5b3)

Signed-off-by: sh4shv4t <shashvat.kk@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
@sh4shv4t
Copy link
Author

Hi @lgritz, could you please have a look at this PR once? I have added the styling via a --dark command-line argument and will add the Preferences toggle and persistence logic once the styling is approved.

@lgritz
Copy link
Collaborator

lgritz commented Mar 1, 2026

Sorry for the delay. I actually did test this but had mixed results.

I tried both on my personal Mac, and on my work Linux machine. In both cases, I saw minimal change, but maybe that's because I run in dark mode? Is it possible that Qt behavior is that the OS display choices explicitly choosing dark mode impose a dark palette and so this makes a visible change only if your OS and user choices are light mode? Or is it possible that it only makes a difference on certain window managers, or on MS Windows (which I couldn't test)?

Can you please post images showing the before and after appearance of iv that you expect with these changes?

It's 100% ok with me if all this effectively does is make it look dark when in light OS mode, but on effect if you've already selected dark mode and imposed a dark palette across the board. That still would be an acceptable patch.

My bigger concern, though, was that I -- totally coincidentally, I would not have consciously thought to try this -- tested it by displaying an image that happened to have an alpha channel and was transparent in some places, and this patch (versus main) definitely led to a different appearance in the "transparent" pixels. It must somehow change the background color? I would like for you to test this and track it down, we wouldn't this to inadvertently change/lighten the background pixel color for pixels with non-1.0 opacity.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iv Dark mode

2 participants