2023-05-22 09:01:46 -04:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Basic
|
2024-01-29 11:12:12 -05:00
|
|
|
import mysettings
|
2023-05-22 09:01:46 -04:00
|
|
|
|
|
|
|
Button {
|
|
|
|
id: myButton
|
|
|
|
padding: 10
|
2024-01-22 14:41:47 -05:00
|
|
|
rightPadding: 18
|
|
|
|
leftPadding: 18
|
|
|
|
property color textColor: theme.oppositeTextColor
|
|
|
|
property color mutedTextColor: theme.oppositeMutedTextColor
|
|
|
|
property color backgroundColor: theme.buttonBackground
|
|
|
|
property color backgroundColorHovered: theme.buttonBackgroundHovered
|
2024-02-07 09:37:59 -05:00
|
|
|
property real backgroundRadius: 10
|
2024-01-29 11:12:12 -05:00
|
|
|
property real borderWidth: MySettings.chatTheme === "LegacyDark" ? 1 : 0
|
|
|
|
property color borderColor: theme.buttonBorder
|
2024-02-07 09:37:59 -05:00
|
|
|
property real fontPixelSize: theme.fontSizeLarge
|
2024-06-24 18:49:23 -04:00
|
|
|
property bool fontPixelBold: false
|
|
|
|
property alias textAlignment: textContent.horizontalAlignment
|
|
|
|
|
2023-05-22 09:01:46 -04:00
|
|
|
contentItem: Text {
|
2024-06-24 18:49:23 -04:00
|
|
|
id: textContent
|
2023-05-22 09:01:46 -04:00
|
|
|
text: myButton.text
|
2024-06-24 18:49:23 -04:00
|
|
|
horizontalAlignment: myButton.textAlignment
|
2024-01-22 14:41:47 -05:00
|
|
|
color: myButton.enabled ? textColor : mutedTextColor
|
|
|
|
font.pixelSize: fontPixelSize
|
2024-06-24 18:49:23 -04:00
|
|
|
font.bold: fontPixelBold
|
2023-05-22 09:01:46 -04:00
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
2024-02-07 09:37:59 -05:00
|
|
|
radius: myButton.backgroundRadius
|
2024-01-29 11:12:12 -05:00
|
|
|
border.width: myButton.borderWidth
|
|
|
|
border.color: myButton.borderColor
|
2024-06-24 18:49:23 -04:00
|
|
|
color: !myButton.enabled ? theme.mutedTextColor : myButton.hovered ? backgroundColorHovered : backgroundColor
|
2023-05-22 09:01:46 -04:00
|
|
|
}
|
2023-05-23 11:26:49 -04:00
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
2024-01-22 14:41:47 -05:00
|
|
|
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
|
2023-08-07 13:54:13 -04:00
|
|
|
}
|