From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 28 二月 2020 15:25:13 +0800
Subject: [PATCH] 2020.2.28
---
ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs | 43 ++++++++++++++++++++++++++++++++-----------
1 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
index fc27ca5..78e5035 100644
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/ButtonLineForm.cs
@@ -12,7 +12,7 @@
/// <summary>
/// line
/// </summary>
- public Line Line;
+ public Button Line;
/// <summary>
/// isSelected
/// </summary>
@@ -46,14 +46,12 @@
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
- /// <param name="width"></param>
- /// <param name="height"></param>
- public ButtonLineForm(int x, int y, int width, int height)
+ public ButtonLineForm(int x, int y)
{
X = Application.GetRealWidth(x);
Y = Application.GetRealHeight(y);
- Width = Application.GetRealWidth(width);
- Height = Application.GetRealHeight(height);
+ Width = Application.GetRealWidth(100);
+ Height = Application.GetRealHeight(85);
}
/// <summary>
@@ -64,14 +62,24 @@
NameBtn = new Button()
{
Width = Width,
- Height = Height - 3,
+ Height = Height - Application.GetRealHeight(6),
TextColor = ZigbeeColor.Current.GXCTextGrayColor4,
- SelectedTextColor = ZigbeeColor.Current.GXCTextDeepBlackColor,
- TextSize = CommonFormResouce.TextSize
+ SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextSize = CommonFormResouce.TextSize,
+ TextAlignment = TextAlignment.CenterLeft
};
AddChidren(NameBtn);
- Line = new Line(Height, Width / 2, 2);
+ Line = new Button
+ {
+ X = 0,
+ Y = Height - Application.GetRealHeight(6),
+ Width = 10,
+ Height = Application.GetRealHeight(6),
+ Radius = (uint)Application.GetRealHeight(6 / 2),
+ BackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
+ Visible = false
+ };
AddChidren(Line);
}
@@ -82,6 +90,18 @@
public void SetTitle(string title)
{
NameBtn.Text = title;
+ RefreshWidth();
+ }
+
+ /// <summary>
+ /// RefreshWidth
+ /// </summary>
+ public void RefreshWidth()
+ {
+ NameBtn.Width = NameBtn.GetTextWidth() + Application.GetRealWidth(100);
+ Width = NameBtn.Width;
+ Line.X = NameBtn.GetTextWidth() / 4;
+ Line.Width= NameBtn.GetTextWidth() / 2;
}
/// <summary>
@@ -99,9 +119,10 @@
/// <param name="statu"></param>
public void SetStatu(bool statu)
{
- NameBtn.IsSelected = Line.IsSelected = statu;
+ NameBtn.IsSelected = Line.Visible = statu;
NameBtn.TextSize = statu ? CommonFormResouce.TextSize_Selected : CommonFormResouce.TextSize;
NameBtn.IsBold = statu;
+ RefreshWidth();
}
}
}
--
Gitblit v1.8.0