mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: simplify theme mode determining based on the new Lazarus/Cocoa version
(cherry picked from commit 2f33d5a553)
This commit is contained in:
parent
d7d9a112fc
commit
6406ddc06b
2 changed files with 2 additions and 14 deletions
|
|
@ -54,7 +54,6 @@ type
|
|||
class procedure openSystemSecurityPreferences_PrivacyAllFiles;
|
||||
public
|
||||
class procedure setTheme( const mode: Integer );
|
||||
class function isDarkTheme: Boolean;
|
||||
public
|
||||
class procedure fixFormatSettings;
|
||||
class procedure openNewInstance;
|
||||
|
|
@ -133,17 +132,6 @@ begin
|
|||
TCocoaThemeServices.darwinThemeChangedNotify;
|
||||
end;
|
||||
|
||||
class function TDarwinApplicationUtil.isDarkTheme: Boolean;
|
||||
var
|
||||
appearanceName: NSString;
|
||||
begin
|
||||
Result:= False;
|
||||
if not NSApp.respondsToSelector( ObjCSelector('effectiveAppearance') ) then
|
||||
exit;
|
||||
appearanceName:= NSApp.effectiveAppearance.Name;
|
||||
Result:= appearanceName.isEqualToString(NSSTR_DARK_NAME) or appearanceName.isEqualToString(NSSTR_DARK_NAME_VIBRANT);
|
||||
end;
|
||||
|
||||
class procedure TDarwinApplicationUtil.fixFormatSettings;
|
||||
var
|
||||
S: String;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ uses
|
|||
uFileSource, uFileSourceOperationTypes, uFileSourceManager,
|
||||
uFileSourceWatcher, uMountedFileSource, uVfsModule,
|
||||
uDCUtils, uLng, uGlobs,
|
||||
uDarwinApplication, uDarwinFSWatch, uDarwinSimpleFSWatch,
|
||||
uDarwinFSWatch, uDarwinSimpleFSWatch,
|
||||
uDarwinFile, uDarwinImage,
|
||||
CocoaAll, CocoaUtils, CocoaThemes;
|
||||
|
||||
|
|
@ -542,7 +542,7 @@ begin
|
|||
_downloadImage.release;
|
||||
tempImage:= NSImage.alloc.initWithContentsOfFile( StrToNSString(mbExpandFileName(iCloudDriveConfig.icon.download)) );
|
||||
tempImage.setSize( NSMakeSize(16,16) );
|
||||
if TDarwinApplicationUtil.isDarkTheme then begin
|
||||
if TCocoaThemeServices.isDark then begin
|
||||
_downloadImage:= TDarwinImageUtil.invertColor( tempImage );
|
||||
end else begin
|
||||
_downloadImage:= tempImage;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue