+ UIStyle:增加多彩主题,以颜色深色,文字白色为主。

This commit is contained in:
Sunny 2021-07-17 22:11:27 +08:00
parent 6b2ea41f85
commit d88d7e433f
10 changed files with 417 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

262
SunnyUI.Demo/FColorful.Designer.cs generated Normal file
View File

@ -0,0 +1,262 @@

namespace Sunny.UI.Demo
{
partial class FColorful
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.uiPanel1 = new Sunny.UI.UIPanel();
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiPanel3 = new Sunny.UI.UIPanel();
this.uiPanel4 = new Sunny.UI.UIPanel();
this.uiPanel5 = new Sunny.UI.UIPanel();
this.uiPanel6 = new Sunny.UI.UIPanel();
this.uiPanel7 = new Sunny.UI.UIPanel();
this.uiPanel8 = new Sunny.UI.UIPanel();
this.uiPanel9 = new Sunny.UI.UIPanel();
this.uiPanel10 = new Sunny.UI.UIPanel();
this.SuspendLayout();
//
// uiPanel1
//
this.uiPanel1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172)))));
this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel1.ForeColor = System.Drawing.Color.White;
this.uiPanel1.Location = new System.Drawing.Point(23, 56);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172)))));
this.uiPanel1.Size = new System.Drawing.Size(120, 100);
this.uiPanel1.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel1.StyleCustomMode = true;
this.uiPanel1.TabIndex = 0;
this.uiPanel1.Text = "蓝绿色";
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel1.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel2
//
this.uiPanel2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(152)))), ((int)(((byte)(0)))));
this.uiPanel2.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel2.ForeColor = System.Drawing.Color.White;
this.uiPanel2.Location = new System.Drawing.Point(173, 56);
this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel2.Name = "uiPanel2";
this.uiPanel2.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(152)))), ((int)(((byte)(0)))));
this.uiPanel2.Size = new System.Drawing.Size(120, 100);
this.uiPanel2.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel2.StyleCustomMode = true;
this.uiPanel2.TabIndex = 1;
this.uiPanel2.Text = "橙色";
this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel2.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel3
//
this.uiPanel3.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(190)))), ((int)(((byte)(60)))));
this.uiPanel3.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel3.ForeColor = System.Drawing.Color.White;
this.uiPanel3.Location = new System.Drawing.Point(473, 56);
this.uiPanel3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel3.Name = "uiPanel3";
this.uiPanel3.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(190)))), ((int)(((byte)(60)))));
this.uiPanel3.Size = new System.Drawing.Size(120, 100);
this.uiPanel3.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel3.StyleCustomMode = true;
this.uiPanel3.TabIndex = 3;
this.uiPanel3.Text = "绿色";
this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel3.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel4
//
this.uiPanel4.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(100)))), ((int)(((byte)(80)))));
this.uiPanel4.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel4.ForeColor = System.Drawing.Color.White;
this.uiPanel4.Location = new System.Drawing.Point(323, 56);
this.uiPanel4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel4.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel4.Name = "uiPanel4";
this.uiPanel4.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(100)))), ((int)(((byte)(80)))));
this.uiPanel4.Size = new System.Drawing.Size(120, 100);
this.uiPanel4.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel4.StyleCustomMode = true;
this.uiPanel4.TabIndex = 2;
this.uiPanel4.Text = "咖啡色";
this.uiPanel4.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel4.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel5
//
this.uiPanel5.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(98)))), ((int)(((byte)(161)))));
this.uiPanel5.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel5.ForeColor = System.Drawing.Color.White;
this.uiPanel5.Location = new System.Drawing.Point(623, 56);
this.uiPanel5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel5.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel5.Name = "uiPanel5";
this.uiPanel5.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(98)))), ((int)(((byte)(161)))));
this.uiPanel5.Size = new System.Drawing.Size(120, 100);
this.uiPanel5.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel5.StyleCustomMode = true;
this.uiPanel5.TabIndex = 4;
this.uiPanel5.Text = "粉色";
this.uiPanel5.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel5.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel6
//
this.uiPanel6.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(94)))), ((int)(((byte)(99)))));
this.uiPanel6.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel6.ForeColor = System.Drawing.Color.White;
this.uiPanel6.Location = new System.Drawing.Point(473, 174);
this.uiPanel6.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel6.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel6.Name = "uiPanel6";
this.uiPanel6.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(94)))), ((int)(((byte)(99)))));
this.uiPanel6.Size = new System.Drawing.Size(120, 100);
this.uiPanel6.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel6.StyleCustomMode = true;
this.uiPanel6.TabIndex = 8;
this.uiPanel6.Text = "红色";
this.uiPanel6.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel6.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel7
//
this.uiPanel7.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(126)))), ((int)(((byte)(164)))));
this.uiPanel7.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel7.ForeColor = System.Drawing.Color.White;
this.uiPanel7.Location = new System.Drawing.Point(323, 174);
this.uiPanel7.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel7.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel7.Name = "uiPanel7";
this.uiPanel7.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(126)))), ((int)(((byte)(164)))));
this.uiPanel7.Size = new System.Drawing.Size(120, 100);
this.uiPanel7.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel7.StyleCustomMode = true;
this.uiPanel7.TabIndex = 7;
this.uiPanel7.Text = "蓝灰色";
this.uiPanel7.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel7.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel8
//
this.uiPanel8.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(188)))), ((int)(((byte)(212)))));
this.uiPanel8.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel8.ForeColor = System.Drawing.Color.White;
this.uiPanel8.Location = new System.Drawing.Point(173, 174);
this.uiPanel8.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel8.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel8.Name = "uiPanel8";
this.uiPanel8.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(188)))), ((int)(((byte)(212)))));
this.uiPanel8.Size = new System.Drawing.Size(120, 100);
this.uiPanel8.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel8.StyleCustomMode = true;
this.uiPanel8.TabIndex = 6;
this.uiPanel8.Text = "蓝色";
this.uiPanel8.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel8.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel9
//
this.uiPanel9.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(58)))), ((int)(((byte)(183)))));
this.uiPanel9.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel9.ForeColor = System.Drawing.Color.White;
this.uiPanel9.Location = new System.Drawing.Point(23, 174);
this.uiPanel9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel9.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel9.Name = "uiPanel9";
this.uiPanel9.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(58)))), ((int)(((byte)(183)))));
this.uiPanel9.Size = new System.Drawing.Size(120, 100);
this.uiPanel9.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel9.StyleCustomMode = true;
this.uiPanel9.TabIndex = 5;
this.uiPanel9.Text = "紫色";
this.uiPanel9.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel9.Click += new System.EventHandler(this.uiPanel1_Click);
//
// uiPanel10
//
this.uiPanel10.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(150)))), ((int)(((byte)(136)))));
this.uiPanel10.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel10.ForeColor = System.Drawing.Color.White;
this.uiPanel10.Location = new System.Drawing.Point(623, 174);
this.uiPanel10.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel10.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel10.Name = "uiPanel10";
this.uiPanel10.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(150)))), ((int)(((byte)(136)))));
this.uiPanel10.Size = new System.Drawing.Size(120, 100);
this.uiPanel10.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel10.StyleCustomMode = true;
this.uiPanel10.TabIndex = 9;
this.uiPanel10.Text = "墨绿色";
this.uiPanel10.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel10.Click += new System.EventHandler(this.uiPanel1_Click);
//
// FColorful
//
this.AllowShowTitle = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(776, 543);
this.Controls.Add(this.uiPanel10);
this.Controls.Add(this.uiPanel6);
this.Controls.Add(this.uiPanel7);
this.Controls.Add(this.uiPanel8);
this.Controls.Add(this.uiPanel9);
this.Controls.Add(this.uiPanel5);
this.Controls.Add(this.uiPanel3);
this.Controls.Add(this.uiPanel4);
this.Controls.Add(this.uiPanel2);
this.Controls.Add(this.uiPanel1);
this.Name = "FColorful";
this.Padding = new System.Windows.Forms.Padding(0, 35, 0, 0);
this.PageIndex = 999;
this.ShowTitle = true;
this.Text = "多彩主题";
this.ResumeLayout(false);
}
#endregion
private UIPanel uiPanel1;
private UIPanel uiPanel2;
private UIPanel uiPanel3;
private UIPanel uiPanel4;
private UIPanel uiPanel5;
private UIPanel uiPanel6;
private UIPanel uiPanel7;
private UIPanel uiPanel8;
private UIPanel uiPanel9;
private UIPanel uiPanel10;
}
}

18
SunnyUI.Demo/FColorful.cs Normal file
View File

@ -0,0 +1,18 @@
using System.Drawing;
namespace Sunny.UI.Demo
{
public partial class FColorful : UIPage
{
public FColorful()
{
InitializeComponent();
}
private void uiPanel1_Click(object sender, System.EventArgs e)
{
var panel = (UIPanel)sender;
UIStyles.InitColorful(panel.FillColor, Color.White);
}
}
}

120
SunnyUI.Demo/FColorful.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -60,6 +60,8 @@ namespace Sunny.UI.Demo
Aside.CreateChildNode(parent, AddPage(new FBarChartEx()));
Aside.CreateChildNode(parent, AddPage(new FLineChart()));
AddPage(new FColorful());
Header.SetNodeSymbol(Header.Nodes[3], 61502);
var styles = UIStyles.PopularStyles();
foreach (UIStyle style in styles)
@ -67,6 +69,7 @@ namespace Sunny.UI.Demo
Header.CreateChildNode(Header.Nodes[3], style.DisplayText(), style.Value());
}
Header.CreateChildNode(Header.Nodes[3], "多彩主题", UIStyle.Colorful.Value());
Aside.SelectFirst();
}
@ -82,7 +85,11 @@ namespace Sunny.UI.Demo
case 3:
UIStyle style = (UIStyle)pageIndex;
StyleManager.Style = style;
if (style != UIStyle.Colorful)
StyleManager.Style = style;
else
SelectPage(pageIndex);
break;
}
}

View File

@ -335,6 +335,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="FColorful.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FColorful.Designer.cs">
<DependentUpon>FColorful.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Charts\FBarChartEx.resx">
<DependentUpon>FBarChartEx.cs</DependentUpon>
</EmbeddedResource>
@ -480,6 +486,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="FColorful.resx">
<DependentUpon>FColorful.cs</DependentUpon>
</EmbeddedResource>
<None Include="..\.editorconfig">
<Link>.editorconfig</Link>
</None>