Use a fixed minimum height to ensure the top three model cards have the same height.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
Adam Treat 2025-02-20 10:37:24 -05:00
parent 563e6592e4
commit 51c45e5d47
2 changed files with 18 additions and 8 deletions

View File

@ -47,7 +47,7 @@ ColumnLayout {
columnSpacing: 20
RemoteModelCard {
Layout.preferredWidth: 600
Layout.minimumHeight: implicitHeight
Layout.minimumHeight: 700
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
providerBaseUrl: "https://api.groq.com/openai/v1/"
providerName: qsTr("Groq")
@ -56,7 +56,7 @@ ColumnLayout {
}
RemoteModelCard {
Layout.preferredWidth: 600
Layout.minimumHeight: implicitHeight
Layout.minimumHeight: 700
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
providerBaseUrl: "https://api.openai.com/v1/"
providerName: qsTr("OpenAI")
@ -65,7 +65,7 @@ ColumnLayout {
}
RemoteModelCard {
Layout.preferredWidth: 600
Layout.minimumHeight: implicitHeight
Layout.minimumHeight: 700
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
providerBaseUrl: "https://api.mistral.ai/v1/"
providerName: qsTr("Mistral")
@ -74,7 +74,7 @@ ColumnLayout {
}
RemoteModelCard {
Layout.preferredWidth: 600
Layout.minimumHeight: implicitHeight
Layout.minimumHeight: 700
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
providerIsCustom: true
providerName: qsTr("Custom")

View File

@ -28,9 +28,10 @@ Rectangle {
radius: 10
border.width: 1
border.color: theme.controlBorder
implicitHeight: childrenRect.height + 40
implicitHeight: topColumn.height + bottomColumn.height + 60
ColumnLayout {
id: topColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
@ -73,6 +74,15 @@ Rectangle {
id: providerDescLabel
onLinkActivated: function(link) { Qt.openUrlExternally(link) }
}
}
ColumnLayout {
id: bottomColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 20
spacing: 30
ColumnLayout {
MySettingsLabel {
@ -113,15 +123,15 @@ Rectangle {
color: theme.settingsTitleTextColor
}
MyTextField {
id: baseUrl
id: baseUrlField
Layout.fillWidth: true
wrapMode: Text.WrapAnywhere
function showError() {
messageToast.show(qsTr("ERROR: $BASE_URL is empty."));
baseUrl.placeholderTextColor = theme.textErrorColor;
baseUrlField.placeholderTextColor = theme.textErrorColor;
}
onTextChanged: {
baseUrl.placeholderTextColor = theme.mutedTextColor;
baseUrlField.placeholderTextColor = theme.mutedTextColor;
}
placeholderText: qsTr("enter $BASE_URL")
Accessible.role: Accessible.EditableText