gpt4all/gpt4all-chat/qml/MySettingsLabel.qml
Jared Van Bortel 6506ba161b
UI tweaks for GPT4All v3.0.0-rc2 (#2474)
* clickable link to get API key with hand-style mouse cursor
* remove "Force Metal" setting
* allow typing incorrect API keys (but don't accept them), add placeholder text

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
2024-06-27 11:08:32 -04:00

48 lines
1.4 KiB
QML

import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import QtQuick.Layouts
ColumnLayout {
id: root
property alias text: mainTextLabel.text
property alias helpText: helpTextLabel.text
property alias textFormat: mainTextLabel.textFormat
property alias wrapMode: mainTextLabel.wrapMode
property alias font: mainTextLabel.font
property alias horizontalAlignment: mainTextLabel.horizontalAlignment
signal linkActivated(link : url);
property alias color: mainTextLabel.color
property alias linkColor: mainTextLabel.linkColor
Label {
id: mainTextLabel
color: theme.settingsTitleTextColor
font.pixelSize: theme.fontSizeSmall
font.bold: true
onLinkActivated: function(link) {
root.linkActivated(link);
}
}
Label {
id: helpTextLabel
Layout.fillWidth: true
wrapMode: Text.Wrap
color: theme.settingsTitleTextColor
text: mainTextLabel.text
font.pixelSize: theme.fontSizeSmaller
font.bold: false
onLinkActivated: function(link) {
root.linkActivated(link);
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton // pass clicks to parent
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}