diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2017-03-01 13:06:44 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2017-03-28 06:17:35 +0000 |
commit | b44048ae27bd916d0eaa1e7d6a5456488ff76f29 (patch) | |
tree | bb00c7612f6baee2dbe0697205a52fd2792e9ee8 /src/imports/controls | |
parent | a7d9818dd414565cdcc4f4c9415f67735d146c68 (diff) |
AbstractButton: add display property
This property allows control over how icons and text are displayed
within buttons, without having to implement custom delegates. It is
also necessary for the upcoming Action type.
[ChangeLog][Controls][AbstractButton] Added display property to
allow control over how icons and text are displayed within buttons,
without having to implement custom delegates.
Task-number: QTBUG-49820
Change-Id: Ie924e2c54ed49961fd40129999875c8175606ecd
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls')
-rw-r--r-- | src/imports/controls/Button.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-button-icononly.png | bin | 0 -> 626 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-button-textbesideicon.png | bin | 0 -> 1827 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-button-textonly.png | bin | 0 -> 1470 bytes | |||
-rw-r--r-- | src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-icononly.qml | 34 | ||||
-rw-r--r-- | src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textbesideicon.qml | 35 | ||||
-rw-r--r-- | src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textonly.qml | 34 | ||||
-rw-r--r-- | src/imports/controls/material/Button.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/universal/Button.qml | 1 |
9 files changed, 106 insertions, 0 deletions
diff --git a/src/imports/controls/Button.qml b/src/imports/controls/Button.qml index bdf09f32..814448a2 100644 --- a/src/imports/controls/Button.qml +++ b/src/imports/controls/Button.qml @@ -60,6 +60,7 @@ T.Button { contentItem: DisplayLayout { spacing: control.spacing mirrored: control.mirrored + display: control.display icon: IconImage { id: iconImage diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-icononly.png b/src/imports/controls/doc/images/qtquickcontrols2-button-icononly.png Binary files differnew file mode 100644 index 00000000..91a21d17 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-button-icononly.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-textbesideicon.png b/src/imports/controls/doc/images/qtquickcontrols2-button-textbesideicon.png Binary files differnew file mode 100644 index 00000000..1d46133f --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-button-textbesideicon.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-textonly.png b/src/imports/controls/doc/images/qtquickcontrols2-button-textonly.png Binary files differnew file mode 100644 index 00000000..4449e748 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-button-textonly.png diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-icononly.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-icononly.qml new file mode 100644 index 00000000..0a58d4ad --- /dev/null +++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-icononly.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Controls 2.3 + +Button { + icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + display: Button.IconOnly +} diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textbesideicon.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textbesideicon.qml new file mode 100644 index 00000000..308837f7 --- /dev/null +++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textbesideicon.qml @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Controls 2.3 + +Button { + text: "Button" + icon.source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" + display: Button.TextBesideIcon +} diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textonly.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textonly.qml new file mode 100644 index 00000000..89d335e4 --- /dev/null +++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-textonly.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Controls 2.3 + +Button { + text: "Button" + display: Button.TextOnly +} diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml index d73eb240..47a02e53 100644 --- a/src/imports/controls/material/Button.qml +++ b/src/imports/controls/material/Button.qml @@ -67,6 +67,7 @@ T.Button { contentItem: DisplayLayout { spacing: control.spacing mirrored: control.mirrored + display: control.display icon: IconImage { id: iconImage diff --git a/src/imports/controls/universal/Button.qml b/src/imports/controls/universal/Button.qml index 5b6951a5..a5e03ea2 100644 --- a/src/imports/controls/universal/Button.qml +++ b/src/imports/controls/universal/Button.qml @@ -63,6 +63,7 @@ T.Button { contentItem: DisplayLayout { spacing: control.spacing mirrored: control.mirrored + display: control.display icon: IconImage { id: iconImage |