🦄 Beautiful AntdUI

This commit is contained in:
Tom
2025-06-14 16:05:22 +08:00
parent 2cf480b3ef
commit b2814127a2
8 changed files with 161 additions and 26 deletions

View File

@@ -1,5 +1,27 @@
[Home](Home.md)・[UpdateLog](UpdateLog.md)・[Config](Config.md)・[Theme](Theme.md)
### `2.0.4` 2025-06-14
- Tree BeforeExpand、AfterExpand
- Preview SelectIndex
- Preview OnSelectIndexChanged
- Message/Notification contains
- DatePickerRange Picker
- Menu SelectChanging
- Pagination DropDownRadius
- BaseForm Color Mode Change Configuration
- Table EditInputStyle
- Input TextTotalLine
- Calendar SetMinMax/SetBadge method
- ✍️ Table Column Drag+Hide Exception
- ✍️ Table Keyboard Up and Down Activation Summary
- ✍️ Table line break text disappears
- ✍️ Merge cell borders in Table
- ✍️ Input text is crowded
- ✍️ Refactoring cursor interaction with Input
- ✍️ Dropdown DropDownTextAlign is invalid
- ✍️ Modal centering parent form adjustment
### `2.0.3` 2025-06-09
- Table SortOrderSize

View File

@@ -1,5 +1,27 @@
[首页](Home.md)・[更新日志](UpdateLog.md)・[配置](Config.md)・[主题](Theme.md)
### `2.0.4` 2025-06-14
- Tree BeforeExpand、AfterExpand
- Preview SelectIndex
- Preview OnSelectIndexChanged
- Message/Notification contains
- DatePickerRange Picker
- Menu SelectChanging
- Pagination DropDownRadius
- BaseForm 色彩模式变化配置
- Table EditInputStyle
- Input TextTotalLine
- Calendar SetMinMax/SetBadge 方法
- ✍️ Table 列拖动+隐藏 异常
- ✍️ Table 键盘上下激活 Summary
- ✍️ Table 换行文字消失
- ✍️ Table 合并单元格边框
- ✍️ Input 文字拥挤
- ✍️ Input 重构光标交互
- ✍️ Dropdown DropDownTextAlign 无效
- ✍️ Modal 居中父窗体调整
### `2.0.3` 2025-06-09
- Table SortOrderSize

View File

@@ -48,6 +48,7 @@ namespace Demo.Controls
header1 = new AntdUI.PageHeader();
tree1 = new AntdUI.Tree();
tree2 = new AntdUI.Tree();
tree3 = new AntdUI.Tree();
SuspendLayout();
//
// header1
@@ -69,24 +70,32 @@ namespace Demo.Controls
//
tree1.Checkable = true;
tree1.Dock = DockStyle.Left;
tree1.Font = new Font("Microsoft YaHei UI", 12F);
tree1.Location = new Point(0, 74);
tree1.Name = "tree1";
tree1.Size = new Size(328, 328);
tree1.TabIndex = 18;
tree1.TabIndex = 0;
//
// tree2
//
tree2.BlockNode = true;
tree2.Dock = DockStyle.Fill;
tree2.Font = new Font("Microsoft YaHei UI", 12F);
tree2.Dock = DockStyle.Left;
tree2.Location = new Point(328, 74);
tree2.Name = "tree2";
tree2.Size = new Size(412, 328);
tree2.TabIndex = 19;
tree2.Size = new Size(328, 328);
tree2.TabIndex = 1;
//
// tree3
//
tree3.Dock = DockStyle.Fill;
tree3.Location = new Point(656, 74);
tree3.Name = "tree3";
tree3.Size = new Size(84, 328);
tree3.TabIndex = 2;
tree3.BeforeExpand += tree3_BeforeExpand;
//
// Tree
//
Controls.Add(tree3);
Controls.Add(tree2);
Controls.Add(tree1);
Controls.Add(header1);
@@ -101,5 +110,6 @@ namespace Demo.Controls
private AntdUI.PageHeader header1;
private AntdUI.Tree tree1;
private AntdUI.Tree tree2;
private AntdUI.Tree tree3;
}
}

View File

@@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
namespace Demo.Controls
@@ -34,7 +35,7 @@ namespace Demo.Controls
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
tree1.PauseLayout = tree2.PauseLayout = true;
tree1.PauseLayout = tree2.PauseLayout = tree3.PauseLayout = true;
AntdUI.ITask.Run(() =>
{
var random = new Random();
@@ -50,9 +51,28 @@ namespace Demo.Controls
AddSub(it, 1, random);
tree2.Items.Add(it);
}
var basepath = new DirectoryInfo(Environment.CurrentDirectory.Substring(0, 3));
foreach (var item in basepath.GetDirectories())
{
var it = new AntdUI.TreeItem(item.Name)
{
IconSvg = Properties.Resources.icon_folder,
CanExpand = true,
Name = item.FullName
};
tree3.Items.Add(it);
}
foreach (var item in basepath.GetFiles())
{
var it = new AntdUI.TreeItem(item.Name)
{
Name = item.FullName
};
tree3.Items.Add(it);
}
}).ContinueWith(action =>
{
tree1.PauseLayout = tree2.PauseLayout = false;
tree1.PauseLayout = tree2.PauseLayout = tree3.PauseLayout = false;
});
}
@@ -76,5 +96,57 @@ namespace Demo.Controls
it.Sub.AddRange(list);
}
}
private void tree3_BeforeExpand(object sender, AntdUI.TreeExpandEventArgs e)
{
if (e.Value)
{
if (e.Item.Tag is bool)
{
e.Item.IconSvg = Properties.Resources.icon_folderopened;
return;
}
e.CanExpand = false;
tree3.PauseLayout = true;
AntdUI.ITask.Run(() =>
{
e.Item.Tag = true;
int count = 0;
try
{
var basepath = new DirectoryInfo(e.Item.Name);
foreach (var item in basepath.GetDirectories())
{
var it = new AntdUI.TreeItem(item.Name)
{
IconSvg = Properties.Resources.icon_folder,
CanExpand = true,
Name = item.FullName
};
e.Item.Sub.Add(it);
count++;
}
foreach (var item in basepath.GetFiles())
{
var it = new AntdUI.TreeItem(item.Name)
{
Name = item.FullName
};
e.Item.Sub.Add(it);
count++;
}
}
catch { }
if (count == 0) e.Item.CanExpand = false;
else
{
e.Item.IconSvg = Properties.Resources.icon_folderopened;
e.Item.Expand = true;
}
}).ContinueWith(action => tree3.PauseLayout = false);
}
else e.Item.IconSvg = Properties.Resources.icon_folder;
}
}
}

View File

@@ -148,6 +148,24 @@ namespace Demo.Properties {
}
}
/// <summary>
/// 查找类似 &lt;svg viewBox=&quot;0 0 48 48&quot;&gt;&lt;path fill=&quot;#FFA000&quot; d=&quot;M40 12H22l-4-4H8c-2.2 0-4 1.8-4 4v8h40v-4c0-2.2-1.8-4-4-4&quot;/&gt;&lt;path fill=&quot;#FFCA28&quot; d=&quot;M40 12H8c-2.2 0-4 1.8-4 4v20c0 2.2 1.8 4 4 4h32c2.2 0 4-1.8 4-4V16c0-2.2-1.8-4-4-4&quot;/&gt;&lt;/svg&gt; 的本地化字符串。
/// </summary>
internal static string icon_folder {
get {
return ResourceManager.GetString("icon_folder", resourceCulture);
}
}
/// <summary>
/// 查找类似 &lt;svg viewBox=&quot;0 0 48 48&quot;&gt;&lt;path fill=&quot;#FFA000&quot; d=&quot;M38 12H22l-4-4H8c-2.2 0-4 1.8-4 4v24c0 2.2 1.8 4 4 4h31c1.7 0 3-1.3 3-3V16c0-2.2-1.8-4-4-4&quot;/&gt;&lt;path fill=&quot;#FFCA28&quot; d=&quot;M42.2 18H15.3c-1.9 0-3.6 1.4-3.9 3.3L8 40h31.7c1.9 0 3.6-1.4 3.9-3.3l2.5-14c.5-2.4-1.4-4.7-3.9-4.7&quot;/&gt;&lt;/svg&gt; 的本地化字符串。
/// </summary>
internal static string icon_folderopened {
get {
return ResourceManager.GetString("icon_folderopened", resourceCulture);
}
}
/// <summary>
/// 查找类似 &lt;svg viewBox=&quot;0 0 1024 1024&quot;&gt;&lt;path d=&quot;M923 283.6c-13.4-31.1-32.6-58.9-56.9-82.8-24.3-23.8-52.5-42.4-84-55.5-32.5-13.5-66.9-20.3-102.4-20.3-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5-24.4 23.9-43.5 51.7-56.9 82.8-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15 [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>

View File

@@ -145,6 +145,12 @@
<data name="icon_empty_dark" xml:space="preserve">
<value>&lt;svg viewBox="0 0 64 41"&gt;&lt;g transform="translate(0 1)" fill="none"&gt;&lt;ellipse fill="#272727" cx="32" cy="33" rx="32" ry="7"&gt;&lt;/ellipse&gt;&lt;g stroke="#3e3e3e"&gt;&lt;path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"&gt;&lt;/path&gt;&lt;path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#1d1d1d"&gt;&lt;/path&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;</value>
</data>
<data name="icon_folder" xml:space="preserve">
<value>&lt;svg viewBox="0 0 48 48"&gt;&lt;path fill="#FFA000" d="M40 12H22l-4-4H8c-2.2 0-4 1.8-4 4v8h40v-4c0-2.2-1.8-4-4-4"/&gt;&lt;path fill="#FFCA28" d="M40 12H8c-2.2 0-4 1.8-4 4v20c0 2.2 1.8 4 4 4h32c2.2 0 4-1.8 4-4V16c0-2.2-1.8-4-4-4"/&gt;&lt;/svg&gt;</value>
</data>
<data name="icon_folderopened" xml:space="preserve">
<value>&lt;svg viewBox="0 0 48 48"&gt;&lt;path fill="#FFA000" d="M38 12H22l-4-4H8c-2.2 0-4 1.8-4 4v24c0 2.2 1.8 4 4 4h31c1.7 0 3-1.3 3-3V16c0-2.2-1.8-4-4-4"/&gt;&lt;path fill="#FFCA28" d="M42.2 18H15.3c-1.9 0-3.6 1.4-3.9 3.3L8 40h31.7c1.9 0 3.6-1.4 3.9-3.3l2.5-14c.5-2.4-1.4-4.7-3.9-4.7"/&gt;&lt;/svg&gt;</value>
</data>
<data name="icon_like" xml:space="preserve">
<value>&lt;svg viewBox="0 0 1024 1024"&gt;&lt;path d="M923 283.6c-13.4-31.1-32.6-58.9-56.9-82.8-24.3-23.8-52.5-42.4-84-55.5-32.5-13.5-66.9-20.3-102.4-20.3-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5-24.4 23.9-43.5 51.7-56.9 82.8-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3 0.1-35.3-7-69.6-20.9-101.9z"&gt;&lt;/path&gt;&lt;/svg&gt;</value>
</data>

View File

@@ -1,8 +0,0 @@
{
"profiles": {
"Demo": {
"commandName": "Project",
"commandLineArgs": "tab"
}
}
}

View File

@@ -18,14 +18,7 @@
using AntdUI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Demo
{
@@ -35,14 +28,14 @@ namespace Demo
{
InitializeComponent();
var homeImage = SvgExtend.GetImgExtend("HomeOutlined", new Rectangle(0, 0, 16, 16));
this.tabHeader1.AddTab("首页", homeImage);
this.tabHeader1.AddTab("关于");
tabHeader1.AddTab("首页", homeImage);
tabHeader1.AddTab("关于");
}
private void button1_Click(object sender, EventArgs e)
{
var timeImage = SvgExtend.GetImgExtend("FieldTimeOutlined", new Rectangle(0, 0, 16, 16));
this.tabHeader1.AddTab(DateTime.Now.ToString(), timeImage);
tabHeader1.AddTab(DateTime.Now.ToString(), timeImage);
}
}
}