You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.7 KiB
72 lines
2.7 KiB
// Copyright (c) 2021 Proton Technologies AG |
|
// |
|
// This file is part of ProtonMail Bridge. |
|
// |
|
// ProtonMail Bridge is free software: you can redistribute it and/or modify |
|
// it under the terms of the GNU General Public License as published by |
|
// the Free Software Foundation, either version 3 of the License, or |
|
// (at your option) any later version. |
|
// |
|
// ProtonMail Bridge is distributed in the hope that it will be useful, |
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
// GNU General Public License for more details. |
|
// |
|
// You should have received a copy of the GNU General Public License |
|
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. |
|
|
|
import QtQuick 2.12 |
|
import QtQuick.Controls 2.12 |
|
import QtQuick.Controls.impl 2.12 |
|
import QtQuick.Templates 2.12 as T |
|
import "." |
|
|
|
T.MenuItem { |
|
id: control |
|
|
|
property ColorScheme colorScheme |
|
|
|
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, |
|
implicitContentWidth + leftPadding + rightPadding) |
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, |
|
implicitContentHeight + topPadding + bottomPadding, |
|
implicitIndicatorHeight + topPadding + bottomPadding) |
|
|
|
padding: 6 |
|
spacing: 6 |
|
|
|
icon.width: 24 |
|
icon.height: 24 |
|
icon.color: control.enabled ? control.colorScheme.text_norm : control.colorScheme.text_disabled |
|
|
|
font.family: Style.font_family |
|
font.weight: Style.fontWeight_400 |
|
font.pixelSize: Style.body_font_size |
|
font.letterSpacing: Style.body_letter_spacing |
|
|
|
contentItem: IconLabel { |
|
id: iconLabel |
|
readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0 |
|
readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0 |
|
leftPadding: !control.mirrored ? indicatorPadding : arrowPadding |
|
rightPadding: control.mirrored ? indicatorPadding : arrowPadding |
|
|
|
spacing: control.spacing |
|
mirrored: control.mirrored |
|
display: control.display |
|
alignment: Qt.AlignLeft |
|
|
|
icon: control.icon |
|
text: control.text |
|
font: control.font |
|
|
|
color: control.enabled ? control.colorScheme.text_norm : control.colorScheme.text_disabled |
|
} |
|
|
|
background: Rectangle { |
|
implicitWidth: 164 |
|
implicitHeight: 36 |
|
radius: 4 |
|
color: control.down ? control.colorScheme.interaction_default_active : control.highlighted ? control.colorScheme.interaction_default_hover : control.colorScheme.interaction_default |
|
} |
|
}
|
|
|