mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-08 11:58:53 +00:00
Provide an abstraction to break up the settings dialog into managable pieces.
This commit is contained in:
46
gpt4all-chat/qml/MySettingsTab.qml
Normal file
46
gpt4all-chat/qml/MySettingsTab.qml
Normal file
@@ -0,0 +1,46 @@
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item {
|
||||
property string title: ""
|
||||
property Item contentItem: null
|
||||
|
||||
onContentItemChanged: function() {
|
||||
if (contentItem) {
|
||||
contentItem.parent = tabInner;
|
||||
contentItem.anchors.left = tabInner.left;
|
||||
contentItem.anchors.right = tabInner.right;
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
padding: 15
|
||||
rightPadding: 20
|
||||
contentWidth: availableWidth
|
||||
contentHeight: tabInner.height
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
||||
|
||||
Theme {
|
||||
id: theme
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: 'transparent'
|
||||
border.color: theme.tabBorder
|
||||
border.width: 1
|
||||
radius: 2
|
||||
}
|
||||
|
||||
Column {
|
||||
id: tabInner
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user