Skip to content

C++ interchange of dark/light themes #273

Closed
@dpizetta

Description

I'm not sure if I should open a new issue or not, but I'll do it if I'm said to.

I've tried to add the new light style to DB Browser for SQLite. I want to provide three options: follow the desktop style, dark style and light style. I cannot add these two options with qdarkstyle at the same time. My impression is that the Qt or cmake generation for the resources are overlapped due to usage of the same file name for both savours. This is what I've changed in CMakeLists.tst to include both styles:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91573df6..22b1dbca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,7 +274,8 @@ set(SQLB_RESOURCES
        src/translations/flags/flags.qrc
        src/translations/translations.qrc
        src/certs/CaCerts.qrc
-       src/qdarkstyle/style.qrc
+       src/qdarkstyle/light/style.qrc
+       src/qdarkstyle/dark/style.qrc
 )
 
 set(SQLB_MISC

Only the last listed qrc can be used, probably because this file is generated twice: qrc_style.cpp

Which is the recommended way to include both? The instructions in the README have not been updated, by the way.

Originally posted by @mgrojo in #240 (comment)

I've worked around this problem renaming style.qrc to lightstyle.qrc and darkstyle.qrc accordingly. Please, let me know if there is a better way to do this, specially for not needing to change QDarkStyleSheet as provided.

Originally posted by @mgrojo in #240 (comment)

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