mirror of
https://github.com/waynebian01/Shigure.git
synced 2026-09-03 07:15:24 +08:00
调整了UI界面
This commit is contained in:
@@ -385,13 +385,13 @@ public sealed class MainForm : Form, IMessageFilter
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 2,
|
||||
RowCount = 2,
|
||||
Padding = new Padding(12, 12, 12, 6),
|
||||
Margin = new Padding(0, 0, 0, 10)
|
||||
Padding = new Padding(16, 16, 16, 10),
|
||||
Margin = new Padding(0, 0, 0, 14)
|
||||
};
|
||||
settingsGrid.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 96));
|
||||
settingsGrid.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
|
||||
settingsGrid.RowStyles.Add(new RowStyle(SizeType.Absolute, 48));
|
||||
settingsGrid.RowStyles.Add(new RowStyle(SizeType.Absolute, 48));
|
||||
settingsGrid.RowStyles.Add(new RowStyle(SizeType.Absolute, 54));
|
||||
settingsGrid.RowStyles.Add(new RowStyle(SizeType.Absolute, 54));
|
||||
|
||||
Label CreateSettingLabel(string text) => new()
|
||||
{
|
||||
@@ -399,7 +399,7 @@ public sealed class MainForm : Form, IMessageFilter
|
||||
Dock = DockStyle.Fill,
|
||||
TextAlign = ContentAlignment.MiddleLeft,
|
||||
ForeColor = UiTheme.Muted,
|
||||
Margin = new Padding(0, 0, 10, 12)
|
||||
Margin = new Padding(0, 0, 12, 14)
|
||||
};
|
||||
|
||||
const int settingControlWidth = 190;
|
||||
@@ -433,12 +433,12 @@ public sealed class MainForm : Form, IMessageFilter
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 2,
|
||||
RowCount = 2,
|
||||
Padding = new Padding(12, 12, 12, 10),
|
||||
Padding = new Padding(16, 16, 16, 14),
|
||||
Margin = new Padding(0)
|
||||
};
|
||||
moduleInfo.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 96));
|
||||
moduleInfo.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
|
||||
moduleInfo.RowStyles.Add(new RowStyle(SizeType.Absolute, 48));
|
||||
moduleInfo.RowStyles.Add(new RowStyle(SizeType.Absolute, 54));
|
||||
moduleInfo.RowStyles.Add(new RowStyle(SizeType.AutoSize));
|
||||
|
||||
_moduleComboBox = new ComboBox();
|
||||
|
||||
@@ -114,12 +114,12 @@ public sealed class ModuleEditorControl : UserControl
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
BackColor = UiTheme.Background,
|
||||
Padding = new Padding(0, 0, 10, 0),
|
||||
Padding = new Padding(0, 0, 14, 0),
|
||||
ColumnCount = 1,
|
||||
RowCount = 2
|
||||
};
|
||||
sidebar.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
|
||||
sidebar.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
|
||||
sidebar.RowStyles.Add(new RowStyle(SizeType.Absolute, 42));
|
||||
|
||||
_moduleList.Dock = DockStyle.Fill;
|
||||
UiTheme.StyleListBox(_moduleList, Font);
|
||||
@@ -138,12 +138,12 @@ public sealed class ModuleEditorControl : UserControl
|
||||
|
||||
var addButton = UiTheme.CreateButton("新建", UiTheme.Field, UiTheme.Text);
|
||||
addButton.Width = 72;
|
||||
addButton.Height = 30;
|
||||
addButton.Height = 34;
|
||||
addButton.Click += (_, _) => AddModule();
|
||||
|
||||
var reloadButton = UiTheme.CreateButton("刷新", UiTheme.Field, UiTheme.Text);
|
||||
reloadButton.Width = 72;
|
||||
reloadButton.Height = 30;
|
||||
reloadButton.Height = 34;
|
||||
reloadButton.Click += (_, _) => LoadModules();
|
||||
|
||||
buttons.Controls.Add(addButton);
|
||||
@@ -159,14 +159,14 @@ public sealed class ModuleEditorControl : UserControl
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
BackColor = UiTheme.Surface,
|
||||
Padding = new Padding(8, 0, 0, 4),
|
||||
Padding = new Padding(10, 0, 0, 6),
|
||||
ColumnCount = 1,
|
||||
RowCount = 4
|
||||
};
|
||||
editor.RowStyles.Add(new RowStyle(SizeType.Absolute, 74));
|
||||
editor.RowStyles.Add(new RowStyle(SizeType.Absolute, 74));
|
||||
editor.RowStyles.Add(new RowStyle(SizeType.Absolute, 82));
|
||||
editor.RowStyles.Add(new RowStyle(SizeType.Absolute, 82));
|
||||
editor.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
|
||||
editor.RowStyles.Add(new RowStyle(SizeType.Absolute, 48));
|
||||
editor.RowStyles.Add(new RowStyle(SizeType.Absolute, 54));
|
||||
|
||||
editor.Controls.Add(BuildNameRow(), 0, 0);
|
||||
editor.Controls.Add(BuildMatchRow(), 0, 1);
|
||||
@@ -180,13 +180,13 @@ public sealed class ModuleEditorControl : UserControl
|
||||
var root = new TableLayoutPanel
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
Margin = new Padding(0, 8, 0, 6),
|
||||
Margin = new Padding(0, 12, 0, 8),
|
||||
Padding = new Padding(0),
|
||||
BackColor = UiTheme.Surface,
|
||||
ColumnCount = 1,
|
||||
RowCount = 2
|
||||
};
|
||||
root.RowStyles.Add(new RowStyle(SizeType.Absolute, 34));
|
||||
root.RowStyles.Add(new RowStyle(SizeType.Absolute, 38));
|
||||
root.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
|
||||
|
||||
var tabBar = new TableLayoutPanel
|
||||
@@ -319,13 +319,13 @@ public sealed class ModuleEditorControl : UserControl
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 1,
|
||||
RowCount = 4,
|
||||
Padding = new Padding(10),
|
||||
Padding = new Padding(14),
|
||||
Margin = new Padding(0)
|
||||
};
|
||||
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.Absolute, 24));
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.Percent, 50));
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30));
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.Percent, 50));
|
||||
|
||||
panel.Controls.Add(CreateSectionLabel("条件动态数值"), 0, 0);
|
||||
@@ -344,7 +344,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 1,
|
||||
RowCount = 1,
|
||||
Padding = new Padding(10),
|
||||
Padding = new Padding(14),
|
||||
Margin = new Padding(0)
|
||||
};
|
||||
|
||||
@@ -361,7 +361,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 2,
|
||||
RowCount = 1,
|
||||
Padding = new Padding(10),
|
||||
Padding = new Padding(14),
|
||||
Margin = new Padding(0)
|
||||
};
|
||||
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
|
||||
@@ -407,7 +407,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
FlowDirection = FlowDirection.TopDown,
|
||||
WrapContents = false,
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
Margin = new Padding(6, 0, 0, 0),
|
||||
Margin = new Padding(8, 0, 0, 0),
|
||||
Padding = new Padding(0)
|
||||
};
|
||||
buttons.Resize += (_, _) => LayoutUnitActionButtons(buttons);
|
||||
@@ -437,16 +437,16 @@ public sealed class ModuleEditorControl : UserControl
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 4,
|
||||
RowCount = 2,
|
||||
Padding = new Padding(10, 8, 10, 2),
|
||||
Margin = new Padding(0, 0, 0, 8)
|
||||
Padding = new Padding(12, 10, 12, 4),
|
||||
Margin = new Padding(0, 0, 0, 10)
|
||||
};
|
||||
// 名称/作者各占剩余宽度的一半, 两个输入框等宽并铺满窗口。
|
||||
row.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 58));
|
||||
row.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
|
||||
row.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 58));
|
||||
row.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
|
||||
row.RowStyles.Add(new RowStyle(SizeType.Absolute, 30));
|
||||
row.RowStyles.Add(new RowStyle(SizeType.Absolute, 24));
|
||||
row.RowStyles.Add(new RowStyle(SizeType.Absolute, 32));
|
||||
row.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
|
||||
|
||||
row.Controls.Add(CreateLabel("名称"), 0, 0);
|
||||
UiTheme.StyleTextBox(_nameBox);
|
||||
@@ -487,7 +487,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 8,
|
||||
RowCount = 2,
|
||||
Padding = new Padding(10, 8, 10, 8),
|
||||
Padding = new Padding(12, 10, 12, 10),
|
||||
Margin = new Padding(0)
|
||||
};
|
||||
foreach (var label in matchLabels)
|
||||
@@ -531,7 +531,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
{
|
||||
Name = "Enabled",
|
||||
HeaderText = "启用",
|
||||
Width = 100,
|
||||
Width = 68,
|
||||
AutoSizeMode = DataGridViewAutoSizeColumnMode.None
|
||||
});
|
||||
|
||||
@@ -602,7 +602,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
{
|
||||
Name = "Enabled",
|
||||
HeaderText = "启用",
|
||||
Width = 86,
|
||||
Width = 68,
|
||||
AutoSizeMode = DataGridViewAutoSizeColumnMode.None
|
||||
});
|
||||
|
||||
@@ -653,7 +653,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
{
|
||||
Name = "Enabled",
|
||||
HeaderText = "启用",
|
||||
Width = 120,
|
||||
Width = 68,
|
||||
AutoSizeMode = DataGridViewAutoSizeColumnMode.None
|
||||
});
|
||||
_spellColumn.Name = "Spell";
|
||||
@@ -2297,7 +2297,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
Dock = DockStyle.Fill,
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
Margin = new Padding(0),
|
||||
Padding = new Padding(10, 0, 10, 0)
|
||||
Padding = new Padding(12, 0, 12, 0)
|
||||
};
|
||||
|
||||
var hint = new Label
|
||||
@@ -2319,7 +2319,7 @@ public sealed class ModuleEditorControl : UserControl
|
||||
WrapContents = false,
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
Margin = new Padding(0),
|
||||
Padding = new Padding(0, 6, 0, 6)
|
||||
Padding = new Padding(0, 8, 0, 8)
|
||||
};
|
||||
|
||||
_saveButton = UiTheme.CreateButton("保存", UiTheme.Accent, Color.Black);
|
||||
@@ -2743,8 +2743,8 @@ public sealed class ModuleEditorControl : UserControl
|
||||
var button = UiTheme.CreateButton(text, backColor, foreColor);
|
||||
button.AutoSize = false;
|
||||
button.AutoEllipsis = true;
|
||||
button.Height = 32;
|
||||
button.Margin = new Padding(0, 0, 0, bottomGap ? 6 : 0);
|
||||
button.Height = 36;
|
||||
button.Margin = new Padding(0, 0, 0, bottomGap ? 8 : 0);
|
||||
button.Padding = new Padding(0);
|
||||
button.TextAlign = ContentAlignment.MiddleCenter;
|
||||
return button;
|
||||
|
||||
@@ -61,11 +61,11 @@ public sealed class StatusForm : Form
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
BackColor = UiTheme.Background,
|
||||
Padding = new Padding(14),
|
||||
Padding = new Padding(18),
|
||||
RowCount = 2,
|
||||
ColumnCount = 1
|
||||
};
|
||||
root.RowStyles.Add(new RowStyle(SizeType.Absolute, 40));
|
||||
root.RowStyles.Add(new RowStyle(SizeType.Absolute, 46));
|
||||
root.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
|
||||
Controls.Add(root);
|
||||
|
||||
@@ -98,14 +98,14 @@ public sealed class StatusForm : Form
|
||||
FlowDirection = FlowDirection.LeftToRight,
|
||||
WrapContents = false,
|
||||
BackColor = UiTheme.Background,
|
||||
Margin = new Padding(0, 0, 0, 8)
|
||||
Margin = new Padding(0, 0, 0, 12)
|
||||
};
|
||||
|
||||
_contentHost = new Panel
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
BackColor = UiTheme.Surface,
|
||||
Padding = new Padding(12),
|
||||
Padding = new Padding(16),
|
||||
Margin = new Padding(0)
|
||||
};
|
||||
|
||||
@@ -166,11 +166,11 @@ public sealed class StatusForm : Form
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 1,
|
||||
RowCount = 3,
|
||||
Padding = new Padding(10),
|
||||
Margin = new Padding(0, 0, isLast ? 0 : 8, 0)
|
||||
Padding = new Padding(14),
|
||||
Margin = new Padding(0, 0, isLast ? 0 : 12, 0)
|
||||
};
|
||||
section.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
|
||||
section.RowStyles.Add(new RowStyle(SizeType.Absolute, 24));
|
||||
section.RowStyles.Add(new RowStyle(SizeType.Absolute, 22));
|
||||
section.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
|
||||
|
||||
section.Controls.Add(new Label
|
||||
@@ -194,7 +194,7 @@ public sealed class StatusForm : Form
|
||||
}, 0, 1);
|
||||
|
||||
content.Dock = DockStyle.Fill;
|
||||
content.Margin = new Padding(0, 8, 0, 0);
|
||||
content.Margin = new Padding(0, 12, 0, 0);
|
||||
section.Controls.Add(content, 0, 2);
|
||||
return section;
|
||||
}
|
||||
@@ -256,12 +256,12 @@ public sealed class StatusForm : Form
|
||||
{
|
||||
Text = text,
|
||||
AutoSize = false,
|
||||
Size = new Size(88, 32),
|
||||
Size = new Size(96, 38),
|
||||
TextAlign = ContentAlignment.MiddleCenter,
|
||||
FlatStyle = FlatStyle.Flat,
|
||||
BackColor = UiTheme.Background,
|
||||
ForeColor = UiTheme.Muted,
|
||||
Margin = new Padding(0, 0, 7, 0),
|
||||
Margin = new Padding(0, 0, 9, 0),
|
||||
Padding = new Padding(0),
|
||||
Cursor = Cursors.Hand,
|
||||
TabStop = false
|
||||
@@ -301,7 +301,7 @@ public sealed class StatusForm : Form
|
||||
BackColor = UiTheme.SurfaceRaised,
|
||||
ColumnCount = 1,
|
||||
RowCount = 2,
|
||||
Padding = new Padding(12)
|
||||
Padding = new Padding(18)
|
||||
};
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
|
||||
panel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
|
||||
@@ -312,7 +312,7 @@ public sealed class StatusForm : Form
|
||||
AutoSize = true,
|
||||
ForeColor = UiTheme.Text,
|
||||
Font = new Font(Font.FontFamily, 18F, FontStyle.Bold),
|
||||
Margin = new Padding(0, 0, 0, 18)
|
||||
Margin = new Padding(0, 0, 0, 22)
|
||||
};
|
||||
panel.Controls.Add(title, 0, 0);
|
||||
|
||||
@@ -374,11 +374,11 @@ public sealed class StatusForm : Form
|
||||
Text = name,
|
||||
AutoSize = false,
|
||||
Width = 104,
|
||||
Height = 22,
|
||||
Height = 26,
|
||||
ForeColor = UiTheme.Muted,
|
||||
AutoEllipsis = true,
|
||||
TextAlign = ContentAlignment.MiddleLeft,
|
||||
Margin = new Padding(0, 0, 16, 10)
|
||||
Margin = new Padding(0, 0, 18, 14)
|
||||
}, 0, row);
|
||||
panel.Controls.Add(new Label
|
||||
{
|
||||
@@ -386,7 +386,7 @@ public sealed class StatusForm : Form
|
||||
AutoSize = true,
|
||||
MaximumSize = new Size(580, 0),
|
||||
ForeColor = UiTheme.Text,
|
||||
Margin = new Padding(0, 0, 0, 10)
|
||||
Margin = new Padding(0, 0, 0, 14)
|
||||
}, 1, row);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ internal static class UiTheme
|
||||
listBox.BorderStyle = BorderStyle.FixedSingle;
|
||||
listBox.CheckOnClick = true;
|
||||
listBox.IntegralHeight = false;
|
||||
listBox.ItemHeight = 24;
|
||||
listBox.ItemHeight = 30;
|
||||
}
|
||||
|
||||
public static void StyleComboBox(ComboBox comboBox)
|
||||
@@ -271,7 +271,7 @@ internal static class UiTheme
|
||||
listBox.ForeColor = Text;
|
||||
listBox.BorderStyle = BorderStyle.None;
|
||||
listBox.DrawMode = DrawMode.OwnerDrawFixed;
|
||||
listBox.ItemHeight = 30;
|
||||
listBox.ItemHeight = 36;
|
||||
listBox.IntegralHeight = false;
|
||||
|
||||
listBox.DrawItem += (_, e) =>
|
||||
@@ -322,7 +322,7 @@ internal static class UiTheme
|
||||
listView.BorderStyle = BorderStyle.None;
|
||||
listView.OwnerDraw = true;
|
||||
listView.ShowItemToolTips = true;
|
||||
listView.SmallImageList = new ImageList { ImageSize = new Size(1, 26) };
|
||||
listView.SmallImageList = new ImageList { ImageSize = new Size(1, 32) };
|
||||
typeof(Control)
|
||||
.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic)
|
||||
?.SetValue(listView, true);
|
||||
@@ -390,20 +390,20 @@ internal static class UiTheme
|
||||
grid.EnableHeadersVisualStyles = false;
|
||||
grid.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
|
||||
grid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||
grid.ColumnHeadersHeight = 32;
|
||||
grid.ColumnHeadersHeight = 36;
|
||||
grid.ColumnHeadersDefaultCellStyle.BackColor = Field;
|
||||
grid.ColumnHeadersDefaultCellStyle.ForeColor = Muted;
|
||||
grid.ColumnHeadersDefaultCellStyle.SelectionBackColor = Field;
|
||||
grid.ColumnHeadersDefaultCellStyle.SelectionForeColor = Muted;
|
||||
grid.ColumnHeadersDefaultCellStyle.Padding = new Padding(6, 0, 6, 0);
|
||||
grid.ColumnHeadersDefaultCellStyle.Padding = new Padding(8, 0, 8, 0);
|
||||
grid.DefaultCellStyle.BackColor = Surface;
|
||||
grid.DefaultCellStyle.ForeColor = Text;
|
||||
grid.DefaultCellStyle.SelectionBackColor = Hover;
|
||||
grid.DefaultCellStyle.SelectionForeColor = Text;
|
||||
grid.DefaultCellStyle.Padding = new Padding(6, 0, 6, 0);
|
||||
grid.DefaultCellStyle.Padding = new Padding(8, 0, 8, 0);
|
||||
grid.AlternatingRowsDefaultCellStyle.BackColor = RowAlt;
|
||||
grid.AlternatingRowsDefaultCellStyle.ForeColor = Text;
|
||||
grid.RowTemplate.Height = 30;
|
||||
grid.RowTemplate.Height = 38;
|
||||
grid.RowHeadersVisible = false;
|
||||
grid.AllowUserToResizeRows = false;
|
||||
grid.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
|
||||
|
||||
Reference in New Issue
Block a user