58 lines
1.2 KiB
QML
58 lines
1.2 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import ZShell.Config
|
|
import ZShell.Llm
|
|
import qs.Components
|
|
import qs.Services
|
|
|
|
RowLayout {
|
|
id: root
|
|
|
|
ChatList {
|
|
id: chatList
|
|
|
|
Layout.fillHeight: true
|
|
Layout.fillWidth: true
|
|
Layout.maximumWidth: Config.sidebar.sizes.width
|
|
Layout.minimumWidth: Config.sidebar.sizes.width / 2
|
|
list.currentIndex: -1
|
|
list.highlightFollowsCurrentItem: false
|
|
|
|
list.highlight: CustomRect {
|
|
color: Colors.palette.m3primary
|
|
implicitHeight: chatList.list.currentItem?.implicitHeight ?? 0
|
|
implicitWidth: chatList.list.width
|
|
radius: Tokens.rounding.medium
|
|
x: chatList.list.currentItem?.chat.x ?? 0
|
|
y: chatList.list.currentItem?.y ?? 0
|
|
|
|
Behavior on y {
|
|
Anim {
|
|
duration: Tokens.anim.durations.small
|
|
easing: Tokens.anim.expressiveDefaultEffects
|
|
}
|
|
}
|
|
}
|
|
model: ScriptModel {
|
|
values: Chat.chats.values
|
|
}
|
|
|
|
onLoadChatRequest: (chat, index) => {
|
|
chatList.list.currentIndex = index;
|
|
chatContent.chatData = chat;
|
|
}
|
|
}
|
|
|
|
ChatContent {
|
|
id: chatContent
|
|
|
|
Layout.fillHeight: true
|
|
Layout.fillWidth: true
|
|
Layout.minimumWidth: Config.sidebar.sizes.width
|
|
Layout.preferredWidth: Math.round(Config.sidebar.sizes.width * 1.5)
|
|
}
|
|
}
|