Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fore-/Background color of 2nd level list header should take dark-mode into account #1601

Closed
buhtz opened this issue Jan 7, 2024 · 7 comments · Fixed by #1649
Closed

Fore-/Background color of 2nd level list header should take dark-mode into account #1601

buhtz opened this issue Jan 7, 2024 · 7 comments · Fixed by #1649
Assignees
Labels
Cosmetics appearance, icons, themes Discussion decision or consensus needed Low relevant, but not urgent Qt Qt bugs, code or features

Comments

@buhtz
Copy link
Member

buhtz commented Jan 7, 2024

BIT in light/white mode looks like this:
grafik
Screenshot was taken in Debian 12 with XFCE and Adwaita theme.

Take look to the three 2nd level headers and their color in dark mode.

grafik
Screenshot was taken in Debian 12 with XFCE and Adwaita Dark theme.

The color do not change because it is hard coded.

Todo:

  1. Doing research if Qt offers a way to create such a 2nd level header without explicit specifying its color. Does Qt offer a default color (depending on the used theme) for GUI elements like this?
  2. If the previous is not possible we should define a dark-theme color for that element and find a way to ask Qt if currently a dark- or light-mode is active.
  3. An alternative to 2 would be totally redesign this GUI elements to eliminate the need of such a 2nd level header. I don't have an idea about it yet and would recommend not to do it in the current state of our project.

These parts of the code are relevant here:

backintime/qt/app.py

Lines 1035 to 1039 in 9618d03

if not path:
item.setFont(0, qttools.fontBold(item.font(0)))
item.setFlags(Qt.ItemIsEnabled)
item.setBackground(0, QColor(196, 196, 196))
item.setForeground(0, QColor(60, 60, 60))

backintime/qt/qttools.py

Lines 551 to 560 in 9618d03

class HeaderItem(TimeLineItem):
def __init__(self, name, sid):
super(HeaderItem, self).__init__()
self.setText(0, name)
self.setFont(0, fontBold(self.font(0)))
self.setBackground(0, QColor(196, 196, 196))
self.setForeground(0, QColor(60, 60, 60))
self.setFlags(Qt.NoItemFlags)
self.setData(0, Qt.UserRole, sid)

@buhtz buhtz added Qt Qt bugs, code or features Discussion decision or consensus needed Cosmetics appearance, icons, themes Low relevant, but not urgent GOOD FIRST ISSUE Used by 24pullrequests.com to suggest issues HELP-WANTED Used by 24pullrequests.com to suggest issues labels Jan 7, 2024
@buhtz buhtz added this to the 2rd release from now milestone Jan 7, 2024
@buhtz
Copy link
Member Author

buhtz commented Jan 12, 2024

I am not able anymore to open BIT in dark mode. The desktop and all its applications are in dark mode but BIT does ignore it and comes up bright.

I also did sudo make uninstall && make clean && ./configure && make && sudo make install for common and qt folder.

I am confused. Might the dark BIT (from the screenshot above) be an some weeks old installation? Did something changed in the last weeks that could be related to the used theme?

@buhtz
Copy link
Member Author

buhtz commented Jan 12, 2024

DEBUG: [plugins/systrayiconplugin.py:76 init] System tray is available to show the BiT system tray icon
DEBUG: [common/pluginmanager.py:263 PluginManager.load] Add plugin systrayiconplugin.py
DEBUG: [qt/qttools.py:229 createQApplication] QT QPA platform plugin: xcb
DEBUG: [qt/qttools.py:230 createQApplication] QT_QPA_PLATFORMTHEME=<not set>
DEBUG: [qt/qttools.py:235 createQApplication] QT_STYLE_OVERRIDE=<not set>
DEBUG: [qt/qttools.py:238 createQApplication] QT active style: fusion
DEBUG: [qt/qttools.py:239 createQApplication] QT fallback style: 
DEBUG: [qt/qttools.py:240 createQApplication] QT supported styles: ['Windows', 'Fusion']
DEBUG: [qt/qttools.py:241 createQApplication] themeSearchPaths: ['/usr/local/share/icons', '/usr/share/icons', ':/icons']
DEBUG: [qt/qttools.py:242 createQApplication] fallbackSearchPaths: []

and

{
    "backintime": {
        "name": "Back In Time",
        "version": "1.4.2-dev",
        "latest-config-version": 6,
        "local-config-file": "/home/UsernameReplaced/.config/backintime/config",
        "local-config-file-found": true,
        "global-config-file": "/etc/backintime/config",
        "global-config-file-found": false,
        "started-from": "/usr/share/backintime/common",
        "running-as-root": false,
        "user-callback": "/home/UsernameReplaced/.config/backintime/user-callback",
        "keyring-supported": true
    },
    "host-setup": {
        "platform": "Linux-6.1.0-13-arm64-aarch64-with-glibc2.36",
        "system": "Linux #1 SMP Debian 6.1.55-1 (2023-09-29)",
        "OS": {
            "/etc/os-release": "Debian GNU/Linux 12 (bookworm)",
            "/etc/debian_version": "12.4\n"
        },
        "display-system": "x11",
        "locale": "de_DE, UTF-8",
        "PATH": "/home/UsernameReplaced/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/UsernameReplaced/.local/bin:/home/UsernameReplaced/.local/bin",
        "RSYNC_OLD_ARGS": "(not set)",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.11.2 main Mar 13 2023 12:18:29 CPython GCC 12.2.0",
        "python-executable": "/usr/bin/python3",
        "python-executable-symlink": true,
        "python-executable-resolved": "/usr/bin/python3.11",
        "sys.path": [
            "/usr/share/backintime/qt/plugins",
            "/usr/share/backintime/common/plugins",
            "/usr/share/backintime/plugins",
            "/usr/share/backintime/common",
            "/usr/share/backintime/qt",
            "/usr/lib/python311.zip",
            "/usr/lib/python3.11",
            "/usr/lib/python3.11/lib-dynload",
            "/usr/local/lib/python3.11/dist-packages",
            "/usr/lib/python3/dist-packages",
            "/usr/lib/python3.11/dist-packages"
        ],
        "qt": {
            "Version": "PyQt 5.15.9 / Qt 5.15.8",
            "Theme": "Tango",
            "Theme Search Paths": [
                "/usr/local/share/icons",
                "/usr/share/icons",
                ":/icons"
            ],
            "Fallback Theme": "",
            "Fallback Search Paths": []
        }
    },
    "external-programs": {
        "rsync": {
            "version": "3.2.7",
            "protocol": "31.0",
            "capabilities": {
                "file_bits": 64,
                "inum_bits": 64,
                "timestamp_bits": 64,
                "long_int_bits": 64,
                "socketpairs": true,
                "symlinks": true,
                "symtimes": true,
                "hardlinks": true,
                "hardlink_specials": true,
                "hardlink_symlinks": true,
                "IPv6": true,
                "atimes": true,
                "batchfiles": true,
                "inplace": true,
                "append": true,
                "ACLs": true,
                "xattrs": true,
                "secluded_args": "optional",
                "iconv": true,
                "prealloc": true,
                "stop_at": true,
                "crtimes": false
            },
            "optimizations": {
                "SIMD_roll": false,
                "asm_roll": false,
                "openssl_crypto": true,
                "asm_MD5": false
            },
            "checksum_list": [
                "xxh128",
                "xxh3",
                "xxh64",
                "md5",
                "md4",
                "sha1",
                "none"
            ],
            "compress_list": [
                "zstd",
                "lz4",
                "zlibx",
                "zlib",
                "none"
            ],
            "daemon_auth_list": [
                "sha512",
                "sha256",
                "sha1",
                "md5",
                "md4"
            ]
        },
        "ssh": "OpenSSH_9.2p1 Debian-2+deb12u1, OpenSSL 3.0.11 19 Sep 2023",
        "sshfs": "3.7.3",
        "encfs": "(no encfs)",
        "shell": "/bin/bash",
        "shell-version": "GNU bash, version 5.2.15(1)-release (aarch64-unknown-linux-gnu)"
    }
}

@buhtz
Copy link
Member Author

buhtz commented Jan 12, 2024

The screenshot was taken on a virtual machine using Debian 12.
My described problem about opening BIT "ignoring" the dark theme is related to a second Debian 12 machine (RaspberryPi) also using XFCE.

What could be different?

@emtiu
Copy link
Member

emtiu commented Jan 13, 2024

I see the same in my current Debian 12 testing for the dev branch (qt5). It's running 9618d03 from last week.

Screenshot_20240113_145711

@buhtz
Copy link
Member Author

buhtz commented Jan 14, 2024

I checked again the VM I used. It seems to be a difference between Qt5 and Qt6. Having a dark mode desktop but using dev branch (which uses Qt5) the GUI is bright. Using qt6migration branch the GUI is dark.

@buhtz
Copy link
Member Author

buhtz commented Jan 14, 2024

I found a way to use "color roles". Which one do you prefer the most? Here I use two different color roles ("PlaceholderText" and "WindowText") for the text color.

Dark mode

grafik

grafik

Light mode

grafik

grafik

@emtiu
Copy link
Member

emtiu commented Jan 15, 2024

I like the "PlaceholderText" variant a bit more, because the color is less "strong", which gives a better visual sense of sorting/overview/categorization, I think.

@buhtz buhtz removed GOOD FIRST ISSUE Used by 24pullrequests.com to suggest issues HELP-WANTED Used by 24pullrequests.com to suggest issues labels Jan 16, 2024
@buhtz buhtz self-assigned this Jan 16, 2024
@buhtz buhtz closed this as completed in ff294f7 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cosmetics appearance, icons, themes Discussion decision or consensus needed Low relevant, but not urgent Qt Qt bugs, code or features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants