Skip to content

Commit 99d3175

Browse files
authored
Merge pull request #36 from TheJoeFin/dev
Dev
2 parents d4c09c4 + 9f96d2b commit 99d3175

26 files changed

Lines changed: 196 additions & 77 deletions

Simple QR Code Maker.Core/Simple QR Code Maker.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="System.Text.Json" Version="9.0.3" />
14+
<PackageReference Include="System.Text.Json" Version="9.0.4" />
1515
</ItemGroup>
1616
</Project>

Simple QR Code Maker/Controls/FaqsContent.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
</DataTemplate>
4141
</ItemsRepeater.ItemTemplate>
4242
</ItemsRepeater>
43+
<TextBlock
44+
Padding="24,10"
45+
Text="Don't see your question here? Feel free to email me and I'll get you an answer"
46+
TextWrapping="Wrap" />
47+
<local:IconAndTextButton
48+
HorizontalAlignment="Center"
49+
Click="IconAndTextButton_Click"
50+
Text="Email a Question">
51+
<local:IconAndTextButton.Icon>
52+
<SymbolIcon Symbol="Mail" />
53+
</local:IconAndTextButton.Icon>
54+
</local:IconAndTextButton>
4355
</StackPanel>
4456
</ScrollViewer>
4557
</UserControl>

Simple QR Code Maker/Controls/FaqsContent.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.UI.Xaml.Controls;
22
using Simple_QR_Code_Maker.ViewModels;
3+
using Windows.System;
34

45
namespace Simple_QR_Code_Maker.Controls;
56

@@ -12,4 +13,9 @@ public FaqsContent()
1213
InitializeComponent();
1314
DataContext = ViewModel;
1415
}
16+
17+
private async void IconAndTextButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
18+
{
19+
_ = await Launcher.LaunchUriAsync(new Uri("mailto:joe@joefinapps.com"));
20+
}
1521
}

Simple QR Code Maker/Controls/HideIcon.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace Simple_QR_Code_Maker.Controls;
66

77
public partial class HideIcon : FontIcon
88
{
9-
public HideIcon()
10-
{
11-
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12-
this.Glyph = "\uED1A";
13-
}
9+
public HideIcon()
10+
{
11+
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12+
this.Glyph = "\uED1A";
13+
}
1414
}

Simple QR Code Maker/Controls/HistoryIcon.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace Simple_QR_Code_Maker.Controls;
66

77
public partial class HistoryIcon : FontIcon
88
{
9-
public HistoryIcon()
10-
{
11-
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12-
this.Glyph = "\uE81C";
13-
}
9+
public HistoryIcon()
10+
{
11+
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12+
this.Glyph = "\uE81C";
13+
}
1414
}
1515

Simple QR Code Maker/Controls/HistoryRowItem.xaml.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace Simple_QR_Code_Maker.Controls;
77
public sealed partial class HistoryRowItem : UserControl
88
{
99

10-
1110
public HistoryItem Data
1211
{
1312
get { return (HistoryItem)GetValue(DataProperty); }
@@ -17,8 +16,6 @@ public HistoryItem Data
1716
public static readonly DependencyProperty DataProperty =
1817
DependencyProperty.Register("Data", typeof(HistoryItem), typeof(HistoryRowItem), new PropertyMetadata(null));
1918

20-
21-
2219
public HistoryRowItem()
2320
{
2421
this.InitializeComponent();

Simple QR Code Maker/Controls/QrCodeIcon.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace Simple_QR_Code_Maker.Controls;
66

77
public partial class QrCodeIcon : FontIcon
88
{
9-
public QrCodeIcon()
10-
{
11-
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12-
this.Glyph = "\uED14";
13-
}
9+
public QrCodeIcon()
10+
{
11+
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12+
this.Glyph = "\uED14";
13+
}
1414
}
1515

Simple QR Code Maker/Controls/RulerIcon.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace Simple_QR_Code_Maker.Controls;
66

77
public partial class RulerIcon : FontIcon
88
{
9-
public RulerIcon()
10-
{
11-
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12-
this.Glyph = "\uecc6";
13-
}
9+
public RulerIcon()
10+
{
11+
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12+
this.Glyph = "\uecc6";
13+
}
1414
}
1515

Simple QR Code Maker/Controls/ScanIcon.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace Simple_QR_Code_Maker.Controls;
66

77
public partial class ScanIcon : FontIcon
88
{
9-
public ScanIcon()
10-
{
11-
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12-
this.Glyph = "\uEE6F";
13-
}
9+
public ScanIcon()
10+
{
11+
this.FontFamily = (FontFamily)Application.Current.Resources["SymbolThemeFontFamily"];
12+
this.Glyph = "\uEE6F";
13+
}
1414
}
1515

Simple QR Code Maker/Helpers/BarcodeHelpers.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,36 @@ public static double SmallestCodeSide(double distance, int numberOfBlocks)
6060
int padding = 2 * 2;
6161

6262
double blockSize = (distance + 2.721) / 1759.1;
63+
64+
// check if the block size is too small for normal printer
65+
if (blockSize < 0.007)
66+
return 0;
67+
6368
double codeSize = blockSize * (numberOfBlocks + padding);
6469
return codeSize;
6570
}
6671

67-
public static double ContrastRatioLossFrac(double constrastRatio)
72+
public static double ContrastRatioLossFrac(double contrastRatio)
6873
{
6974
double x1 = 21;
7075
double y1 = 1;
7176
double x2 = 2.5;
7277
double y2 = 0.8;
7378

7479
double slope = (y2 - y1) / (x2 - x1);
75-
double yIntercept = y1 - slope * x1;
80+
double yIntercept = y1 - (slope * x1);
7681

77-
return slope * constrastRatio + yIntercept;
82+
return (slope * contrastRatio) + yIntercept;
7883
}
7984

8085
public static string SmallestSideWithUnits(double distance, int numberOfBlocks, Windows.UI.Color foreground, Windows.UI.Color background)
8186
{
8287
bool isMetric = RegionInfo.CurrentRegion.IsMetric;
8388
double smallestSide = SmallestCodeSide(distance, numberOfBlocks);
8489

90+
if (smallestSide == 0)
91+
return "Error at selected max distance.";
92+
8593
double contrastRatio = ColorHelpers.GetContrastRatio(foreground, background);
8694

8795
if (contrastRatio < 2.5)

0 commit comments

Comments
 (0)