Float the last chat and float from the chat list
Any tiled chat can float now, including the only one; the tiling is left empty. A chat list row's More menu offers Float too: a tiled chat leaves the tiling, a chat with a window shows it, any other opens a new window.
This commit is contained in:
@@ -44,7 +44,24 @@ mixin _ChatScreenFloat on State<ChatScreen>, _ChatScreenWorkspace {
|
||||
/// the same frame.
|
||||
void _floatPane(String paneId) {
|
||||
final pane = _workspace.detach(paneId);
|
||||
if (pane != null) widget.windows?.float(pane.sessionId);
|
||||
if (pane == null) return;
|
||||
widget.windows?.float(pane.sessionId);
|
||||
// Floating the last tiled chat leaves the list, as closing it does.
|
||||
if (_workspace.paneCount == 0) _back();
|
||||
}
|
||||
|
||||
/// The chat list's Float choice: a tiled chat leaves the tiling, a chat
|
||||
/// already in a window comes to the top, any other opens in a new window.
|
||||
void _floatSession(JsonMap session) {
|
||||
final id = '${session['id'] ?? ''}';
|
||||
final windows = widget.windows;
|
||||
if (id.isEmpty || windows == null || windows.show(id)) return;
|
||||
final pane = _workspace.panes.where((p) => p.sessionId == id).firstOrNull;
|
||||
if (pane != null) {
|
||||
_floatPane(pane.id);
|
||||
} else {
|
||||
windows.float(id);
|
||||
}
|
||||
}
|
||||
|
||||
void _dockSession(String sessionId) {
|
||||
|
||||
Reference in New Issue
Block a user