{"id":15059827,"url":"https://github.com/mguludag/qstylehelper","last_synced_at":"2025-04-10T05:42:48.246Z","repository":{"id":122039909,"uuid":"595642490","full_name":"mguludag/QStyleHelper","owner":"mguludag","description":"A Helper class for managing QStyle, QPalette, TitleBar Color on Windows and auto detect color scheme changes.","archived":false,"fork":false,"pushed_at":"2023-02-27T20:34:09.000Z","size":107,"stargazers_count":33,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T06:54:41.470Z","etag":null,"topics":["acrylic","linux","mica","qml","qstyle","qt","qt5-gui","qtwidgets","windows","windows-10","windows-11","winui"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mguludag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-31T14:12:33.000Z","updated_at":"2025-01-31T03:59:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"124ddc60-6963-4f1b-98ec-507be9795cc0","html_url":"https://github.com/mguludag/QStyleHelper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguludag%2FQStyleHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguludag%2FQStyleHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguludag%2FQStyleHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguludag%2FQStyleHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mguludag","download_url":"https://codeload.github.com/mguludag/QStyleHelper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166607,"owners_count":21058478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acrylic","linux","mica","qml","qstyle","qt","qt5-gui","qtwidgets","windows","windows-10","windows-11","winui"],"created_at":"2024-09-24T22:48:25.380Z","updated_at":"2025-04-10T05:42:48.231Z","avatar_url":"https://github.com/mguludag.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QStyleHelper\nA Helper class for managing QStyle, QPalette, TitleBar Color on Windows and auto detect color scheme changes.\n\n## Features\n* Auto dark mode app style, titlebar and titlebar context menu on windows \n* Supports Mica style on Windows 11 (you have to set background transparent)\n* Supports Acrylic Transparent Blur on Windows 10/11 (you have to set background transparent)\n* Setting your custom dark/light palette\n* Provide signal for system dark/light scheme changes (useful for changing your app icons)\n\n\n\nhttps://user-images.githubusercontent.com/12413639/216264921-933c2670-b1d5-4b67-8624-c5c8aaf39ecd.mp4\n\nhttps://user-images.githubusercontent.com/12413639/216384897-b8f63c3a-2658-4637-acaa-d85e74e75869.mp4\n\n\n\n\n## Usage for Qt Widgets\n### main.cpp\n```C++\n#include \"mainwindow.h\"\n#include \"qstylehelper.hpp\"\n#include \u003cQApplication\u003e\n\n\nint main(int argc, char *argv[])\n{\n    // this function uses new Qt \u003e= 5.15 win32 dark titlebar environment \n    QStyleHelper::setTitleBarDarkColor();\n\n    QApplication a(argc, argv);\n    MainWindow w;\n    \n    // if you want to use Mica or Acrylic Blur you have to set background transparent\n    w.setAttribute(Qt::WA_TranslucentBackground);\n    \n    // this is for Windows 11\n    // example use of Mica, second bool parameter is setting acrylic transparent for mica\n    QStyleHelper::setMica({w});\n    \n    // this is for Windows 10/11 but resize performance is slow (deprecated)\n    // example use of Acrylic Blur Window, second bool parameter is setting acrylic transparent for it\n    QStyleHelper::setAcrylicBlurWindow({w}, true);\n    \n    \n    // if your Qt version older than 5.15 use it like this for win32 dark titlebar environment and also you have to call once for any subwindows \n    QStyleHelper::setTitleBarDarkColor({w});\n    \n    // initialize the instance and set desired look you want, also you can set any custom QPalette for dark and light scheme separately \n    QStyleHelper::instance().setDarkPalette().setWidgetStyle(\"fusion\").setAutoChangePalette(true);\n    \n\n    // this connection and QStyleHelper::colorSchemeChanged signal for monitor windows dark/light mode changes\n    QObject::connect(\u0026QStyleHelper::instance(), \u0026QStyleHelper::colorSchemeChanged, [\u0026w](bool dark) \n                     { QStyleHelper::setMica({w}); QStyleHelper::setTitleBarDarkColor({w}, dark); });\n\n    w.show();\n\n    return a.exec();\n}\n```\n\n## Usage for Qt Quick\n### main.cpp\n```C++\n#include \u003cQGuiApplication\u003e\n#include \u003cQQmlApplicationEngine\u003e\n#include \"qstylehelper.hpp\"\n\nint main(int argc, char *argv[])\n{\n#if QT_VERSION \u003c QT_VERSION_CHECK(6, 0, 0)\n    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);\n#endif\n    QGuiApplication app(argc, argv);\n\n    QQmlApplicationEngine engine;\n    const QUrl url(QStringLiteral(\"qrc:/main.qml\"));\n    QObject::connect(\u0026engine, \u0026QQmlApplicationEngine::objectCreated,\n                     \u0026app, [url](QObject *obj, const QUrl \u0026objUrl) {\n        if (!obj \u0026\u0026 url == objUrl)\n            QCoreApplication::exit(-1);\n    }, Qt::QueuedConnection);\n    engine.load(url);\n\n    // if your Qt version older than 5.15 use it like this for win32 dark titlebar environment\n    QStyleHelper::setTitleBarDarkColor(QGuiApplication::allWindows());\n    \n    // this is for Windows 11\n    // example use of Mica, second bool parameter is setting acrylic transparent for mica\n    QStyleHelper::setMica(QGuiApplication::allWindows(), true);\n    \n    // this is for Windows 10/11 but resize performance is slow (deprecated)\n    // example use of Acrylic Blur Window, second bool parameter is setting acrylic transparent for it\n    QStyleHelper::setAcrylicBlurWindow(QGuiApplication::allWindows());\n\n    // this connection and QStyleHelper::colorSchemeChanged signal for monitor windows dark/light mode changes\n    QObject::connect(\u0026QStyleHelper::instance(), \u0026QStyleHelper::colorSchemeChanged, [](bool b)\n    { QStyleHelper::setMica(QGuiApplication::allWindows(), true); QStyleHelper::setTitleBarDarkColor(QGuiApplication::allWindows(), b); });\n\n    return app.exec();\n}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmguludag%2Fqstylehelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmguludag%2Fqstylehelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmguludag%2Fqstylehelper/lists"}