From 9c555b29472f9aff97912a762597a2a3893b13eb Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 3 May 2023 10:47:27 +0800 Subject: [PATCH] Material: don't set all caps for Button text The guidelines have changed since Material 2, and they now recommend to use sentence case: https://m3.material.io/components/buttons/guidelines Amends f47f8d69319fa7b0b71cc8036c5bdfd1e8407e70. Change-Id: I055f4acc9c1e594b5c87818bcce5abd774b01d04 Reviewed-by: Oliver Eftevaag (cherry picked from commit 4a7d15c74bf3d58645fcfc1da5882a8cc5023e7e) Reviewed-by: Qt Cherry-pick Bot --- src/quickcontrols/material/qquickmaterialtheme.cpp | 1 - .../quickcontrols/qquickmaterialstyle/data/tst_material.qml | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/quickcontrols/material/qquickmaterialtheme.cpp b/src/quickcontrols/material/qquickmaterialtheme.cpp index 629c389be5..da2cf0f894 100644 --- a/src/quickcontrols/material/qquickmaterialtheme.cpp +++ b/src/quickcontrols/material/qquickmaterialtheme.cpp @@ -47,7 +47,6 @@ void QQuickMaterialTheme::initialize(QQuickTheme *theme) // https://material.io/guidelines/components/buttons.html#buttons-style buttonFont.setPixelSize(dense ? 13 : 14); - buttonFont.setCapitalization(QFont::AllUppercase); buttonFont.setWeight(QFont::Medium); theme->setFont(QQuickTheme::Button, buttonFont); theme->setFont(QQuickTheme::TabBar, buttonFont); diff --git a/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml b/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml index 2a3c31361d..8e4189924f 100644 --- a/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml +++ b/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml @@ -636,15 +636,15 @@ TestCase { return [ {tag: "Button:pixelSize", type: "Button", attribute: "pixelSize", value: 14, window: 20, pane: 10}, {tag: "Button:weight", type: "Button", attribute: "weight", value: Font.Medium, window: Font.Black, pane: Font.Bold}, - {tag: "Button:capitalization", type: "Button", attribute: "capitalization", value: Font.AllUppercase, window: Font.Capitalize, pane: Font.AllLowercase}, + {tag: "Button:capitalization", type: "Button", attribute: "capitalization", value: Font.MixedCase, window: Font.Capitalize, pane: Font.AllLowercase}, {tag: "TabButton:pixelSize", type: "TabButton", attribute: "pixelSize", value: 14, window: 20, pane: 10}, {tag: "TabButton:weight", type: "TabButton", attribute: "weight", value: Font.Medium, window: Font.Black, pane: Font.Bold}, - {tag: "TabButton:capitalization", type: "TabButton", attribute: "capitalization", value: Font.AllUppercase, window: Font.Capitalize, pane: Font.AllLowercase}, + {tag: "TabButton:capitalization", type: "TabButton", attribute: "capitalization", value: Font.MixedCase, window: Font.Capitalize, pane: Font.AllLowercase}, {tag: "ToolButton:pixelSize", type: "ToolButton", attribute: "pixelSize", value: 14, window: 20, pane: 10}, {tag: "ToolButton:weight", type: "ToolButton", attribute: "weight", value: Font.Medium, window: Font.Black, pane: Font.Bold}, - {tag: "ToolButton:capitalization", type: "ToolButton", attribute: "capitalization", value: Font.AllUppercase, window: Font.Capitalize, pane: Font.AllLowercase}, + {tag: "ToolButton:capitalization", type: "ToolButton", attribute: "capitalization", value: Font.MixedCase, window: Font.Capitalize, pane: Font.AllLowercase}, {tag: "ItemDelegate:pixelSize", type: "ItemDelegate", attribute: "pixelSize", value: 14, window: 20, pane: 10}, {tag: "ItemDelegate:weight", type: "ItemDelegate", attribute: "weight", value: Font.Medium, window: Font.Black, pane: Font.Bold},