mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-06 02:50:36 +00:00
Huge change that completely revamps the settings dialog and implements
per model settings as well as the ability to clone a model into a "character." This also implements system prompts as well as quite a few bugfixes for instance this fixes chatgpt.
This commit is contained in:
@@ -12,71 +12,56 @@ Item {
|
||||
id: theme
|
||||
}
|
||||
|
||||
property alias title: titleLabel.text
|
||||
property ListModel tabTitlesModel: ListModel { }
|
||||
property list<Component> tabs: [ ]
|
||||
|
||||
Canvas {
|
||||
id: canvas
|
||||
anchors.fill: parent
|
||||
contextType: "2d"
|
||||
onPaint: {
|
||||
var context = getContext("2d");
|
||||
context.reset();
|
||||
context.lineWidth = 2;
|
||||
context.moveTo(stackLayout.x, stackLayout.y);
|
||||
context.lineTo(stackLayout.x, stackLayout.y + stackLayout.height);
|
||||
context.lineTo(stackLayout.x + stackLayout.width, stackLayout.y + stackLayout.height);
|
||||
context.lineTo(stackLayout.x + stackLayout.width, stackLayout.y);
|
||||
context.lineTo(/*settingsTabBar.currentItem.x + */settingsTabBar.currentItem.width, stackLayout.y);
|
||||
context.strokeStyle = theme.tabBorder;
|
||||
context.stroke();
|
||||
}
|
||||
Label {
|
||||
id: titleLabel
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: theme.textColor
|
||||
padding: 10
|
||||
font.bold: true
|
||||
font.pixelSize: theme.fontSizeLarger
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.top: titleLabel.bottom
|
||||
anchors.leftMargin: 15
|
||||
anchors.rightMargin: 15
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 1
|
||||
color: theme.tabBorder
|
||||
}
|
||||
|
||||
TabBar {
|
||||
id: settingsTabBar
|
||||
width: parent.width / 1.25
|
||||
anchors.top: titleLabel.bottom
|
||||
anchors.topMargin: 15
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width / 1.75
|
||||
z: 200
|
||||
visible: tabTitlesModel.count > 1
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
Repeater {
|
||||
model: settingsStack.tabTitlesModel
|
||||
TabButton {
|
||||
id: tabButton
|
||||
padding: 10
|
||||
contentItem: IconLabel {
|
||||
color: theme.textColor
|
||||
font.bold: tabButton.checked
|
||||
text: model.title
|
||||
}
|
||||
background: Rectangle {
|
||||
color: tabButton.checked ? theme.backgroundDarkest : theme.backgroundLight
|
||||
// Rectangle {
|
||||
// anchors.top: parent.top
|
||||
// anchors.left: parent.left
|
||||
// anchors.right: parent.right
|
||||
// height: tabButton.checked
|
||||
// color: theme.tabBorder
|
||||
// }
|
||||
// Rectangle {
|
||||
// anchors.bottom: parent.bottom
|
||||
// anchors.left: parent.left
|
||||
// anchors.right: parent.right
|
||||
// height: !tabButton.checked
|
||||
// color: theme.tabBorder
|
||||
// }
|
||||
// Rectangle {
|
||||
// anchors.top: parent.top
|
||||
// anchors.bottom: parent.bottom
|
||||
// anchors.left: parent.left
|
||||
// width: tabButton.checked
|
||||
// color: theme.tabBorder
|
||||
// }
|
||||
// Rectangle {
|
||||
// anchors.top: parent.top
|
||||
// anchors.bottom: parent.bottom
|
||||
// anchors.right: parent.right
|
||||
// width: tabButton.checked
|
||||
// color: theme.tabBorder
|
||||
// }
|
||||
color: "transparent"
|
||||
border.width: 1
|
||||
border.color: tabButton.checked ? theme.tabBorder : "transparent"
|
||||
radius: 10
|
||||
}
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: model.title
|
||||
@@ -84,9 +69,31 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: dividerTabBar
|
||||
visible: tabTitlesModel.count > 1
|
||||
anchors.top: settingsTabBar.bottom
|
||||
anchors.topMargin: 15
|
||||
anchors.bottomMargin: 15
|
||||
anchors.leftMargin: 15
|
||||
anchors.rightMargin: 15
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 1
|
||||
color: theme.tabBorder
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
radius: 10
|
||||
border.width: 1
|
||||
border.color: theme.tabBorder
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: stackLayout
|
||||
anchors.top: tabTitlesModel.count > 1 ? settingsTabBar.bottom : parent.top
|
||||
anchors.top: tabTitlesModel.count > 1 ? dividerTabBar.bottom : titleLabel.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
Reference in New Issue
Block a user