]> O.S.I.I.S - jp/crow.git/commitdiff
debug size inequality
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 21 Apr 2020 13:39:37 +0000 (15:39 +0200)
committerj-p <jp_bruyere@hotmail.com>
Sat, 9 May 2020 22:50:02 +0000 (00:50 +0200)
Crow/src/Size.cs
Samples/common/ui/templates/enumGetIcons.itmp [new file with mode: 0644]

index 18bc8b5751f15fb2a01d68631778b9ead50b5ff0..77347f06ad64aa1da340722beadf1656c368619a 100644 (file)
@@ -30,7 +30,7 @@ namespace Crow
                public static implicit operator Size(string s)=> string.IsNullOrEmpty (s) ? Zero : Parse (s);
 
                public static bool operator == (Size s1, Size s2) => (s1.Width == s2.Width && s1.Height == s2.Height);
-               public static bool operator != (Size s1, Size s2) => (s1.Width == s2.Width && s1.Height == s2.Height);
+               public static bool operator != (Size s1, Size s2) => (s1.Width != s2.Width || s1.Height != s2.Height);
                public static bool operator > (Size s1, Size s2) => (s1.Width > s2.Width && s1.Height > s2.Height);
                public static bool operator >= (Size s1, Size s2) => (s1.Width >= s2.Width && s1.Height >= s2.Height);
                public static bool operator < (Size s1, Size s2) => (s1.Width < s2.Width) ? s1.Height <= s2.Height :
@@ -41,7 +41,7 @@ namespace Crow
                public static bool operator >= (Size s, int i) => s.Width >= i && s.Height >= i;
                public static bool operator <= (Size s1, Size s2) => (s1.Width <= s2.Width && s1.Height <= s2.Height);
                public static bool operator == (Size s, int i) => (s.Width == i && s.Height == i);
-               public static bool operator != (Size s, int i) => (s.Width == i && s.Height == i);
+               public static bool operator != (Size s, int i) => (s.Width != i || s.Height != i);
                public static Size operator + (Size s1, Size s2) => new Size (s1.Width + s2.Width, s1.Height + s2.Height);
                public static Size operator + (Size s, int i) => new Size (s.Width + i, s.Height + i);
                public static Size operator * (Size s, int i) => new Size (s.Width * i, s.Height * i);
diff --git a/Samples/common/ui/templates/enumGetIcons.itmp b/Samples/common/ui/templates/enumGetIcons.itmp
new file mode 100644 (file)
index 0000000..048d495
--- /dev/null
@@ -0,0 +1,7 @@
+<Label Font="{./Font}" Text="{./Caption}" CornerRadius="{./CornerRadius}"
+       Margin="3"
+       Background="{./Background}"
+       Foreground="DimGrey"
+       TextAlignment="Center"
+       MouseEnter="{Foreground=White}"
+       MouseLeave="{Foreground=DimGrey}"/>
\ No newline at end of file