Mini window UI fixes.

Fix Toolbar customization panel overlapping window.
Fix minimum size to not exceed screen width.
CQTexperiment
Dzmitry Neviadomski 2021-02-27 15:29:01 +03:00 committed by Christopher Snowhill
parent 0ece64c50b
commit ac44ae12be
2 changed files with 8 additions and 3 deletions

View File

@ -562,7 +562,7 @@
</connections>
<point key="canvasLocation" x="130.5" y="131"/>
</window>
<window title="Cog" separatorStyle="none" allowsToolTipsWhenApplicationIsInactive="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="Mini Window" animationBehavior="default" titlebarAppearsTransparent="YES" toolbarStyle="unified" id="2234" userLabel="Mini Window (Window)" customClass="MiniWindow">
<window title="Cog" separatorStyle="none" allowsToolTipsWhenApplicationIsInactive="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="Mini Window" animationBehavior="default" toolbarStyle="unified" id="2234" userLabel="Mini Window (Window)" customClass="MiniWindow">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="192" y="547" width="640" height="0.0"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>

View File

@ -20,9 +20,14 @@
[self setShowsResizeIndicator:NO];
[self setExcludedFromWindowsMenu:YES];
[[self standardWindowButton:NSWindowZoomButton] setEnabled:NO];
NSUInteger minWidth = 675; // Default width
for (NSScreen *screen in NSScreen.screens) {
minWidth = MIN(screen.visibleFrame.size.width, minWidth);
}
// Disallow height resize.
[self setContentMinSize:NSMakeSize(675, 0)];
[self setContentMaxSize:NSMakeSize(CGFLOAT_MAX, 0)];
[self setContentMinSize:NSMakeSize(minWidth, 1)];
[self setContentMaxSize:NSMakeSize(CGFLOAT_MAX, 1)];
[self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
}