Skip to content

Commit

Permalink
Merge current branch 'AppWindow_gui2' (#30)
Browse files Browse the repository at this point in the history
Merge current branch: Minor GUI changes
  • Loading branch information
tajbender authored Oct 11, 2024
2 parents e17ce61 + 5ab6cf5 commit 89d37c3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 67 deletions.
Binary file modified src/electrifier/Assets/app.ico
Binary file not shown.
44 changes: 5 additions & 39 deletions src/electrifier/Controls/Vanara/ExplorerBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<!-- <ProgressRing IsActive="{x:Bind ViewModel.IsLoading, Mode=OneWay}" />-->
Expand Down Expand Up @@ -202,7 +201,7 @@
<!--<controls:SwitchPresenter Grid.Row="1" Value="{x:Bind HasNavigationFailure}">
<controls:Case Value="true">-->
</StackPanel>
<Border Grid.Row="1">
<Border Grid.Row="1" Visibility="Collapsed">
<InfoBar
x:Name="NavigationFailedInfoBar"
Title="Navigation failed"
Expand Down Expand Up @@ -245,48 +244,15 @@
</StackPanel>-->
<!--</controls:Case>
</controls:SwitchPresenter>-->
<Grid x:Name="ArenaGrid" Grid.Row="3">
<Grid x:Name="ArenaGrid" Grid.Row="2">
<Grid.ColumnDefinitions>
<!-- controls:DockPanel.Dock="Left" -->
<ColumnDefinition Width="256" MinWidth="76" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" MinWidth="76" />
</Grid.ColumnDefinitions>
<Border x:Name="NavigationAreaBorder">
<StackPanel VerticalAlignment="Top">
<Expander
Grid.Column="0"
Padding="8"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Top"
IsEnabled="True"
IsExpanded="True">
<Expander.Header>
<TextBlock>Desktop</TextBlock>
</Expander.Header>
<Expander.Content>
<local:Shell32TreeView x:Name="ShellTreeView" VerticalAlignment="Top" />
</Expander.Content>
</Expander>
<Expander
Grid.Column="0"
Padding="8"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Top"
IsEnabled="True"
IsExpanded="True">
<Expander.Header>
<TextBlock>History</TextBlock>
</Expander.Header>
<Expander.Content>
<Border />
</Expander.Content>
</Expander>
</StackPanel>
<Border x:Name="TreeViewBorder" Visibility="{x:Bind TreeViewVisibility}">
<local:Shell32TreeView x:Name="ShellTreeView" />
</Border>
<!-- TODO: GridSplitter is not Working when TreeView Visibility changes to Collapsed -->
<controls:GridSplitter
Expand Down Expand Up @@ -357,7 +323,7 @@
</Border>-->
</Grid>
<CommandBar
Grid.Row="4"
Grid.Row="3"
HorizontalAlignment="Left"
VerticalAlignment="Center"
HorizontalContentAlignment="Left"
Expand Down
23 changes: 14 additions & 9 deletions src/electrifier/Controls/Vanara/ExplorerBrowser.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,22 @@ public void InitializeStockIcons()
try
{
using var siFolder = new StockIcon(Shell32.SHSTOCKICONID.SIID_FOLDER);

var loc = siFolder.Location; // TODO: Why do we have to call this first, to init the StockIcon?

//using var siFolderOpen = new StockIcon(Shell32.SHSTOCKICONID.SIID_FOLDEROPEN);
// TODO: Opened Folder Icon, use for selected TreeViewItems
//using var siVar = new StockIcon(Shell32.SHSTOCKICONID.SIID_DOCASSOC);

var icnHandle = siFolder.IconHandle.ToIcon();
HICON handle = siFolder.IconHandle;
var icon = siFolder.IconHandle.ToIcon();
//HICON handle = siFolder.IconHandle;
//var icon = siFolder.IconHandle.ToIcon();
//if (icnHandle != null)
{
//var icon = Icon.FromHandle((nint)icnHandle);
var bmpSource = GetWinUi3BitmapSourceFromIcon(icon);
var bmpSource = GetWinUi3BitmapSourceFromIcon(icnHandle);


//_defaultFolderImageBitmapSource = bmpSource;
}

Expand Down Expand Up @@ -311,14 +316,14 @@ public void ExtractChildItems(ExplorerBrowserItem targetFolder)
var children = shFolder.EnumerateChildren(FolderItemFilter.Folders | FolderItemFilter.NonFolders);
var shellItems = children as ShellItem[] ?? children.ToArray();
itemCount = shellItems.Length;
targetFolder.Children = null; // = new ReadOnlyDictionary<ExplorerBrowserItem, int>();
targetFolder.Children = []; // TODO: new ReadOnlyDictionary<ExplorerBrowserItem, int>();

if (shellItems.Length > 0)
{
foreach (var child in shellItems)
{
var ebItem = new ExplorerBrowserItem(child);
//targetFolder.Children?.Add(ebItem);
targetFolder.Children?.Add(ebItem);
}
}
}
Expand Down Expand Up @@ -403,10 +408,10 @@ public void Navigate(ExplorerBrowserItem ebItem, bool selectTreeViewNode = false
return;
}

//foreach (var childItem in ebItem.Children)
//{
// CurrentFolderItems.Add(childItem);
//}
foreach (var childItem in ebItem.Children)
{
CurrentFolderItems.Add(childItem);
}
}

catch (COMException comEx)
Expand Down
3 changes: 3 additions & 0 deletions src/electrifier/Controls/Vanara/Shell32GridView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ namespace electrifier.Controls.Vanara;
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(), nq}}")]
public sealed partial class Shell32GridView : INotifyPropertyChanged
{
private static readonly IList<object> addedItems;
public IList<object> AddedItems => addedItems;

public GridView NativeGridView => GridView;
public object ItemsSource
{
Expand Down
4 changes: 2 additions & 2 deletions src/electrifier/Controls/Vanara/Shell32TreeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<TreeView x:Name="TreeView" SelectionMode="Single">
<TreeView.ItemTemplate>
<DataTemplate x:DataType="local:ExplorerBrowserItem">
<!-- TODO: For hidden folders, add 'Opacity="0.66"' to TreeViewItem -->
<TreeViewItem
HasUnrealizedChildren="{x:Bind HasUnrealizedChildren}"
IsExpanded="{x:Bind IsExpanded}"
IsSelected="{x:Bind IsSelected}"
ItemsSource="{x:Bind Children}"
Opacity="0.66">
ItemsSource="{x:Bind Children}">
<StackPanel MaxHeight="20" Orientation="Horizontal">
<controls:ImageEx
Name="ExplorerBrowserItemImageEx"
Expand Down
21 changes: 4 additions & 17 deletions src/electrifier/electrifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@
<Nullable>enable</Nullable>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<AssemblyVersion>1.24.802</AssemblyVersion>
<AssemblyVersion>1.24.924</AssemblyVersion>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RunAnalyzersDuringLiveAnalysis>True</RunAnalyzersDuringLiveAnalysis>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<Description>Integrated Desktop Environment</Description>
<Copyright>(c) tajbender, electrifier.org</Copyright>
<PackageProjectUrl>https://www.electrifier.org</PackageProjectUrl>
<PackageProjectUrl>https://github.com/electrifier</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/electrifier</RepositoryUrl>
<UserSecretsId>8a2a75f7-cf60-45ba-b4cc-68e3ff9a8e22</UserSecretsId>
<PackageIcon>Square44x44Logo.scale-200.png</PackageIcon>
<PackageCertificateThumbprint>412DFB2FB1169368A38C65F3586FFEFECA0AB03B</PackageCertificateThumbprint>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\StoreLogo.scale-150.png" />
<None Remove="Controls\Vanara\Shell32BreadcrumbBar.xaml" />
</ItemGroup>

<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
Expand All @@ -53,7 +49,7 @@
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="Vanara.Windows.Shell" Version="4.0.4" />
<PackageReference Include="Vanara.Windows.Shell.Common" Version="4.0.4" />
Expand All @@ -64,23 +60,14 @@
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Page Update="Controls\Vanara\Shell32BreadcrumbBar.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<None Update="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>

<ItemGroup>
<Folder Include="Assets\Themes\Aero Blackcomb\" />
</ItemGroup>

<ItemGroup>
<None Include="Assets\Square44x44Logo.scale-200.png">
<Pack>True</Pack>
Expand All @@ -90,8 +77,8 @@
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<Folder Include="Assets\Themes\Aero Blackcomb\" />
</ItemGroup>

<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
Expand Down

0 comments on commit 89d37c3

Please sign in to comment.