Add Bold Font style to Next and Previous buttons
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Fri, 3 Apr 2020 13:49:36 +0000 (15:49 +0200)
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Fri, 3 Apr 2020 14:00:48 +0000 (16:00 +0200)
Oobe/Oobe.Terms/Views/TermsView.cs
Oobe/Oobe.Welcome/WelcomeStep.cs
Oobe/OobeCommon/Styles/ButtonsExtensions.cs [new file with mode: 0644]
Oobe/OobeLanguage/LanguageStep.cs
Oobe/OobeRegion/RegionStep.cs
Oobe/OobeWifi/WifiStep.cs

index 730f836294a1eb537bbd19975cfcee354717aa2d..d5a12b2501fcb22a0b4c04c625e4bab9d0ecb560 100644 (file)
@@ -75,6 +75,7 @@ namespace Oobe.Terms.Views
             {
                 nav.Next();
             };
+            nextButton.SetFontStyle(new PropertyMap().AddBoldFontStyle());
 
             Button prev = new Button(ButtonStyles.Previous);
             prev.Position2D = new Position2D(56, 512);
@@ -82,6 +83,7 @@ namespace Oobe.Terms.Views
             {
                 nav.Previous();
             };
+            prev.SetFontStyle(new PropertyMap().AddBoldFontStyle());
 
             TextLabel guide = new TextLabel(TextLabelStyles.GuideTextLabelStyle);
             guide.Position2D = new Position2D(155, 442);
index 521792f3b1cab0649a2108c450f273ed40d72659..39149803677c3cb37e96c5c1deec657240597abc 100644 (file)
@@ -38,6 +38,7 @@ namespace Oobe.Welcome
             next.ClickEvent += (obj, args) => {\r
                 nav.Finish();\r
             };\r
+            next.SetFontStyle(new PropertyMap().AddBoldFontStyle());\r
 \r
             container.Add(title);\r
             container.Add(next);\r
diff --git a/Oobe/OobeCommon/Styles/ButtonsExtensions.cs b/Oobe/OobeCommon/Styles/ButtonsExtensions.cs
new file mode 100644 (file)
index 0000000..770ab82
--- /dev/null
@@ -0,0 +1,38 @@
+using System;
+using Tizen.NUI.Components;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace Oobe.Common.Styles
+{
+    public static class ButtonsExtensions
+    {
+        public static PropertyMap GetFontStyle(this Button button)
+        {
+            // workaround for limitation of settings FontStyle of button text
+            // throught TextLabelStyle class
+            foreach (View child in button.Children)
+            {
+                if (child is TextLabel label)
+                {
+                    return label.FontStyle;
+                }
+            }
+            return null;
+        }
+
+        public static void SetFontStyle(this Button button, PropertyMap map)
+        {
+            // workaround for limitation of settings FontStyle of button text
+            // throught TextLabelStyle class
+            foreach (View child in button.Children)
+            {
+                if (child is TextLabel label)
+                {
+                    label.FontStyle = map;
+                    break;
+                }
+            }
+        }
+    }
+}
index 9964ae615d8d91a3594834b2949c434ec13293b2..b60a4cc3c9cc743169cd560895f46a5d666af06a 100644 (file)
@@ -66,6 +66,7 @@ namespace Oobe.Language
                 }\r
                 nav.Next();\r
             };\r
+            btn.SetFontStyle(new PropertyMap().AddBoldFontStyle());\r
 \r
             carousel.SelectedItemChanged += (sender, args) =>\r
             {\r
index 127052df3d5f33dcc73a315d818c62531312e849..fc0b782477e68d5b69b3a173d402fe6a9b7de7e2 100644 (file)
@@ -57,12 +57,14 @@ namespace Oobe.Region
                 }\r
                 nav.Next();\r
             };\r
+            next.SetFontStyle(new PropertyMap().AddBoldFontStyle());\r
 \r
             Button prev = new Button(ButtonStyles.Previous);\r
             prev.Position2D = new Position2D(56, 512);\r
             prev.ClickEvent += (obj, args) => {\r
                 nav.Previous();\r
             };\r
+            prev.SetFontStyle(new PropertyMap().AddBoldFontStyle());\r
 \r
             container.Add(carousel);\r
             container.Add(title);\r
index 8c61de7b13631c92698bb78232cfa4b708b91e76..8a35e604bf513400ff5de66ba6d4b8e4431d5478 100644 (file)
@@ -64,6 +64,7 @@ namespace Oobe.Wifi
                 Position = new Position(56, 10),
                 Size2D = new Size2D(240, 72),
             };
+            Oobe.Common.Styles.ButtonsExtensions.SetFontStyle(prev, new PropertyMap().AddBoldFontStyle());
             prev.ClickEvent += (s, e) => nav.Previous();
             view.Add(prev);
 
@@ -72,6 +73,7 @@ namespace Oobe.Wifi
                 Position = new Position(888, 10),
                 Size2D = new Size2D(240, 72),
             };
+            next.SetFontStyle(new PropertyMap().AddBoldFontStyle());
             next.ClickEvent += (s, e) => nav.Next();
             view.Add(next);