diff --git a/CMakeLists.txt b/CMakeLists.txt index c73528f..e15ccdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ find_package(Qt6 REQUIRED COMPONENTS Qml Quick QuickControls2 + Widgets ) find_package(LayerShellQt REQUIRED) @@ -53,6 +54,8 @@ target_link_libraries(waycast PRIVATE Qt6::Gui Qt6::Qml Qt6::Quick + Qt6::QuickControls2 + Qt6::Widgets PkgConfig::GIO LayerShellQt::Interface ) diff --git a/src/main.cpp b/src/main.cpp index 0d9161e..1dbed72 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include #undef signals @@ -50,11 +52,9 @@ int main(int argc, char *argv[]) pluginManager.registerPlugin(std::make_unique()); pluginManager.registerPlugin(std::make_unique()); - // Enable system theme support - app.setDesktopSettingsAware(true); - - // Ensure we follow system color scheme - app.setAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles, true); + // Set dark theme + QQuickStyle::setStyle("Material"); + qputenv("QT_QUICK_CONTROLS_MATERIAL_THEME", "Dark"); QQmlApplicationEngine engine; diff --git a/ui/Main.qml b/ui/Main.qml index ddabbff..958dbf3 100644 --- a/ui/Main.qml +++ b/ui/Main.qml @@ -2,7 +2,6 @@ import QtQuick import QtQuick.Controls import QtQuick.Window import QtQuick.Controls.Material -import QtQuick.Controls.Universal import WayCast ApplicationWindow { @@ -13,6 +12,8 @@ ApplicationWindow { flags: Qt.FramelessWindowHint property int timeoutInterval: 5000 + Material.theme: Material.Dark + Shortcut { sequence: "Escape" onActivated: Qt.quit() @@ -25,8 +26,8 @@ ApplicationWindow { Rectangle { anchors.fill: parent border.width: 1 - border.color: palette.mid - color: palette.window + border.color: Material.frameColor + color: Material.backgroundColor Column { anchors.fill: parent @@ -68,7 +69,7 @@ ApplicationWindow { highlightFollowsCurrentItem: true highlight: Rectangle { - color: palette.highlight + color: Material.accent radius: 4 } @@ -78,7 +79,7 @@ ApplicationWindow { Rectangle { anchors.fill: parent - color: parent.hovered ? palette.alternateBase : "transparent" + color: parent.hovered ? Material.listHighlightColor : "transparent" radius: 4 } @@ -97,7 +98,7 @@ ApplicationWindow { // Fallback if icon fails to load Rectangle { anchors.fill: parent - color: palette.button + color: Material.color(Material.Grey, Material.Shade600) radius: 4 visible: parent.status === Image.Error || parent.status === Image.Null @@ -112,7 +113,7 @@ ApplicationWindow { Text { anchors.verticalCenter: parent.verticalCenter text: model.name - color: palette.text + color: Material.foreground font.pixelSize: 14 } }