start initial work on detaching chat to floating window
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
function create(parent: Item, props: var): void {
|
||||
chatComp.createObject(parent ?? dummy, props);
|
||||
ChatState.isWindow = true;
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: dummy
|
||||
}
|
||||
|
||||
Component {
|
||||
id: chatComp
|
||||
|
||||
FloatingWindow {
|
||||
id: win
|
||||
|
||||
property var props
|
||||
|
||||
color: Colors.tPalette.m3surface
|
||||
implicitHeight: chat.implicitHeight
|
||||
implicitWidth: chat.implicitWidth
|
||||
minimumSize.height: Config.sidebar.sizes.width
|
||||
minimumSize.width: Config.sidebar.sizes.width
|
||||
surfaceFormat.opaque: false
|
||||
title: qsTr("ZShell - Chat")
|
||||
|
||||
Component.onCompleted: ChatState.screen = screen
|
||||
onVisibleChanged: {
|
||||
if (!visible) {
|
||||
destroy();
|
||||
ChatState.isWindow = false;
|
||||
}
|
||||
}
|
||||
|
||||
ChatPanel {
|
||||
id: chat
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user