mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-06 11:00:48 +00:00
Make all the toolbuttons highlight on hover.
This commit is contained in:
@@ -141,41 +141,31 @@ Drawer {
|
||||
anchors.right: chatRectangle.right
|
||||
anchors.rightMargin: 10
|
||||
spacing: 10
|
||||
Button {
|
||||
MyToolButton {
|
||||
id: editButton
|
||||
width: 30
|
||||
height: 30
|
||||
visible: isCurrent && !isServer
|
||||
opacity: trashQuestionDisplayed ? 0.5 : 1.0
|
||||
background: Image {
|
||||
width: 30
|
||||
height: 30
|
||||
source: "qrc:/gpt4all/icons/edit.svg"
|
||||
}
|
||||
source: "qrc:/gpt4all/icons/edit.svg"
|
||||
onClicked: {
|
||||
chatName.focus = true
|
||||
chatName.readOnly = false
|
||||
chatName.selectByMouse = true
|
||||
}
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: qsTr("Edit the chat name")
|
||||
Accessible.description: qsTr("Provides a button to edit the chat name")
|
||||
}
|
||||
Button {
|
||||
MyToolButton {
|
||||
id: trashButton
|
||||
width: 30
|
||||
height: 30
|
||||
visible: isCurrent && !isServer
|
||||
background: Image {
|
||||
width: 30
|
||||
height: 30
|
||||
source: "qrc:/gpt4all/icons/trash.svg"
|
||||
}
|
||||
source: "qrc:/gpt4all/icons/trash.svg"
|
||||
onClicked: {
|
||||
trashQuestionDisplayed = true
|
||||
timer.start()
|
||||
}
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: qsTr("Delete of the chat")
|
||||
Accessible.description: qsTr("Provides a button to delete the chat")
|
||||
}
|
||||
|
44
gpt4all-chat/qml/MyToolButton.qml
Normal file
44
gpt4all-chat/qml/MyToolButton.qml
Normal file
@@ -0,0 +1,44 @@
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
Button {
|
||||
id: myButton
|
||||
padding: 10
|
||||
property alias source: image.source
|
||||
contentItem: Text {
|
||||
text: myButton.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
color: myButton.enabled ? theme.textColor : theme.mutedTextColor
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: text
|
||||
}
|
||||
|
||||
background: Item {
|
||||
anchors.fill: parent
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
visible: myButton.checkable && myButton.checked
|
||||
border.color: theme.backgroundLightest
|
||||
border.width: 1
|
||||
radius: 10
|
||||
}
|
||||
Image {
|
||||
id: image
|
||||
anchors.centerIn: parent
|
||||
mipmap: true
|
||||
width: 30
|
||||
height: 30
|
||||
}
|
||||
ColorOverlay {
|
||||
anchors.fill: image
|
||||
source: image
|
||||
color: myButton.hovered ? theme.textColor : "transparent"
|
||||
}
|
||||
}
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: text
|
||||
}
|
Reference in New Issue
Block a user