@@ -286,18 +286,49 @@ private async void BreadcrumbBar_ItemDropDownFlyoutOpening(object sender, Breadc
286286 {
287287 if ( e . IsRootItem )
288288 {
289- // TODO: Populate a different flyout for the root item
289+ IHomeFolder homeFolder = new HomeFolder ( ) ;
290+
290291 e . Flyout . Items . Add ( new MenuFlyoutHeaderItem ( ) { Text = "Quick access" } ) ;
291- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Desktop" } ) ;
292- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Download" } ) ;
293- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Documents" } ) ;
294- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Pictures" } ) ;
295- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Music" } ) ;
296- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Videos" } ) ;
297- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Recycle bin" } ) ;
292+
293+ await foreach ( var storable in homeFolder . GetQuickAccessFolderAsync ( ) )
294+ {
295+ if ( storable is not IWindowsStorable windowsStorable )
296+ continue ;
297+
298+ var flyoutItem = new MenuFlyoutItem ( )
299+ {
300+ Text = windowsStorable . GetDisplayName ( Windows . Win32 . UI . Shell . SIGDN . SIGDN_PARENTRELATIVEFORUI ) ,
301+ Icon = new FontIcon { Glyph = "\uE8B7 " } , // Use font icon as placeholder
302+ } ;
303+
304+ e . Flyout . Items . Add ( flyoutItem ) ;
305+
306+ windowsStorable . TryGetThumbnail ( ( int ) ( 16f * App . AppModel . AppWindowDPI ) , Windows . Win32 . UI . Shell . SIIGBF . SIIGBF_ICONONLY , out var thumbnailData ) ;
307+ flyoutItem . Icon = new ImageIcon ( ) { Source = await MainWindow . Instance . DispatcherQueue . EnqueueOrInvokeAsync ( ( ) => thumbnailData . ToBitmapAsync ( ) , Microsoft . UI . Dispatching . DispatcherQueuePriority . Normal ) } ;
308+
309+ windowsStorable . Dispose ( ) ;
310+ }
311+
298312 e . Flyout . Items . Add ( new MenuFlyoutHeaderItem ( ) { Text = "Drives" } ) ;
299- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Local Disk (C:)" } ) ;
300- e . Flyout . Items . Add ( new MenuFlyoutItem ( ) { Text = "Local Disk (D:)" } ) ;
313+
314+ await foreach ( var storable in homeFolder . GetLogicalDrivesAsync ( ) )
315+ {
316+ if ( storable is not IWindowsStorable windowsStorable )
317+ continue ;
318+
319+ var flyoutItem = new MenuFlyoutItem ( )
320+ {
321+ Text = windowsStorable . GetDisplayName ( Windows . Win32 . UI . Shell . SIGDN . SIGDN_PARENTRELATIVEFORUI ) ,
322+ Icon = new FontIcon { Glyph = "\uE8B7 " } , // Use font icon as placeholder
323+ } ;
324+
325+ e . Flyout . Items . Add ( flyoutItem ) ;
326+
327+ windowsStorable . TryGetThumbnail ( ( int ) ( 16f * App . AppModel . AppWindowDPI ) , Windows . Win32 . UI . Shell . SIIGBF . SIIGBF_ICONONLY , out var thumbnailData ) ;
328+ flyoutItem . Icon = new ImageIcon ( ) { Source = await MainWindow . Instance . DispatcherQueue . EnqueueOrInvokeAsync ( ( ) => thumbnailData . ToBitmapAsync ( ) , Microsoft . UI . Dispatching . DispatcherQueuePriority . Normal ) } ;
329+
330+ windowsStorable . Dispose ( ) ;
331+ }
301332
302333 return ;
303334 }
0 commit comments