Changeset View
Changeset View
Standalone View
Standalone View
src/controls/private/PrivateActionToolButton.qml
Show All 19 Lines | |||||
20 | import QtQuick 2.6 | 20 | import QtQuick 2.6 | ||
21 | import QtQuick.Layouts 1.2 | 21 | import QtQuick.Layouts 1.2 | ||
22 | import QtQuick.Controls 2.0 as Controls | 22 | import QtQuick.Controls 2.0 as Controls | ||
23 | import org.kde.kirigami 2.2 | 23 | import org.kde.kirigami 2.2 | ||
24 | 24 | | |||
25 | Controls.ToolButton { | 25 | Controls.ToolButton { | ||
26 | id: control | 26 | id: control | ||
27 | 27 | | |||
28 | implicitWidth: showText && ( kirigamiAction.text.length > 0 || text.length > 0) ? Math.max(background.implicitWidth, layout.implicitWidth + 16) : implicitHeight | 28 | implicitWidth: showText && ( kirigamiAction ? kirigamiAction.text.length > 0 : text.length > 0) ? Math.max(background.implicitWidth, layout.implicitWidth + 16) : implicitHeight | ||
29 | implicitHeight: background.implicitHeight | 29 | implicitHeight: background.implicitHeight | ||
30 | 30 | | |||
31 | hoverEnabled: true | 31 | hoverEnabled: true | ||
32 | //TODO: replace with upstream action when we depend on Qt 5.10 | 32 | //TODO: replace with upstream action when we depend on Qt 5.10 | ||
33 | property Action kirigamiAction | 33 | property Action kirigamiAction | ||
34 | property bool showText: true | 34 | property bool showText: true | ||
35 | property bool showMenuArrow: true | 35 | property bool showMenuArrow: true | ||
36 | 36 | | |||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |