@@ -162,7 +162,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
162
162
} ,
163
163
Score = score ,
164
164
TitleToolTip = Main . Context . API . GetTranslation ( "plugin_explorer_plugin_ToolTipOpenDirectory" ) ,
165
- SubTitleToolTip = Settings . DisplayMoreInformationInToolTip ? GetMoreInfoToolTip ( path , ResultType . Folder ) : path ,
165
+ SubTitleToolTip = Settings . DisplayMoreInformationInToolTip ? GetFolderMoreInfoTooltip ( path ) : path ,
166
166
ContextData = new SearchResult { Type = ResultType . Folder , FullPath = path , WindowsIndexed = windowsIndexed }
167
167
} ;
168
168
}
@@ -183,6 +183,10 @@ internal static Result CreateDriveSpaceDisplayResult(string path, string actionK
183
183
if ( progressValue >= 90 )
184
184
progressBarColor = "#da2626" ;
185
185
186
+ var tooltip = Settings . DisplayMoreInformationInToolTip
187
+ ? GetVolumeMoreInfoTooltip ( path , freespace , totalspace )
188
+ : path ;
189
+
186
190
return new Result
187
191
{
188
192
Title = title ,
@@ -201,8 +205,8 @@ internal static Result CreateDriveSpaceDisplayResult(string path, string actionK
201
205
OpenFolder ( path ) ;
202
206
return true ;
203
207
} ,
204
- TitleToolTip = path ,
205
- SubTitleToolTip = path ,
208
+ TitleToolTip = tooltip ,
209
+ SubTitleToolTip = tooltip ,
206
210
ContextData = new SearchResult { Type = ResultType . Volume , FullPath = path , WindowsIndexed = windowsIndexed }
207
211
} ;
208
212
}
@@ -316,7 +320,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
316
320
return true ;
317
321
} ,
318
322
TitleToolTip = Main . Context . API . GetTranslation ( "plugin_explorer_plugin_ToolTipOpenContainingFolder" ) ,
319
- SubTitleToolTip = Settings . DisplayMoreInformationInToolTip ? GetMoreInfoToolTip ( filePath , ResultType . File ) : filePath ,
323
+ SubTitleToolTip = Settings . DisplayMoreInformationInToolTip ? GetFileMoreInfoTooltip ( filePath ) : filePath ,
320
324
ContextData = new SearchResult { Type = ResultType . File , FullPath = filePath , WindowsIndexed = windowsIndexed }
321
325
} ;
322
326
return result ;
@@ -347,43 +351,46 @@ private static void IncrementEverythingRunCounterIfNeeded(string fileOrFolder)
347
351
_ = Task . Run ( ( ) => EverythingApi . IncrementRunCounterAsync ( fileOrFolder ) ) ;
348
352
}
349
353
350
- private static string GetMoreInfoToolTip ( string filePath , ResultType type )
354
+ private static string GetFileMoreInfoTooltip ( string filePath )
351
355
{
352
- switch ( type )
356
+ try
353
357
{
354
- case ResultType . Folder :
355
- try
356
- {
357
- var folderSize = PreviewPanel . GetFolderSize ( filePath ) ;
358
- var folderCreatedAt = PreviewPanel . GetFolderCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
359
- var folderModifiedAt = PreviewPanel . GetFolderLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
360
- return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
361
- filePath , folderSize , folderCreatedAt , folderModifiedAt , Environment . NewLine ) ;
362
- }
363
- catch ( Exception e )
364
- {
365
- Context . API . LogException ( ClassName , $ "Failed to load tooltip for { filePath } ", e ) ;
366
- return filePath ;
367
- }
368
- case ResultType . File :
369
- try
370
- {
371
- var fileSize = PreviewPanel . GetFileSize ( filePath ) ;
372
- var fileCreatedAt = PreviewPanel . GetFileCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
373
- var fileModifiedAt = PreviewPanel . GetFileLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
374
- return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
375
- filePath , fileSize , fileCreatedAt , fileModifiedAt , Environment . NewLine ) ;
376
- }
377
- catch ( Exception e )
378
- {
379
- Context . API . LogException ( ClassName , $ "Failed to load tooltip for { filePath } ", e ) ;
380
- return filePath ;
381
- }
382
- default :
383
- return filePath ;
358
+ var fileSize = PreviewPanel . GetFileSize ( filePath ) ;
359
+ var fileCreatedAt = PreviewPanel . GetFileCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
360
+ var fileModifiedAt = PreviewPanel . GetFileLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
361
+ return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
362
+ filePath , fileSize , fileCreatedAt , fileModifiedAt , Environment . NewLine ) ;
363
+ }
364
+ catch ( Exception e )
365
+ {
366
+ Context . API . LogException ( ClassName , $ "Failed to load tooltip for { filePath } ", e ) ;
367
+ return filePath ;
384
368
}
385
369
}
386
370
371
+ private static string GetFolderMoreInfoTooltip ( string folderPath )
372
+ {
373
+ try
374
+ {
375
+ var folderSize = PreviewPanel . GetFolderSize ( folderPath ) ;
376
+ var folderCreatedAt = PreviewPanel . GetFolderCreatedAt ( folderPath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
377
+ var folderModifiedAt = PreviewPanel . GetFolderLastModifiedAt ( folderPath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
378
+ return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
379
+ folderPath , folderSize , folderCreatedAt , folderModifiedAt , Environment . NewLine ) ;
380
+ }
381
+ catch ( Exception e )
382
+ {
383
+ Context . API . LogException ( ClassName , $ "Failed to load tooltip for { folderPath } ", e ) ;
384
+ return folderPath ;
385
+ }
386
+ }
387
+
388
+ private static string GetVolumeMoreInfoTooltip ( string volumePath , string freespace , string totalspace )
389
+ {
390
+ return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_volume" ) ,
391
+ volumePath , freespace , totalspace , Environment . NewLine ) ;
392
+ }
393
+
387
394
private static readonly string [ ] MediaExtensions = { ".jpg" , ".png" , ".avi" , ".mkv" , ".bmp" , ".gif" , ".wmv" , ".mp3" , ".flac" , ".mp4" } ;
388
395
}
389
396
0 commit comments