Skip to content

Commit 9e74ff8

Browse files
lilyremigiabrliron
authored andcommitted
Add OS-dependent emoji support and application manifest
1 parent 99044eb commit 9e74ff8

File tree

4 files changed

+53
-10
lines changed

4 files changed

+53
-10
lines changed

thcrap_configure_v3/Page2_advanced.xaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120
Padding="0"
121121
VerticalAlignment="Stretch"
122122
Click="SearchButton_OnClick"
123-
Content="🔎">
123+
Content="{Binding SearchEmoji}"
124+
FontFamily="{Binding EmojiWebdingsFontFamily}">
124125
<Button.Style>
125126
<Style TargetType="Button">
126127
<Setter Property="BorderBrush"
@@ -208,8 +209,9 @@
208209
Tag="{Binding}"
209210
ToolTip="{Binding SourcePatch.Id}"
210211
Style="{StaticResource HoverVisibleButtonStyle}"
211-
Content="🡺"
212-
SnapsToDevicePixels="True">
212+
Content="{Binding RightArrow}"
213+
SnapsToDevicePixels="True"
214+
FontFamily="{Binding EmojiWingingds3FontFamily}">
213215
</Button>
214216
</Grid>
215217
</HierarchicalDataTemplate>
@@ -357,14 +359,16 @@
357359
Tag="{Binding}"
358360
Margin="0"
359361
Style="{StaticResource HoverVisibleButtonStyle}"
360-
Content="🡸">
362+
Content="{Binding LeftArrow}"
363+
FontFamily="{Binding EmojiWingingds3FontFamily}">
361364
</Button>
362365
<Button x:Name="UpButton"
363366
Click="SelectedPatch_MoveUp"
364367
Grid.Column="1"
365368
Grid.Row="0"
366369
Tag="{Binding}"
367-
Content="🡹">
370+
Content="{Binding UpArrow}"
371+
FontFamily="{Binding EmojiWingingds3FontFamily}">
368372
<Button.Style>
369373
<Style TargetType="Button">
370374
<Setter Property="Visibility" Value="Hidden" />
@@ -418,7 +422,8 @@
418422
Grid.Column="1"
419423
Grid.Row="1"
420424
Tag="{Binding}"
421-
Content="🡻">
425+
Content="{Binding DownArrow}"
426+
FontFamily="{Binding EmojiWingingds3FontFamily}">
422427
<Button.Style>
423428
<Style TargetType="Button">
424429
<Setter Property="Visibility" Value="Hidden" />

thcrap_configure_v3/Page2_advanced.xaml.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ namespace thcrap_configure_v3
2424
/// <summary>
2525
/// Interaction logic for Page2_advanced.xaml
2626
/// </summary>
27-
public partial class Page2_advanced : UserControl
27+
public partial class Page2_advanced : UserControl, INotifyPropertyChanged
2828
{
29+
public event PropertyChangedEventHandler PropertyChanged;
30+
public string SearchEmoji => Environment.OSVersion.Version.Major >= 10 ? "\ud83d\udd0e" : "L";
31+
public string SearchCrossEmoji => Environment.OSVersion.Version.Major >= 10 ? "\u274c" : "r";
32+
33+
public FontFamily EmojiWebdingsFontFamily => Environment.OSVersion.Version.Major >= 10 ? FontFamily : new FontFamily("Webdings");
34+
2935
private int isUnedited = 1;
3036
private int configMaxLength = 0;
3137

@@ -74,12 +80,18 @@ private void RemoveFromConfigName(string patchName)
7480
public class RepoPatch : INotifyPropertyChanged
7581
{
7682
public thcrap_configure_v3.RepoPatch SourcePatch { get; set; }
83+
84+
public string RightArrow => Environment.OSVersion.Version.Major >= 10 ? "\ud83e\udc7a" : "è";
85+
public string LeftArrow => Environment.OSVersion.Version.Major >= 10 ? "\ud83e\udc78" : "ç";
86+
public string UpArrow => Environment.OSVersion.Version.Major >= 10 ? "\ud83e\udc79" : "é";
87+
public string DownArrow => Environment.OSVersion.Version.Major >= 10 ? "\ud83e\udc7b" : "ê";
88+
public FontFamily EmojiWingingds3FontFamily => Environment.OSVersion.Version.Major >= 10 ? SystemFonts.MessageFontFamily : new FontFamily("Wingdings 3");
89+
7790
private bool isSelected = false;
7891
private bool isVisibleWithSearch = true;
7992
private bool _isFirst;
8093
private bool _isLast;
8194

82-
8395
public bool IsFirst
8496
{
8597
get => _isFirst;
@@ -164,6 +176,9 @@ public class Repo : INotifyPropertyChanged
164176
{
165177
public thcrap_configure_v3.Repo SourceRepo { get; private set; }
166178
public List<RepoPatch> Patches { get; private set; }
179+
180+
181+
167182
private bool isVisible = true;
168183

169184
public Repo(thcrap_configure_v3.Repo repo)
@@ -213,6 +228,7 @@ public bool UpdateFilter(string filter)
213228
public Page2_advanced()
214229
{
215230
InitializeComponent();
231+
this.DataContext = this;
216232
}
217233

218234
public void SetRepoList(List<thcrap_configure_v3.Repo> repoList)
@@ -408,12 +424,12 @@ private void QuickFilterChanged(object sender, TextChangedEventArgs e)
408424
if (filter.Length > 0)
409425
{
410426
Placeholder.Visibility = Visibility.Hidden;
411-
SearchButton.Content = '\u274c'; // cross mark
427+
SearchButton.Content = SearchCrossEmoji;
412428
}
413429
else
414430
{
415431
Placeholder.Visibility = Visibility.Visible;
416-
SearchButton.Content = "\ud83d\udd0e"; // magnifying glass
432+
SearchButton.Content = SearchEmoji;
417433
}
418434

419435
if (AvailablePatches?.ItemsSource is IEnumerable<Repo> repos)

thcrap_configure_v3/app.manifest

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
4+
<application>
5+
<!--The ID below indicates app support for Windows Vista -->
6+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
7+
<!--The ID below indicates app support for Windows 7 -->
8+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
9+
<!--The ID below indicates app support for Windows 8 -->
10+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
11+
<!--The ID below indicates app support for Windows 10 -->
12+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
13+
</application>
14+
</compatibility>
15+
</assembly>

thcrap_configure_v3/thcrap_configure_v3.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
<PropertyGroup>
4141
<ApplicationIcon>$(SolutionDir)\gfx\abstractcactus\icon_01.ico</ApplicationIcon>
4242
</PropertyGroup>
43+
<PropertyGroup />
44+
<PropertyGroup />
45+
<PropertyGroup />
46+
<PropertyGroup>
47+
<ApplicationManifest>app.manifest</ApplicationManifest>
48+
</PropertyGroup>
4349
<ItemGroup>
4450
<Reference Include="System" />
4551
<Reference Include="System.Data" />
@@ -147,6 +153,7 @@
147153
<Generator>ResXFileCodeGenerator</Generator>
148154
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
149155
</EmbeddedResource>
156+
<None Include="app.manifest" />
150157
<None Include="Properties\Settings.settings">
151158
<Generator>SettingsSingleFileGenerator</Generator>
152159
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

0 commit comments

Comments
 (0)