aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2023-05-03 10:47:27 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-05-05 10:30:07 +0000
commit9c555b29472f9aff97912a762597a2a3893b13eb (patch)
treef87657e56caf4421601e7e9602608a752d23e1c1
parent106901c032e717b9a94c49436aadbd18b5d7fcca (diff)
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 <oliver.eftevaag@qt.io> (cherry picked from commit 4a7d15c74bf3d58645fcfc1da5882a8cc5023e7e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quickcontrols/material/qquickmaterialtheme.cpp1
-rw-r--r--tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml6
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},