From 07437979964dc54415bbcb1c8e3749a89e2d0b99 Mon Sep 17 00:00:00 2001 From: Tom Dewey Date: Wed, 17 Jul 2024 10:11:03 +0100 Subject: [PATCH] QtQuick: Use 'Dense' variant of Material Design 3 theme --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 99ed5b2..4f43d4a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -152,6 +152,16 @@ int main(int argc, char *argv[]) * of users. */ qputenv("QML_DISABLE_DISK_CACHE", "true"); + +#if QT_VERSION > QT_VERSION_CHECK(6, 5, 0) + // In version 6.5, Qt implemented Google Material Design 3, + // which renders fairly radically differently to Material Design 2. + // Of particular note is the 'Normal' vs 'Dense' variant choice, + // where 'Dense' is recommended for Desktops and environments with pointers. + // See https://www.qt.io/blog/material-3-changes-in-qt-quick-controls + qputenv("QT_QUICK_CONTROLS_MATERIAL_VARIANT", "Dense"); +#endif + #ifdef Q_OS_WIN // prefer ANGLE (DirectX) over desktop OpenGL QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);