Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 36e0023

Browse files
committedOct 8, 2024··
Use Mica instead of Acryl for content background
1 parent 7347a38 commit 36e0023

26 files changed

+79
-49
lines changed
 

‎README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# SUBSTitute
44
A GUI for mapping directories to virtual drives (see *SUBST* command). It is built on top of **.NET 9** and **Windows App SDK (WinUI 3)**.
55

6-
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot5_en-us.jpg" width="800" alt="Screenshot from version 3.0.0">
6+
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot5_en-us.png" width="800" alt="Screenshot from version 3.0.1">
77
<span style="white-space:nowrap">
8-
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot1_en-us.jpg" width="200" alt="Screenshot from version 3.0.0">
9-
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot2_en-us.jpg" width="200" alt="Screenshot from version 3.0.0">
10-
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot3_en-us.jpg" width="200" alt="Screenshot from version 3.0.0">
11-
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot4_en-us.jpg" width="200" alt="Screenshot from version 3.0.0">
8+
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot1_en-us.png" width="200" alt="Screenshot from version 3.0.1">
9+
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot2_en-us.png" width="200" alt="Screenshot from version 3.0.1">
10+
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot3_en-us.png" width="200" alt="Screenshot from version 3.0.1">
11+
<img src="https://raw.githubusercontent.com/sungaila/SUBSTitute/master/etc/screenshot4_en-us.png" width="200" alt="Screenshot from version 3.0.1">
1212
</span>
1313
<br>
1414
<a href="https://apps.microsoft.com/detail/9NGPRNJJKLBG?launch=true">

‎etc/screenshot1_de-de.jpg

-959 KB
Binary file not shown.

‎etc/screenshot1_de-de.png

-1.73 MB
Loading

‎etc/screenshot1_en-us.jpg

-911 KB
Binary file not shown.

‎etc/screenshot1_en-us.png

-1.7 MB
Loading

‎etc/screenshot2_de-de.jpg

-938 KB
Binary file not shown.

‎etc/screenshot2_de-de.png

-1.4 MB
Loading

‎etc/screenshot2_en-us.jpg

-887 KB
Binary file not shown.

‎etc/screenshot2_en-us.png

-1.36 MB
Loading

‎etc/screenshot3_de-de.jpg

-959 KB
Binary file not shown.

‎etc/screenshot3_de-de.png

-1.83 MB
Loading

‎etc/screenshot3_en-us.jpg

-920 KB
Binary file not shown.

‎etc/screenshot3_en-us.png

-1.8 MB
Loading

‎etc/screenshot4_de-de.jpg

-935 KB
Binary file not shown.

‎etc/screenshot4_de-de.png

-1.79 MB
Loading

‎etc/screenshot4_en-us.jpg

-895 KB
Binary file not shown.

‎etc/screenshot4_en-us.png

-1.76 MB
Loading

‎etc/screenshot5_de-de.jpg

-856 KB
Binary file not shown.

‎etc/screenshot5_de-de.png

-1.52 MB
Loading

‎etc/screenshot5_en-us.jpg

-816 KB
Binary file not shown.

‎etc/screenshot5_en-us.png

-1.49 MB
Loading

‎src/App.manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
33
<assemblyIdentity type="win32"
44
name="Sungaila.SUBSTitute"
5-
version="3.0.0.0" />
5+
version="3.0.1.0" />
66

77
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
88
<application>

‎src/SUBSTitute.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<!-- NuGet -->
3333
<PropertyGroup>
34-
<VersionPrefix>3.0.0</VersionPrefix>
34+
<VersionPrefix>3.0.1</VersionPrefix>
3535
<VersionSuffix></VersionSuffix>
3636
<Authors>David Sungaila</Authors>
3737
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>

‎src/Views/ListView.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<ListView.Header>
2626
<Border Padding="7,9"
27-
Background="{ThemeResource SolidBackgroundFillColorBase}"
27+
Background="{ThemeResource LayerOnMicaBaseAltFillColorSecondary}"
2828
CornerRadius="4">
2929
<i:Interaction.Behaviors>
3030
<behaviors:StickyHeaderBehavior />

‎src/Views/MainWindow.xaml

+48-38
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,63 @@
3030
<converters:NavigationViewDisplayModeToBoolConverter x:Key="NavigationViewDisplayModeToBoolConverter" />
3131
</Grid.Resources>
3232

33-
<canvas:CanvasControl x:Name="PatternCanvas"
33+
<Grid.RowDefinitions>
34+
<RowDefinition Height="Auto" />
35+
<RowDefinition Height="*" />
36+
</Grid.RowDefinitions>
37+
38+
<canvas:CanvasControl x:Name="PatternCanvasHorizontal"
39+
Grid.Row="0"
3440
HorizontalAlignment="Stretch"
3541
VerticalAlignment="Stretch"
3642
CreateResources="PatternCanvas_CreateResources"
3743
Draw="PatternCanvas_Draw"
3844
IsHitTestVisible="False"
3945
Opacity="0.05" />
4046

41-
<Grid>
42-
<Grid.RowDefinitions>
43-
<RowDefinition Height="Auto" />
44-
<RowDefinition Height="*" />
45-
</Grid.RowDefinitions>
47+
<canvas:CanvasControl x:Name="PatternCanvasVertical"
48+
Grid.Row="1"
49+
Width="50"
50+
HorizontalAlignment="Left"
51+
VerticalAlignment="Stretch"
52+
CreateResources="PatternCanvas_CreateResources"
53+
Draw="PatternCanvas_Draw"
54+
IsHitTestVisible="False"
55+
Opacity="0.05"
56+
Visibility="{x:Bind PatternCanvasHorizontal.Visibility, Mode=OneWay}" />
4657

47-
<views:AppTitleBar x:Name="AppTitleBar" Grid.Row="0" />
58+
<views:AppTitleBar x:Name="AppTitleBar" Grid.Row="0" />
4859

49-
<NavigationView x:Name="NavView"
50-
Grid.Row="1"
51-
HorizontalAlignment="Stretch"
52-
VerticalAlignment="Stretch"
53-
d:DataContext="{d:DesignInstance Type=viewmodels:MainViewModel}"
54-
BackRequested="NavView_BackRequested"
55-
CompactModeThresholdWidth="750"
56-
IsBackButtonVisible="Collapsed"
57-
IsPaneToggleButtonVisible="{Binding DisplayMode, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource NavigationViewDisplayModeToBoolConverter}}"
58-
IsSettingsVisible="True"
59-
IsTabStop="False"
60-
Loaded="NavView_Loaded"
61-
OpenPaneLength="200"
62-
PaneClosing="NavView_PaneClosing"
63-
PaneDisplayMode="Auto"
64-
PaneOpening="NavView_PaneOpening"
65-
SelectionChanged="NavView_SelectionChanged">
66-
<NavigationView.MenuItems>
67-
<NavigationViewItem x:Uid="NavigationViewItem"
68-
Icon="MapDrive"
69-
Tag="{extensions:Type Type='views:MappingView'}" />
70-
</NavigationView.MenuItems>
60+
<NavigationView x:Name="NavView"
61+
Grid.Row="1"
62+
HorizontalAlignment="Stretch"
63+
VerticalAlignment="Stretch"
64+
d:DataContext="{d:DesignInstance Type=viewmodels:MainViewModel}"
65+
BackRequested="NavView_BackRequested"
66+
CompactModeThresholdWidth="750"
67+
IsBackButtonVisible="Collapsed"
68+
IsPaneToggleButtonVisible="{Binding DisplayMode, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource NavigationViewDisplayModeToBoolConverter}}"
69+
IsSettingsVisible="True"
70+
IsTabStop="False"
71+
Loaded="NavView_Loaded"
72+
OpenPaneLength="200"
73+
PaneClosing="NavView_PaneClosing"
74+
PaneDisplayMode="Auto"
75+
PaneOpening="NavView_PaneOpening"
76+
SelectionChanged="NavView_SelectionChanged">
77+
<NavigationView.MenuItems>
78+
<NavigationViewItem x:Uid="NavigationViewItem"
79+
Icon="MapDrive"
80+
Tag="{extensions:Type Type='views:MappingView'}" />
81+
</NavigationView.MenuItems>
7182

72-
<Grid Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}">
73-
<Frame x:Name="ContentFrame" />
74-
<InfoBar x:Name="InfoBar"
75-
Margin="10"
76-
HorizontalAlignment="Center"
77-
VerticalAlignment="Bottom" />
78-
</Grid>
79-
</NavigationView>
80-
</Grid>
83+
<Grid x:Name="NavigationViewContentGrid" SizeChanged="Grid_SizeChanged">
84+
<Frame x:Name="ContentFrame" />
85+
<InfoBar x:Name="InfoBar"
86+
Margin="10"
87+
HorizontalAlignment="Center"
88+
VerticalAlignment="Bottom" />
89+
</Grid>
90+
</NavigationView>
8191
</Grid>
8292
</ex:WindowEx>

‎src/Views/MainWindow.xaml.cs

+23-3
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,30 @@ private void PatternCanvas_Draw(CanvasControl sender, CanvasDrawEventArgs args)
229229
SourceRectangle = _canvasBitmap.Bounds
230230
};
231231

232-
using var transform = new Transform2DEffect
232+
using var rotate = new Transform2DEffect
233233
{
234234
Source = tile,
235235
CacheOutput = true,
236236
TransformMatrix = Matrix3x2.CreateTranslation(Vector2.Zero) * Matrix3x2.CreateRotation(-0.0872665f, Vector2.Zero),
237237
InterpolationMode = CanvasImageInterpolation.HighQualityCubic
238238
};
239239

240-
args.DrawingSession.DrawImage(transform);
240+
if (sender == PatternCanvasVertical)
241+
{
242+
using var move = new Transform2DEffect
243+
{
244+
Source = rotate,
245+
CacheOutput = true,
246+
TransformMatrix = Matrix3x2.CreateTranslation(Vector2.Zero) * Matrix3x2.CreateTranslation(0, (float)-PatternCanvasHorizontal.ActualHeight),
247+
InterpolationMode = CanvasImageInterpolation.HighQualityCubic
248+
};
249+
250+
args.DrawingSession.DrawImage(move);
251+
}
252+
else
253+
{
254+
args.DrawingSession.DrawImage(rotate);
255+
}
241256
}
242257

243258
public static bool GetPatternCanvasVisible() => App.LocalSettings.Values["RenderBackgroundPattern"] is not bool render || render;
@@ -250,13 +265,18 @@ public static void SetPatternCanvasVisible(bool value)
250265

251266
private void UpdatePatternCanvasVisibility()
252267
{
253-
PatternCanvas.Visibility = GetPatternCanvasVisible()
268+
PatternCanvasHorizontal.Visibility = GetPatternCanvasVisible()
254269
? Visibility.Visible
255270
: Visibility.Collapsed;
256271
}
257272

258273
private void NavView_PaneOpening(NavigationView sender, object args) => App.LocalSettings.Values["NavViewPaneOpen"] = true;
259274

260275
private void NavView_PaneClosing(NavigationView sender, NavigationViewPaneClosingEventArgs args) => App.LocalSettings.Values["NavViewPaneOpen"] = false;
276+
277+
private void Grid_SizeChanged(object sender, SizeChangedEventArgs e)
278+
{
279+
PatternCanvasVertical.Width = NavigationView.ActualWidth - ContentFrame.ActualWidth;
280+
}
261281
}
262282
}

0 commit comments

Comments
 (0)
Please sign in to comment.