Beispiel #1
0
 internal static string ToHex(this TColor c)
 {
     if (c.IsDefault)
     {
         TLog.Warn("Trying to convert the default color to hexagonal notation, it does not works as expected.");
     }
     return(string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", c.R, c.G, c.B, c.A));
 }
Beispiel #2
0
 public static Toolbar SetTVTabBarWithTitleStyle(this Toolbar toolbar)
 {
     if (!DeviceInfo.IsTV)
     {
         TLog.Error($"ToWatchPopupRightStyleButton is only supported on TV profile : {0}", DeviceInfo.GetDeviceType());
         return(toolbar);
     }
     toolbar.Style = ThemeConstants.Toolbar.Styles.TV.TabbarWithTitle;
     return(toolbar);
 }
Beispiel #3
0
 public static Popup SetWatchCircleStyle(this Popup popup)
 {
     if (!DeviceInfo.IsWatch)
     {
         TLog.Error($"ToWatchPopupRightStyleButton is only supported on wearable profile : {0}", DeviceInfo.GetDeviceType());
         return(popup);
     }
     popup.Style = ThemeConstants.Popup.Styles.Watch.Circle;
     return(popup);
 }
Beispiel #4
0
 public static Button SetWatchTextStyle(this Button button)
 {
     if (!DeviceInfo.IsWatch)
     {
         TLog.Error($"ToWatchPopupRightStyleButton is only supported on wearable profile : {0}", DeviceInfo.GetDeviceType());
         return(button);
     }
     button.Style = ThemeConstants.Button.Styles.Watch.Text;
     return(button);
 }
Beispiel #5
0
        public static ESize GetPlaceHolderTextBlockFormattedSize(this EEntry entry)
        {
            var textPart = entry.EdjeObject[ThemeConstants.Entry.Parts.PlaceHolderText];

            if (textPart == null)
            {
                TLog.Error("There is no elm.guide part");
                return(new ESize(0, 0));
            }
            return(textPart.TextBlockFormattedSize);
        }
Beispiel #6
0
        public static ESize GetTextBlockNativeSize(this EEntry entry)
        {
            var textPart = entry.EdjeObject[ThemeConstants.Common.Parts.Text];

            if (textPart == null)
            {
                TLog.Error("There is no elm.text part");
                return(new ESize(0, 0));
            }
            return(textPart.TextBlockNativeSize);
        }
Beispiel #7
0
        public static ESize GetTextBlockFormattedSize(this ELabel label)
        {
            var textPart = label.EdjeObject[ThemeConstants.Common.Parts.Text];

            if (textPart == null)
            {
                TLog.Error("There is no elm.text part");
                return(new ESize(0, 0));
            }
            return(textPart.TextBlockFormattedSize);
        }