-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jinja-substitutions
Signed-off-by: AT <[email protected]>
- Loading branch information
Showing
30 changed files
with
2,234 additions
and
616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
import Qt5Compat.GraphicalEffects | ||
import QtCore | ||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Controls.Basic | ||
import QtQuick.Layouts | ||
|
||
import gpt4all | ||
import mysettings | ||
import toolenums | ||
|
||
ColumnLayout { | ||
property alias textContent: innerTextItem.textContent | ||
property bool isCurrent: false | ||
property bool isError: false | ||
|
||
Layout.topMargin: 10 | ||
Layout.bottomMargin: 10 | ||
|
||
Item { | ||
Layout.preferredWidth: childrenRect.width | ||
Layout.preferredHeight: 38 | ||
RowLayout { | ||
anchors.left: parent.left | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
|
||
Item { | ||
width: myTextArea.width | ||
height: myTextArea.height | ||
TextArea { | ||
id: myTextArea | ||
text: { | ||
if (isError) | ||
return qsTr("Analysis encountered error"); | ||
if (isCurrent) | ||
return qsTr("Analyzing"); | ||
return qsTr("Analyzed"); | ||
} | ||
padding: 0 | ||
font.pixelSize: theme.fontSizeLarger | ||
enabled: false | ||
focus: false | ||
readOnly: true | ||
color: headerMA.containsMouse ? theme.mutedDarkTextColorHovered : theme.mutedTextColor | ||
hoverEnabled: false | ||
} | ||
|
||
Item { | ||
id: textColorOverlay | ||
anchors.fill: parent | ||
clip: true | ||
visible: false | ||
Rectangle { | ||
id: animationRec | ||
width: myTextArea.width * 0.3 | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
color: theme.textColor | ||
|
||
SequentialAnimation { | ||
running: isCurrent | ||
loops: Animation.Infinite | ||
NumberAnimation { | ||
target: animationRec; | ||
property: "x"; | ||
from: -animationRec.width; | ||
to: myTextArea.width * 3; | ||
duration: 2000 | ||
} | ||
} | ||
} | ||
} | ||
OpacityMask { | ||
visible: isCurrent | ||
anchors.fill: parent | ||
maskSource: myTextArea | ||
source: textColorOverlay | ||
} | ||
} | ||
|
||
Item { | ||
id: caret | ||
Layout.preferredWidth: contentCaret.width | ||
Layout.preferredHeight: contentCaret.height | ||
Image { | ||
id: contentCaret | ||
anchors.centerIn: parent | ||
visible: false | ||
sourceSize.width: theme.fontSizeLarge | ||
sourceSize.height: theme.fontSizeLarge | ||
mipmap: true | ||
source: { | ||
if (contentLayout.state === "collapsed") | ||
return "qrc:/gpt4all/icons/caret_right.svg"; | ||
else | ||
return "qrc:/gpt4all/icons/caret_down.svg"; | ||
} | ||
} | ||
|
||
ColorOverlay { | ||
anchors.fill: contentCaret | ||
source: contentCaret | ||
color: headerMA.containsMouse ? theme.mutedDarkTextColorHovered : theme.mutedTextColor | ||
} | ||
} | ||
} | ||
|
||
MouseArea { | ||
id: headerMA | ||
hoverEnabled: true | ||
anchors.fill: parent | ||
onClicked: { | ||
if (contentLayout.state === "collapsed") | ||
contentLayout.state = "expanded"; | ||
else | ||
contentLayout.state = "collapsed"; | ||
} | ||
} | ||
} | ||
|
||
ColumnLayout { | ||
id: contentLayout | ||
spacing: 0 | ||
state: "collapsed" | ||
clip: true | ||
|
||
states: [ | ||
State { | ||
name: "expanded" | ||
PropertyChanges { target: contentLayout; Layout.preferredHeight: innerContentLayout.height } | ||
}, | ||
State { | ||
name: "collapsed" | ||
PropertyChanges { target: contentLayout; Layout.preferredHeight: 0 } | ||
} | ||
] | ||
|
||
transitions: [ | ||
Transition { | ||
SequentialAnimation { | ||
PropertyAnimation { | ||
target: contentLayout | ||
property: "Layout.preferredHeight" | ||
duration: 300 | ||
easing.type: Easing.InOutQuad | ||
} | ||
} | ||
} | ||
] | ||
|
||
ColumnLayout { | ||
id: innerContentLayout | ||
Layout.leftMargin: 30 | ||
ChatTextItem { | ||
id: innerTextItem | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.