Merge pull request #124 from losnoco/nevack/floating-mini-window

Add option for Mini Player to appear on top.
CQTexperiment
Christopher Snowhill 2021-03-02 17:07:50 -08:00 committed by GitHub
commit 094025900d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -97,4 +97,6 @@
@property BOOL miniMode;
@property (nonatomic) BOOL floatingMiniWindow;
@end

View File

@ -177,6 +177,9 @@ void* kAppControllerContext = &kAppControllerContext;
[self setToolbarStyle:[[NSUserDefaults standardUserDefaults] boolForKey:@"toolbarStyleFull"]];
[self setFloatingMiniWindow:[[NSUserDefaults standardUserDefaults]
boolForKey:@"floatingMiniWindow"]];
// We need file tree view to restore its state here
// so attempt to access file tree view controller's root view
// to force it to read nib and create file tree view for us
@ -606,4 +609,11 @@ void* kAppControllerContext = &kAppControllerContext;
[miniWindow setContentSize:NSMakeSize(miniWindow.frame.size.width, 0)];
}
- (void)setFloatingMiniWindow:(BOOL)floatingMiniWindow {
_floatingMiniWindow = floatingMiniWindow;
[[NSUserDefaults standardUserDefaults] setBool:floatingMiniWindow forKey:@"floatingMiniWindow"];
NSWindowLevel level = floatingMiniWindow ? NSFloatingWindowLevel : NSNormalWindowLevel;
[miniWindow setLevel:level];
}
@end

View File

@ -1373,6 +1373,12 @@ Gw
</binding>
</connections>
</menuItem>
<menuItem title="Show Mini Player On Top" keyEquivalent="T" id="lXN-EZ-xg0" userLabel="Show Mini Player On Top">
<connections>
<binding destination="226" name="enabled" keyPath="miniMode" id="ftj-Rc-nqc"/>
<binding destination="226" name="value" keyPath="floatingMiniWindow" id="6rr-FP-Fw2"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="1642">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>