Rework Button and add Modal to have a better experience on Phone

This commit is contained in:
Vyn 2024-05-22 18:00:56 +02:00
parent 4164d8fbf3
commit 3bbcf60c61
7 changed files with 102 additions and 74 deletions

View file

@ -11,30 +11,23 @@ import Mirai
Button {
id: control
icon.color: MiraiColorPalette.buttonIcon
property bool noBackgroundColor: false
contentItem: RowLayout {
spacing: control.icon.source != "" ? 4 : 0
Component {
id: buttonIcon
AppIcon {
icon.source: control.icon.source
icon.color: control?.icon?.color
}
}
icon.color: MiraiColorPalette.buttonIcon
Loader {
sourceComponent: control.icon.source != "" ? buttonIcon : undefined
}
Text {
text: control.text
color: MiraiColorPalette.text
leftPadding: 8
rightPadding: 8
}
}
// I have a different behavior when setting padding for Android
padding: root.isPhone ? undefined : 8
contentItem: IconLabel {
spacing: control.spacing
mirrored: control.mirrored
display: control.display
icon: control.icon
text: control.text
font: control.font
color: MiraiColorPalette.text
}
background: Rectangle {
color: control.noBackgroundColor ? "transparent"