opt: preserve addon buttons
This commit is contained in:
parent
85529105be
commit
10e1336221
@ -421,19 +421,16 @@ class DesktopTab extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
))),
|
))),
|
||||||
// hide simulated action buttons when we in compatible ui mode, because of reusing system title bar.
|
// hide simulated action buttons when we in compatible ui mode, because of reusing system title bar.
|
||||||
Offstage(
|
WindowActionPanel(
|
||||||
offstage: kUseCompatibleUiMode,
|
isMainWindow: isMainWindow,
|
||||||
child: WindowActionPanel(
|
tabType: tabType,
|
||||||
isMainWindow: isMainWindow,
|
state: state,
|
||||||
tabType: tabType,
|
tail: tail,
|
||||||
state: state,
|
isMaximized: isMaximized,
|
||||||
tail: tail,
|
showMinimize: showMinimize,
|
||||||
isMaximized: isMaximized,
|
showMaximize: showMaximize,
|
||||||
showMinimize: showMinimize,
|
showClose: showClose,
|
||||||
showMaximize: showMaximize,
|
onClose: onWindowCloseButton,
|
||||||
showClose: showClose,
|
|
||||||
onClose: onWindowCloseButton,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -547,50 +544,59 @@ class WindowActionPanelState extends State<WindowActionPanel>
|
|||||||
children: [
|
children: [
|
||||||
Offstage(offstage: widget.tail == null, child: widget.tail),
|
Offstage(offstage: widget.tail == null, child: widget.tail),
|
||||||
Offstage(
|
Offstage(
|
||||||
offstage: !widget.showMinimize,
|
offstage: kUseCompatibleUiMode,
|
||||||
child: ActionIcon(
|
child: Row(
|
||||||
message: 'Minimize',
|
children: [
|
||||||
icon: IconFont.min,
|
Offstage(
|
||||||
onTap: () {
|
offstage: !widget.showMinimize,
|
||||||
if (widget.isMainWindow) {
|
child: ActionIcon(
|
||||||
windowManager.minimize();
|
message: 'Minimize',
|
||||||
} else {
|
icon: IconFont.min,
|
||||||
WindowController.fromWindowId(windowId!).minimize();
|
onTap: () {
|
||||||
}
|
if (widget.isMainWindow) {
|
||||||
},
|
windowManager.minimize();
|
||||||
isClose: false,
|
} else {
|
||||||
)),
|
WindowController.fromWindowId(windowId!).minimize();
|
||||||
Offstage(
|
}
|
||||||
offstage: !widget.showMaximize,
|
},
|
||||||
child: Obx(() => ActionIcon(
|
isClose: false,
|
||||||
message: widget.isMaximized.value ? "Restore" : "Maximize",
|
)),
|
||||||
icon: widget.isMaximized.value
|
Offstage(
|
||||||
? IconFont.restore
|
offstage: !widget.showMaximize,
|
||||||
: IconFont.max,
|
child: Obx(() => ActionIcon(
|
||||||
onTap: _toggleMaximize,
|
message:
|
||||||
isClose: false,
|
widget.isMaximized.value ? "Restore" : "Maximize",
|
||||||
))),
|
icon: widget.isMaximized.value
|
||||||
Offstage(
|
? IconFont.restore
|
||||||
offstage: !widget.showClose,
|
: IconFont.max,
|
||||||
child: ActionIcon(
|
onTap: _toggleMaximize,
|
||||||
message: 'Close',
|
isClose: false,
|
||||||
icon: IconFont.close,
|
))),
|
||||||
onTap: () async {
|
Offstage(
|
||||||
final res = await widget.onClose?.call() ?? true;
|
offstage: !widget.showClose,
|
||||||
if (res) {
|
child: ActionIcon(
|
||||||
// hide for all window
|
message: 'Close',
|
||||||
// note: the main window can be restored by tray icon
|
icon: IconFont.close,
|
||||||
Future.delayed(Duration.zero, () async {
|
onTap: () async {
|
||||||
if (widget.isMainWindow) {
|
final res = await widget.onClose?.call() ?? true;
|
||||||
await windowManager.close();
|
if (res) {
|
||||||
} else {
|
// hide for all window
|
||||||
await WindowController.fromWindowId(windowId!).close();
|
// note: the main window can be restored by tray icon
|
||||||
}
|
Future.delayed(Duration.zero, () async {
|
||||||
});
|
if (widget.isMainWindow) {
|
||||||
}
|
await windowManager.close();
|
||||||
},
|
} else {
|
||||||
isClose: true,
|
await WindowController.fromWindowId(windowId!)
|
||||||
)),
|
.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isClose: true,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user