mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-27 06:33:08 +00:00
When we use languages with long text translation, the width is > width screen and the alignment is bad with multiple line.
42 lines
1.1 KiB
QML
42 lines
1.1 KiB
QML
// SPDX-FileCopyrightText: 2025 Florian Richer <florian.richer@protonmail.com>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Controls as QQC2
|
|
|
|
import org.kde.plasma.components as PC3
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
PC3.ToolButton {
|
|
id: root
|
|
opacity: 0.9
|
|
implicitHeight: Kirigami.Units.gridUnit * 4
|
|
implicitWidth: Kirigami.Units.gridUnit * 5
|
|
|
|
property string iconName
|
|
property string textLabel
|
|
|
|
contentItem: ColumnLayout {
|
|
spacing: Kirigami.Units.largeSpacing
|
|
uniformCellSizes: true
|
|
|
|
Kirigami.Icon {
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
|
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
|
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
|
Layout.fillHeight: true
|
|
source: iconName
|
|
}
|
|
|
|
QQC2.Label {
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignTop
|
|
text: textLabel
|
|
font.bold: true
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
wrapMode: Text.WordWrap
|
|
}
|
|
}
|
|
}
|