Skip to content

Commit

Permalink
Change background logic #163
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Sep 15, 2024
1 parent ca8c76e commit 312caa2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/PicView.Avalonia/UI/ThemeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static void ChangeBackground(MainViewModel vm)
{
return;
}
SettingsHelper.Settings.UIProperties.BgColorChoice = (SettingsHelper.Settings.UIProperties.BgColorChoice + 1) % 5;
SettingsHelper.Settings.UIProperties.BgColorChoice = (SettingsHelper.Settings.UIProperties.BgColorChoice + 1) % 6;
vm.ImageBackground = BackgroundColorBrush;
}

Expand All @@ -32,8 +32,9 @@ public static void SetBackground(MainViewModel vm)
0 => new SolidColorBrush(Colors.Transparent),
1 => new SolidColorBrush(Colors.White),
2 => new SolidColorBrush(Color.FromRgb(15, 15, 15)),
3 => CreateCheckerboardBrush(),
4 => CreateCheckerboardBrush(Color.FromRgb(235, 235, 235), Color.FromRgb(40, 40, 40), 60),
3 => new SolidColorBrush(Color.FromRgb(5, 5, 5)),
4 => CreateCheckerboardBrush(),
5 => CreateCheckerboardBrush(Color.FromRgb(235, 235, 235), Color.FromRgb(40, 40, 40), 60),
_ => new SolidColorBrush(Colors.Transparent),
};

Expand Down
4 changes: 2 additions & 2 deletions src/PicView.Avalonia/Views/AboutView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public AboutView()
// AppVersion.Text = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
// VersionHelper.GetFileVersionInfo().FileVersion :
// GetType().Assembly.GetName().Version.ToString();
AppVersion.Text = "Avalonia Beta Preview 1";
AppVersion.Text = "Avalonia Beta Preview 3";

KofiImage.PointerEntered += (_, _) =>
{
Expand Down Expand Up @@ -46,7 +46,7 @@ public AboutView()
// TODO: replace with auto download service
UpdateButton.Click += (_, _) =>
{
ProcessHelper.OpenLink("https://picview.org/Avalonia-Download");
ProcessHelper.OpenLink("https://picview.org/avalonia-download");
};
};
}
Expand Down
12 changes: 3 additions & 9 deletions src/PicView.Avalonia/Views/ImageViewer.axaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<UserControl
Background="Transparent"
Background="{CompiledBinding ImageBackground,
Mode=OneWay}"
PointerPressed="InputElement_OnPointerPressed"
mc:Ignorable="d"
x:Class="PicView.Avalonia.Views.ImageViewer"
Expand All @@ -23,14 +24,7 @@
Width="{CompiledBinding ScrollViewerWidth,
Mode=OneWay}"
x:Name="ImageScrollViewer">
<Border
Background="{CompiledBinding ImageBackground,
Mode=OneWay}"
Height="{CompiledBinding ImageHeight,
Mode=OneWay}"
Width="{CompiledBinding ImageWidth,
Mode=OneWay}"
x:Name="MainBorder">
<Border x:Name="MainBorder">
<customControls:PicBox
ImageType="{CompiledBinding ImageType,
Mode=OneWay}"
Expand Down

0 comments on commit 312caa2

Please sign in to comment.