Skip to content

Does not respect user theme #9

Open

Description

@littleblack111

Describe the bug

i have gtk theme and qt and kv theme set. it uses white

To reproduce

No response

Expected behavior

No response

Activity

  1. vimpostor commented on Apr 17, 2025

    @vimpostor
    Owner

    Yeah the dark mode support in Qt is a mess. It used to work with runtime theme changes, but now I can reproduce it only using the system theme on start (as long as you use the correct platformtheme plugin), but not changing it during runtime anymore.

    This diff seems to fix the problem, but I prefer to fix it upstream in Qt instead:

    diff --git a/src/qml/Main.qml b/src/qml/Main.qml
    index fbc3560..995f4cc 100644
    --- a/src/qml/Main.qml
    +++ b/src/qml/Main.qml
    @@ -11,7 +11,7 @@ ApplicationWindow {
     	title: Stdin.closed ? "Blobdrop" : "Reading from stdin..."
     	width: Settings.iconOnly ? Settings.thumbnailSize + 16 : 400
     	height: Math.max(48, Math.min(800, pathView.count ? pathView.contentHeight + 2 * pathView.anchors.topMargin : 350))
    -	Material.theme: Material.System
    +	Material.theme: Application.styleHints.colorScheme === Qt.ColorScheme.Dark ? Material.Dark : Material.Light
     	Material.primary: Material.Green
     	Material.accent: Material.Pink
     	Component.onCompleted: {

    It doesn't help, that Qt has implemented system theme detection in 4 different places, with all basically the same duplicated code:

    This kind of shit almost makes GTK look sane in comparison. All of the above four should be unified in one single interface, that's reused everywhere. So this probably needs some refactoring first.

    Edit: Upstream issue is here: https://bugreports.qt.io/browse/QTBUG-116197 and also similarly here https://bugreports.qt.io/browse/QTBUG-133044

  2. Aneeqasif commented on Sep 20, 2026

    @Aneeqasif

    any updates on this?

  3. vimpostor commented on Sep 20, 2026

    @vimpostor
    Owner

    any updates on this?

    For now you can use export QT_QPA_PLATFORMTHEME=xdgdesktopportal to force the platform theme, where I implemented support over 4 years ago.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions