mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-02 09:40:42 +00:00
dedup qml: convert more buttons to MyButton
This commit is contained in:
parent
8e705d730d
commit
eb6a7cca47
@ -229,21 +229,11 @@ Dialog {
|
|||||||
Accessible.description: qsTr("Whether the file is already installed on your system")
|
Accessible.description: qsTr("Whether the file is already installed on your system")
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
MyButton {
|
||||||
id: removeButton
|
id: removeButton
|
||||||
contentItem: Text {
|
|
||||||
color: theme.textColor
|
|
||||||
text: "Remove"
|
text: "Remove"
|
||||||
}
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 20
|
anchors.rightMargin: 20
|
||||||
background: Rectangle {
|
|
||||||
opacity: .5
|
|
||||||
border.color: theme.backgroundLightest
|
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Download.removeModel(modelData.filename);
|
Download.removeModel(modelData.filename);
|
||||||
}
|
}
|
||||||
@ -300,12 +290,9 @@ Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
MyButton {
|
||||||
id: downloadButton
|
id: downloadButton
|
||||||
contentItem: Text {
|
text: downloading ? qsTr("Cancel") : qsTr("Download")
|
||||||
color: theme.textColor
|
|
||||||
text: downloading ? "Cancel" : "Download"
|
|
||||||
}
|
|
||||||
anchors.top: modelName.top
|
anchors.top: modelName.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.topMargin: 15
|
anchors.topMargin: 15
|
||||||
@ -320,17 +307,9 @@ Dialog {
|
|||||||
Download.cancelDownload(modelData.filename);
|
Download.cancelDownload(modelData.filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: Rectangle {
|
|
||||||
opacity: .5
|
|
||||||
border.color: theme.backgroundLightest
|
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
Accessible.role: Accessible.Button
|
Accessible.role: Accessible.Button
|
||||||
Accessible.name: text
|
Accessible.name: text
|
||||||
Accessible.description: qsTr("Cancel/Download button to stop/start the download")
|
Accessible.description: qsTr("Cancel/Download button to stop/start the download")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,23 +418,11 @@ Dialog {
|
|||||||
radius: 10
|
radius: 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
MyButton {
|
||||||
text: qsTr("Browse")
|
text: qsTr("Browse")
|
||||||
contentItem: Text {
|
|
||||||
text: qsTr("Browse")
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
color: theme.textColor
|
|
||||||
Accessible.role: Accessible.Button
|
Accessible.role: Accessible.Button
|
||||||
Accessible.name: text
|
Accessible.name: text
|
||||||
Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files")
|
Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files")
|
||||||
}
|
|
||||||
background: Rectangle {
|
|
||||||
opacity: .5
|
|
||||||
border.color: theme.backgroundLightest
|
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
onClicked: modelPathDialog.open()
|
onClicked: modelPathDialog.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,40 +117,18 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
|
|||||||
padding: 20
|
padding: 20
|
||||||
alignment: Qt.AlignRight
|
alignment: Qt.AlignRight
|
||||||
spacing: 10
|
spacing: 10
|
||||||
Button {
|
MyButton {
|
||||||
contentItem: Text {
|
|
||||||
color: theme.textColor
|
|
||||||
text: qsTr("Enable")
|
text: qsTr("Enable")
|
||||||
}
|
|
||||||
background: Rectangle {
|
|
||||||
border.color: theme.backgroundLightest
|
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
Accessible.role: Accessible.Button
|
Accessible.role: Accessible.Button
|
||||||
Accessible.name: text
|
Accessible.name: text
|
||||||
Accessible.description: qsTr("Enable opt-in button")
|
Accessible.description: qsTr("Enable opt-in button")
|
||||||
|
|
||||||
padding: 15
|
|
||||||
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
||||||
}
|
}
|
||||||
Button {
|
MyButton {
|
||||||
contentItem: Text {
|
|
||||||
color: theme.textColor
|
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
}
|
|
||||||
background: Rectangle {
|
|
||||||
border.color: theme.backgroundLightest
|
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
Accessible.role: Accessible.Button
|
Accessible.role: Accessible.Button
|
||||||
Accessible.name: text
|
Accessible.name: text
|
||||||
Accessible.description: qsTr("Cancel opt-in button")
|
Accessible.description: qsTr("Cancel opt-in button")
|
||||||
|
|
||||||
padding: 15
|
|
||||||
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
|
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
|
||||||
}
|
}
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
@ -43,30 +43,13 @@ Dialog {
|
|||||||
color: theme.textColor
|
color: theme.textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
MyButton {
|
||||||
id: button
|
id: button
|
||||||
anchors.left: label.right
|
anchors.left: label.right
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.verticalCenter: label.verticalCenter
|
anchors.verticalCenter: label.verticalCenter
|
||||||
padding: 20
|
padding: 20
|
||||||
contentItem: Text {
|
|
||||||
text: qsTr("Update")
|
text: qsTr("Update")
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
color: theme.textColor
|
|
||||||
|
|
||||||
Accessible.role: Accessible.Button
|
|
||||||
Accessible.name: text
|
|
||||||
Accessible.description: qsTr("Use this to launch an external application that will check for updates to the installer")
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
opacity: .5
|
|
||||||
border.color: theme.backgroundLightest
|
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!LLM.checkForUpdates())
|
if (!LLM.checkForUpdates())
|
||||||
checkForUpdatesError.open()
|
checkForUpdatesError.open()
|
||||||
|
@ -77,32 +77,18 @@ Dialog {
|
|||||||
padding: 20
|
padding: 20
|
||||||
alignment: Qt.AlignRight
|
alignment: Qt.AlignRight
|
||||||
spacing: 10
|
spacing: 10
|
||||||
Button {
|
MyButton {
|
||||||
contentItem: Text {
|
|
||||||
color: theme.textColor
|
|
||||||
text: qsTr("Submit")
|
text: qsTr("Submit")
|
||||||
}
|
Accessible.role: Accessible.Button
|
||||||
background: Rectangle {
|
Accessible.name: text
|
||||||
border.color: theme.backgroundLightest
|
Accessible.description: qsTr("Submits the user's response")
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
padding: 15
|
|
||||||
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
||||||
}
|
}
|
||||||
Button {
|
MyButton {
|
||||||
contentItem: Text {
|
|
||||||
color: theme.textColor
|
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
}
|
Accessible.role: Accessible.Button
|
||||||
background: Rectangle {
|
Accessible.name: text
|
||||||
border.color: theme.backgroundLightest
|
Accessible.description: qsTr("Closes the response dialog")
|
||||||
border.width: 1
|
|
||||||
radius: 10
|
|
||||||
color: theme.backgroundLight
|
|
||||||
}
|
|
||||||
padding: 15
|
|
||||||
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
|
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
|
||||||
}
|
}
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
Loading…
Reference in New Issue
Block a user