mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 10:13:42 +00:00
Rework Button and add Modal to have a better experience on Phone
This commit is contained in:
parent
4164d8fbf3
commit
3bbcf60c61
7 changed files with 102 additions and 74 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue