gpt4all/gpt4all-chat/qml/MyButton.qml

38 lines
1.3 KiB
QML
Raw Normal View History

2023-05-22 09:01:46 -04:00
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import mysettings
2023-05-22 09:01:46 -04:00
Button {
id: myButton
padding: 10
rightPadding: 18
leftPadding: 18
property color textColor: theme.oppositeTextColor
property color mutedTextColor: theme.oppositeMutedTextColor
property color backgroundColor: theme.buttonBackground
property color backgroundColorHovered: theme.buttonBackgroundHovered
property real backgroundRadius: 10
property real borderWidth: MySettings.chatTheme === "LegacyDark" ? 1 : 0
property color borderColor: theme.buttonBorder
property real fontPixelSize: theme.fontSizeLarge
2023-05-22 09:01:46 -04:00
contentItem: Text {
text: myButton.text
horizontalAlignment: Text.AlignHCenter
color: myButton.enabled ? textColor : mutedTextColor
font.pixelSize: fontPixelSize
2023-05-22 09:01:46 -04:00
Accessible.role: Accessible.Button
Accessible.name: text
}
background: Rectangle {
radius: myButton.backgroundRadius
border.width: myButton.borderWidth
border.color: myButton.borderColor
color: myButton.hovered ? backgroundColorHovered : backgroundColor
2023-05-22 09:01:46 -04:00
}
Accessible.role: Accessible.Button
Accessible.name: text
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
2023-08-07 13:54:13 -04:00
}