-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(macOS): Hide traffic lights in band and dock sizes #182
Conversation
Reviewer's Guide by SourceryThis PR implements functionality to hide and show macOS window traffic light buttons (close, minimize, zoom) based on different window sizes. The implementation includes refactoring the MacOSWindowControlButtonManager to use a singleton pattern and adding new methods to control button visibility through platform channels. Sequence diagram for macOS window button visibility controlsequenceDiagram
actor User
participant App as MainFlutterWindow
participant Manager as MacOSWindowControlButtonManager
participant Positioner as WindowButtonPositioner
User->>App: Resize window
App->>Manager: Check activeBreakpoint
alt activeBreakpoint is band or dock
Manager->>Manager: setHide()
Manager->>App: Invoke set_hide
App->>Positioner: setHide()
else activeBreakpoint is not band or dock
Manager->>Manager: setShow()
Manager->>App: Invoke set_show
App->>Positioner: setShow()
end
Updated class diagram for MacOSWindowControlButtonManagerclassDiagram
class MacOSWindowControlButtonManager {
-MethodChannel platform
+MacOSWindowControlButtonManager shared
+MacOSWindowControlButtonManager _()
+setVertical() void
+setHide() void
+setShow() void
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @XMLHexagram - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
static Future<void> setVertical() async { | ||
MacOSWindowControlButtonManager._(); | ||
|
||
var platform = MethodChannel('not.ci.rune/window_control_button'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider making the platform channel final to prevent accidental modification
Instance variables that represent system resources like platform channels should generally be immutable to prevent potential issues.
var platform = MethodChannel('not.ci.rune/window_control_button'); | |
final platform = MethodChannel('not.ci.rune/window_control_button'); |
Summary by Sourcery
Add functionality to hide macOS window control buttons in band and dock sizes, and refactor the MacOSWindowControlButtonManager to use a shared instance for managing button visibility and positioning.
New Features:
Enhancements: