Skip to content

Commit

Permalink
refacter(macOS): Hide traffic lights in small size
Browse files Browse the repository at this point in the history
  • Loading branch information
XMLHexagram committed Dec 6, 2024
1 parent 95cfae8 commit db18a27
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/widgets/title_bar/window_frame_for_macos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ class _WindowFrameForMacOSState extends State<WindowFrameForMacOS> {
}

void updateWindowControlButtons() {
setState(() => {});
if (_responsiveProvider.currentDeviceType == DeviceType.band ||
_responsiveProvider.currentDeviceType == DeviceType.dock) {
MacOSWindowControlButtonManager.shared.setHide();
} else {
MacOSWindowControlButtonManager.shared.setShow();
MacOSWindowControlButtonManager.shared.setVertical();
}
}

@override
Expand All @@ -71,13 +77,6 @@ class _WindowFrameForMacOSState extends State<WindowFrameForMacOS> {
DeviceType.tv
],
builder: (context, activeBreakpoint) {
if (activeBreakpoint == DeviceType.band ||
activeBreakpoint == DeviceType.dock) {
MacOSWindowControlButtonManager.shared.setHide();
} else {
MacOSWindowControlButtonManager.shared.setShow();
}

if (activeBreakpoint == DeviceType.band ||
activeBreakpoint == DeviceType.dock ||
path == '/' ||
Expand Down

0 comments on commit db18a27

Please sign in to comment.