From 3a3694d78b8ea3726a15c20d46802e4d14a15735 Mon Sep 17 00:00:00 2001 From: Dzmitry Neviadomski Date: Wed, 3 Mar 2021 00:04:59 +0300 Subject: [PATCH] Add option for Mini Player to appear on top. --- Application/AppController.h | 2 ++ Application/AppController.m | 10 ++++++++++ Base.lproj/MainMenu.xib | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/Application/AppController.h b/Application/AppController.h index bfc0f3bb2..d158249a9 100644 --- a/Application/AppController.h +++ b/Application/AppController.h @@ -97,4 +97,6 @@ @property BOOL miniMode; +@property (nonatomic) BOOL floatingMiniWindow; + @end diff --git a/Application/AppController.m b/Application/AppController.m index 633a2d19f..6b03749da 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -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 diff --git a/Base.lproj/MainMenu.xib b/Base.lproj/MainMenu.xib index 7ce9fb503..ef0c83a65 100644 --- a/Base.lproj/MainMenu.xib +++ b/Base.lproj/MainMenu.xib @@ -1373,6 +1373,12 @@ Gw + + + + + +