Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BluescreenSimulator/CmdParameterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static bool TryGetColor(string c, out Color result)
{
if (!c.StartsWith("#")) c = $"#{c}";
// Removes the F at the beginning, which makes the resulting hex be 7 chars long, not 6
c = $"#{c.Substring(2)}";
c = $"#{c.Substring(3)}";
try
{
var color = ColorConverter.ConvertFromString(c) as Color?;
Expand Down
5 changes: 3 additions & 2 deletions BluescreenSimulator/Models/Windows10Bluescreen.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Strings = BluescreenSimulator.Properties.Windows10BluescreenResources;
using Strings = BluescreenSimulator.Properties.Windows10BluescreenResources;
namespace BluescreenSimulator
{
public class Windows10Bluescreen : BluescreenBase
Expand All @@ -19,7 +19,8 @@ public class Windows10Bluescreen : BluescreenBase

public bool HideQR { get; set; } = false;

public bool UseOriginalQR { get; set; } = true;
// NOTE: transparent QR code is used by default
public bool UseOriginalQR { get; set; } = false;

public double TextDelay { get; set; }
}
Expand Down
4 changes: 2 additions & 2 deletions BluescreenSimulator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.4.0")]
[assembly: AssemblyFileVersion("3.4.0")]
[assembly: AssemblyVersion("3.4.1")]
[assembly: AssemblyFileVersion("3.4.1")]

namespace BluescreenSimulator.Properties
{
Expand Down
11 changes: 9 additions & 2 deletions BluescreenSimulator/ViewModels/Windows10BluescreenViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Threading;
using System.Threading;
using BluescreenSimulator.Views;

namespace BluescreenSimulator.ViewModels
Expand Down Expand Up @@ -65,9 +65,16 @@ public string StopCode
public bool HideQR
{
get => Model.HideQR;
set => SetModelProperty(value, others: nameof(ShowQR));
set
{
// NOTE: fixed qr visibility issue
SetModelProperty(value, others: nameof(ShowQR));
OnPropertyChanged(nameof(ShowQR));
}
}

// NOTE: made ShowQR computed property that depends on HideQR
// OnPropertyChanged call above should ensure UI update when this property's value changes
public bool ShowQR => !HideQR;
[CmdParameter("-oq", Description = "Use original QR code", FullAlias = "origqr")]
public bool UseOriginalQR
Expand Down
4 changes: 3 additions & 1 deletion BluescreenSimulator/Views/BluescreenWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Window x:Class="BluescreenSimulator.Views.BluescreenWindow"
<Window x:Class="BluescreenSimulator.Views.BluescreenWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand Down Expand Up @@ -51,8 +51,10 @@
x:Name="QrCodeImage">
<Image.Style>
<Style TargetType="Image">
<!-- NOTE: path to the transparent qr code which is used by default-->
<Setter Property="Source" Value="/Resources/qr_transparent.png"/>
<Style.Triggers>
<!-- NOTE: path to the original blue qr code when UseOriginalQR is true -->
<DataTrigger Binding="{Binding UseOriginalQR}" Value="True">
<Setter Property="Source" Value="/Resources/qr.png"></Setter>
</DataTrigger>
Expand Down
7 changes: 4 additions & 3 deletions BluescreenSimulator/Views/BluescreenWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -53,6 +53,8 @@ private void Window_AboutToClose(object sender, CancelEventArgs e)

private void SetUpQR()
{
// NOTE: tried to fix the qr code being blue despite choice, idk if it will be a long term fix
// should work for now ¯\_(ツ)_/¯
if (_vm.UseOriginalQR)
{
QrCodeImage.Source = Imaging.CreateBitmapSourceFromHBitmap(Properties.Resources.qr.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
Expand Down Expand Up @@ -85,7 +87,7 @@ private async Task BeginTextDelay(double delay)
MainText1.Visibility = Visibility.Hidden;
MainText2.Visibility = Visibility.Hidden;
Progress.Visibility = Visibility.Hidden;
Qrcode.Visibility = Visibility.Hidden;
// NOTE: removed some stuff to prevent conflicts, qr code visibility is handled by xaml binding: {Binding ShowQR, Converter={StaticResource BoolToVisibilityConverter}} (dunno if this is the best way to do it but it works)
MoreInfo.Visibility = Visibility.Hidden;
SupportPerson.Visibility = Visibility.Hidden;
StopCode.Visibility = Visibility.Hidden;
Expand All @@ -97,7 +99,6 @@ private async Task BeginTextDelay(double delay)
MoreInfo.Visibility = Visibility.Visible;
SupportPerson.Visibility = Visibility.Visible;
StopCode.Visibility = Visibility.Visible;
Qrcode.Visibility = Visibility.Visible;
}

private static readonly Key[] BlockingKeys = { Key.System, F4, LWin, RWin, Tab, LeftAlt, RightAlt };
Expand Down