Changed: simplified tile container, removed group label

This commit is contained in:
Ray 2020-05-15 01:19:09 +01:00
parent 5ad779ddab
commit 9e167916cb
25 changed files with 443 additions and 131 deletions

View File

@ -73,16 +73,16 @@
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Drawing\Rectangoid.cs" />
<Compile Include="RyzStudio\Windows\Forms\FlatButton.cs">
<Compile Include="RyzStudio\Windows\Forms\TFlatButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\Forms\HorizontalSeparator.cs">
<Compile Include="RyzStudio\Windows\Forms\THorizontalSeparator.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\Forms\HorizontalSeparator.Designer.cs">
<DependentUpon>HorizontalSeparator.cs</DependentUpon>
<Compile Include="RyzStudio\Windows\Forms\THorizontalSeparator.Designer.cs">
<DependentUpon>THorizontalSeparator.cs</DependentUpon>
</Compile>
<Compile Include="RyzStudio\Windows\Forms\ImageBox.cs">
<Compile Include="RyzStudio\Windows\Forms\TImageBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RyzStudio\Windows\ThemedForms\TButton.cs">
@ -154,12 +154,6 @@
<Compile Include="Windows\Forms\AUserControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Windows\Forms\Tile\TileGroupLabel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Windows\Forms\Tile\TileGroupLabel.Designer.cs">
<DependentUpon>TileGroupLabel.cs</DependentUpon>
</Compile>
<Compile Include="Windows\Forms\Tile\TileLayoutContainer.cs">
<SubType>UserControl</SubType>
</Compile>
@ -175,12 +169,6 @@
<Compile Include="Windows\Forms\Tile\TilePanel.Designer.cs">
<DependentUpon>TilePanel.cs</DependentUpon>
</Compile>
<Compile Include="Windows\Forms\TitlePanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Windows\Forms\TitlePanel.Designer.cs">
<DependentUpon>TitlePanel.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
@ -225,9 +213,6 @@
<EmbeddedResource Include="Windows\Forms\Tile\EditTileForm.resx">
<DependentUpon>EditTileForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Forms\Tile\TileGroupLabel.resx">
<DependentUpon>TileGroupLabel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Forms\Tile\TileLayoutContainer.resx">
<DependentUpon>TileLayoutContainer.cs</DependentUpon>
</EmbeddedResource>
@ -237,9 +222,6 @@
<EmbeddedResource Include="Windows\Forms\Tile\TilePanel.resx">
<DependentUpon>TilePanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\Forms\TitlePanel.resx">
<DependentUpon>TitlePanel.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@ -315,5 +297,8 @@
<ItemGroup>
<None Include="RyzStudio\Windows\Forms\Resources\edit2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\app_icon_24.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

19
MainForm.Designer.cs generated
View File

@ -29,7 +29,6 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.titlePanel1 = new AppLauncher.Windows.Forms.TitlePanel();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
@ -42,20 +41,6 @@
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// titlePanel1
//
this.titlePanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.titlePanel1.BackColor = System.Drawing.Color.Black;
this.titlePanel1.LabelVisible = true;
this.titlePanel1.Location = new System.Drawing.Point(0, 0);
this.titlePanel1.MainMenu = this.contextMenuStrip1;
this.titlePanel1.MinimumSize = new System.Drawing.Size(40, 40);
this.titlePanel1.Name = "titlePanel1";
this.titlePanel1.Size = new System.Drawing.Size(1088, 40);
this.titlePanel1.TabIndex = 8;
this.titlePanel1.TitleText = "Launcher";
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -129,11 +114,10 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(83)))), ((int)(((byte)(93)))));
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(254)))), ((int)(((byte)(254)))));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.ClientSize = new System.Drawing.Size(1088, 440);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.titlePanel1);
this.Name = "MainForm";
this.Text = "Form1";
this.contextMenuStrip1.ResumeLayout(false);
@ -142,7 +126,6 @@
}
#endregion
private Windows.Forms.TitlePanel titlePanel1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;

View File

@ -51,7 +51,7 @@ namespace AppLauncher
if (this.Width > collapsedWidth)
{
flowLayoutPanel1.Visible = false;
titlePanel1.LabelVisible = false;
//titlePanel1.LabelVisible = false;
await collapseWindow(collapsedWidth, 6);
}
@ -60,7 +60,7 @@ namespace AppLauncher
await expandWindow(expandedWidth, 8);
flowLayoutPanel1.Visible = true;
titlePanel1.LabelVisible = true;
//titlePanel1.LabelVisible = true;
}
}
@ -199,7 +199,7 @@ namespace AppLauncher
flowLayoutPanel1.Width = maxWidth + SystemInformation.VerticalScrollBarWidth + 20;
//this.Width = flowLayoutPanel1.Width + (flowLayoutPanel1.Left * 2);
this.Width = flowLayoutPanel1.Width + flowLayoutPanel1.Left;
//##this.Width = flowLayoutPanel1.Width + flowLayoutPanel1.Left;
}
}

View File

@ -60,6 +60,16 @@ namespace AppLauncher.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap app_icon_24 {
get {
object obj = ResourceManager.GetObject("app_icon_24", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -118,6 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="app_icon_24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\app_icon_24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrow_right_ea_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrow-right-ea-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

BIN
Resources/app_icon_24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

View File

@ -26,9 +26,9 @@
inkscape:document-rotation="0"
inkscape:current-layer="layer1"
inkscape:document-units="mm"
inkscape:cy="337.65287"
inkscape:cx="315.58816"
inkscape:zoom="7.9195959"
inkscape:cy="390.6468"
inkscape:cx="331.14896"
inkscape:zoom="5.6"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
@ -416,5 +416,111 @@
id="path1109-2" />
</g>
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\app_icon_24.png"
transform="matrix(0.4024192,0,0,0.4024192,75.420915,95.566356)"
id="g1549"
style="fill:none;fill-opacity:1;stroke:#545b6b;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1">
<rect
x="2.7877357"
y="2.7877357"
width="5.5141511"
height="5.5141511"
id="rect1168"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\rect1168.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120"
style="fill:none;fill-opacity:1;stroke:#545b6b;stroke-width:1.57547;stroke-opacity:1" />
<rect
x="11.45283"
y="2.7877357"
width="5.5141511"
height="5.5141511"
id="rect1170"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\rect1168.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120"
style="fill:none;fill-opacity:1;stroke:#545b6b;stroke-width:1.57547;stroke-opacity:1" />
<rect
x="11.45283"
y="11.45283"
width="5.5141511"
height="5.5141511"
id="rect1172"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\rect1168.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120"
style="fill:none;fill-opacity:1;stroke:#545b6b;stroke-width:1.57547;stroke-opacity:1" />
<rect
x="2.7877357"
y="11.45283"
width="5.5141511"
height="5.5141511"
id="rect1174"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\rect1168.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120"
style="fill:none;fill-opacity:1;stroke:#545b6b;stroke-width:1.57547;stroke-opacity:1" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\toggle-left-ea-16.png"
transform="matrix(0.32940665,0,0,0.32940665,85.708522,93.493015)"
id="g1565"
style="fill:none;stroke:#636977;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1">
<rect
x="0.52007085"
y="4.520071"
width="11.441558"
height="7.2809916"
rx="3.6404958"
ry="3.6404958"
id="rect5891"
style="stroke:#636977;stroke-width:1.04014;stroke-opacity:1"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\rect5891.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120" />
<circle
cx="4.1605668"
cy="8.1605663"
r="1.5602125"
id="circle5893"
style="stroke:#636977;stroke-width:1.04014;stroke-opacity:1"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\rect5891.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120" />
</g>
<g
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\toggle-right-ea-16.png"
transform="matrix(0.33075013,0,0,0.33075013,91.462156,93.398154)"
id="g1581"
style="fill:none;stroke:#636977;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1">
<rect
x="0.51694918"
y="4.5169492"
width="11.372882"
height="7.237288"
rx="3.618644"
ry="3.618644"
id="rect5915"
style="stroke:#636977;stroke-width:1.0339;stroke-opacity:1"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\toggle-right-ea-16.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120" />
<circle
cx="8.2711868"
cy="8.1355934"
r="1.5508475"
id="circle5917"
style="stroke:#636977;stroke-width:1.0339;stroke-opacity:1"
inkscape:export-filename="L:\gitlab-hiimray\linear-app-launcher\Resources\toggle-right-ea-16.png"
inkscape:export-xdpi="120"
inkscape:export-ydpi="120" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 B

After

Width:  |  Height:  |  Size: 502 B

View File

@ -9,7 +9,7 @@ using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public class FlatButton : Label
public class TFlatButton : Label
{
public class FlatButtonStyle
{
@ -26,7 +26,7 @@ namespace RyzStudio.Windows.Forms
protected FlatButtonState controlState = FlatButtonState.Idle;
public FlatButton() : base()
public TFlatButton() : base()
{
this.AutoSize = false;
this.ImageAlign = ContentAlignment.MiddleCenter;

View File

@ -1,6 +1,6 @@
namespace RyzStudio.Windows.Forms
{
partial class HorizontalSeparator
partial class THorizontalSeparator
{
/// <summary>
/// Required designer variable.

View File

@ -3,9 +3,9 @@ using System.Windows.Forms;
namespace RyzStudio.Windows.Forms
{
public partial class HorizontalSeparator : System.Windows.Forms.UserControl
public partial class THorizontalSeparator : System.Windows.Forms.UserControl
{
public HorizontalSeparator()
public THorizontalSeparator()
{
InitializeComponent();
@ -17,8 +17,10 @@ namespace RyzStudio.Windows.Forms
base.OnPaintBackground(e);
Graphics g = e.Graphics;
g.FillRectangle(new SolidBrush(Color.FromArgb(213, 223, 229)), new Rectangle(this.DisplayRectangle.Left, 0, this.DisplayRectangle.Width, 1));
g.FillRectangle(new SolidBrush(Color.FromArgb(249, 251, 253)), new Rectangle(this.DisplayRectangle.Left, 1, this.DisplayRectangle.Width, 1));
}
}
}

View File

@ -4,9 +4,9 @@ using System.Drawing;
namespace RyzStudio.Windows.Forms
{
public class ImageBox : System.Windows.Forms.PictureBox
public class TImageBox : System.Windows.Forms.PictureBox
{
public ImageBox() : base()
public TImageBox() : base()
{
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.ErrorImage = null;
@ -22,7 +22,7 @@ namespace RyzStudio.Windows.Forms
}
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public new Image Image { get => base.Image; set { base.Image = value; } }
public new Image Image { get => base.Image; set => base.Image = value; }
[Category("Appearance"), Browsable(true)]
public Image NormalImage { get; set; }

View File

@ -77,7 +77,7 @@
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]
public Forms.ImageBox InnerImageBox { get => imageBox1; set => imageBox1 = value; }
public Forms.TImageBox InnerImageBox { get => imageBox1; set => imageBox1 = value; }
[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)]
[Category("Appearance")]

View File

@ -29,7 +29,7 @@
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.imageBox1 = new RyzStudio.Windows.Forms.ImageBox();
this.imageBox1 = new RyzStudio.Windows.Forms.TImageBox();
((System.ComponentModel.ISupportInitialize)(this.imageBox1)).BeginInit();
this.SuspendLayout();
//
@ -76,6 +76,6 @@
#endregion
private System.Windows.Forms.TextBox textBox1;
private Forms.ImageBox imageBox1;
private Forms.TImageBox imageBox1;
}
}

View File

@ -30,7 +30,7 @@
{
this.lblDescription = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.imgbxClose = new RyzStudio.Windows.Forms.ImageBox();
this.imgbxClose = new RyzStudio.Windows.Forms.TImageBox();
this.area1 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
@ -115,7 +115,7 @@
}
#endregion
protected internal Forms.ImageBox imgbxClose;
protected internal Forms.TImageBox imgbxClose;
protected internal System.Windows.Forms.Label lblDescription;
protected internal System.Windows.Forms.Panel panel1;
protected internal System.Windows.Forms.Panel area1;

View File

@ -29,11 +29,11 @@
private void InitializeComponent()
{
this.listBox1 = new System.Windows.Forms.ListBox();
this.imageBox5 = new RyzStudio.Windows.Forms.ImageBox();
this.imageBox4 = new RyzStudio.Windows.Forms.ImageBox();
this.imageBox3 = new RyzStudio.Windows.Forms.ImageBox();
this.imageBox2 = new RyzStudio.Windows.Forms.ImageBox();
this.imageBox1 = new RyzStudio.Windows.Forms.ImageBox();
this.imageBox5 = new RyzStudio.Windows.Forms.TImageBox();
this.imageBox4 = new RyzStudio.Windows.Forms.TImageBox();
this.imageBox3 = new RyzStudio.Windows.Forms.TImageBox();
this.imageBox2 = new RyzStudio.Windows.Forms.TImageBox();
this.imageBox1 = new RyzStudio.Windows.Forms.TImageBox();
((System.ComponentModel.ISupportInitialize)(this.imageBox5)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imageBox4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.imageBox3)).BeginInit();
@ -173,10 +173,10 @@
#endregion
private System.Windows.Forms.ListBox listBox1;
private Forms.ImageBox imageBox1;
private Forms.ImageBox imageBox2;
private Forms.ImageBox imageBox3;
private Forms.ImageBox imageBox4;
private Forms.ImageBox imageBox5;
private Forms.TImageBox imageBox1;
private Forms.TImageBox imageBox2;
private Forms.TImageBox imageBox3;
private Forms.TImageBox imageBox4;
private Forms.TImageBox imageBox5;
}
}

View File

@ -12,6 +12,9 @@ namespace AppLauncher.Windows.Forms
{
public class AForm : Form
{
protected bool isDragging = false;
protected Point startPosition = new Point();
public AForm() : base()
{
if (!this.DesignMode)
@ -19,6 +22,10 @@ namespace AppLauncher.Windows.Forms
this.FormBorderStyle = FormBorderStyle.None;
this.StartPosition = FormStartPosition.Manual;
}
this.MouseDown += mainForm_MouseDown;
this.MouseUp += mainForm_MouseUp;
this.MouseMove += mainForm_MouseMove;
}
protected override void OnLoad(EventArgs e)
@ -40,20 +47,47 @@ namespace AppLauncher.Windows.Forms
//this.Location = newPosition;
}
protected override void OnPaintBackground(PaintEventArgs e)
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaintBackground(e);
base.OnPaint(e);
Graphics g = e.Graphics;
g.TextRenderingHint = TextRenderingHint.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBilinear;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.SmoothingMode = SmoothingMode.HighQuality;
Color borderColour = Color.FromArgb(232, 231, 236);
Color menubarColour = Color.FromArgb(237, 240, 247);
Rectangle area = new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - 1), (this.DisplayRectangle.Height - 1));
// border
g.DrawRectangle(new Pen(borderColour, 1), area);
area.Inflate(-1, -1);
g.FillRectangle(new SolidBrush(menubarColour), area.X, area.Y, (area.Width + area.X), 56);
g.DrawLine(new Pen(borderColour, 1), area.X, 57, (area.Width + area.X), 57);
g.DrawImageUnscaled(Properties.Resources.app_icon_24, 17, 17);
TextRenderer.DrawText(e.Graphics, "Launcher", new Font(this.Font.FontFamily, 14F), new Point(58, 17), Color.FromArgb(156, 158, 171));
//g.DrawRectangle(new Pen(Color.FromArgb(232, 231, 236), 1), borderArea);
//g.DrawRectangle(new Pen(Color.Red, 1), area);
}
//protected override void OnPaintBackground(PaintEventArgs e)
//{
// base.OnPaintBackground(e);
//Graphics g = e.Graphics;
//g.TextRenderingHint = TextRenderingHint.AntiAlias;
//g.InterpolationMode = InterpolationMode.HighQualityBilinear;
//g.PixelOffsetMode = PixelOffsetMode.HighQuality;
//g.SmoothingMode = SmoothingMode.HighQuality;
//g.FillRectangle(new LinearGradientBrush(this.DisplayRectangle, Color.FromArgb(76, 83, 93), Color.FromArgb(255, 255, 255), -30F), this.DisplayRectangle);
//g.DrawRectangle(new Pen(new SolidBrush(Color.Red), 1), this.DisplayRectangle);
}
//}
protected Point DefaultLocation
{
@ -70,5 +104,35 @@ namespace AppLauncher.Windows.Forms
}
}
public override Color BackColor { get => base.BackColor; set => base.BackColor = Color.FromArgb(254, 254, 254); }
private void mainForm_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left)
{
return;
}
isDragging = true;
startPosition = e.Location;
}
private void mainForm_MouseUp(object sender, MouseEventArgs e)
{
isDragging = false;
}
private void mainForm_MouseMove(object sender, MouseEventArgs e)
{
if (isDragging)
{
int x = (this.Location.X + (e.Location.X - startPosition.X));
int y = (this.Location.Y + (e.Location.Y - startPosition.Y));
//this.Location = validateFormLocation(x, y);
this.Location = new Point(x, y);
}
}
}
}

View File

@ -14,7 +14,7 @@ namespace AppLauncher.Windows.Forms
private System.Windows.Forms.Label label1;
private TButton button1;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator1;
private TTextBox textBox1;
protected TileLayoutPanel parentPanel = null;
@ -39,7 +39,7 @@ namespace AppLauncher.Windows.Forms
this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//

View File

@ -29,8 +29,8 @@ namespace AppLauncher.Windows.Forms
private TButton button1;
private TPickerBox pickerBox1;
private TPickerBox pickerBox2;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator2;
private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2;
private TTextBox textBox1;
protected TileLayoutPanel parentPanel = null;
@ -67,8 +67,8 @@ namespace AppLauncher.Windows.Forms
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TPickerBox();
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TPickerBox();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//

View File

@ -14,7 +14,7 @@ namespace AppLauncher.Windows.Forms
private System.Windows.Forms.Label label1;
private TButton button1;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator2;
private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2;
private TTextBox textBox1;
private TListBox tListBox1;
private System.Windows.Forms.Label label2;
@ -57,7 +57,7 @@ namespace AppLauncher.Windows.Forms
this.textBox1 = new RyzStudio.Windows.ThemedForms.TTextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.tListBox1 = new RyzStudio.Windows.ThemedForms.TListBox();
this.label2 = new System.Windows.Forms.Label();
this.tButton1 = new RyzStudio.Windows.ThemedForms.TButton();

View File

@ -25,8 +25,8 @@ namespace AppLauncher.Windows.Forms
private TButton button1;
private TPickerBox pickerBox1;
private TPickerBox pickerBox2;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator2;
private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.Forms.THorizontalSeparator horizontalSeparator2;
private TTextBox textBox1;
protected TilePanel parentPanel = null;
@ -63,8 +63,8 @@ namespace AppLauncher.Windows.Forms
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TPickerBox();
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TPickerBox();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//

View File

@ -29,28 +29,26 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.label1 = new AppLauncher.Windows.Forms.TileGroupLabel();
this.panel1 = new AppLauncher.Windows.Forms.TileLayoutPanel();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.topToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.upToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.downToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bottomToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
this.contextMenuStrip2.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.label1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.label1.Checked = false;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 3);
this.label1.MinimumSize = new System.Drawing.Size(100, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(223, 20);
this.label1.TabIndex = 11;
this.label1.TileGroupPanel = null;
this.label1.TitleText = "Featured";
//
// panel1
//
this.panel1.AllowDrop = true;
@ -69,42 +67,142 @@
this.addToolStripMenuItem,
this.addListToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 70);
this.contextMenuStrip1.Size = new System.Drawing.Size(139, 48);
//
// addToolStripMenuItem
//
this.addToolStripMenuItem.Name = "addToolStripMenuItem";
this.addToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.addToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.addToolStripMenuItem.Text = "&Add Tile";
this.addToolStripMenuItem.Click += new System.EventHandler(this.addTileMenuItem_Click);
//
// addListToolStripMenuItem
//
this.addListToolStripMenuItem.Name = "addListToolStripMenuItem";
this.addListToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.addListToolStripMenuItem.Size = new System.Drawing.Size(138, 22);
this.addListToolStripMenuItem.Text = "Add &List Tile";
this.addListToolStripMenuItem.Click += new System.EventHandler(this.addListTileMenuItem_Click);
//
// contextMenuStrip2
//
this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem2,
this.toolStripMenuItem5,
this.toolStripMenuItem1,
this.toolStripSeparator2,
this.toolStripMenuItem4,
this.toolStripSeparator1,
this.toolStripMenuItem3});
this.contextMenuStrip2.Name = "contextMenuStrip1";
this.contextMenuStrip2.Size = new System.Drawing.Size(133, 126);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem2.Text = "&Add Group";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripMenuItem5
//
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem5.Text = "Add &Row";
this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem1.Text = "&Edit";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(129, 6);
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.topToolStripMenuItem,
this.upToolStripMenuItem,
this.downToolStripMenuItem,
this.bottomToolStripMenuItem});
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem4.Text = "&Move";
//
// topToolStripMenuItem
//
this.topToolStripMenuItem.Name = "topToolStripMenuItem";
this.topToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.topToolStripMenuItem.Text = "&Top";
this.topToolStripMenuItem.Click += new System.EventHandler(this.topToolStripMenuItem_Click);
//
// upToolStripMenuItem
//
this.upToolStripMenuItem.Name = "upToolStripMenuItem";
this.upToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.upToolStripMenuItem.Text = "&Up";
this.upToolStripMenuItem.Click += new System.EventHandler(this.upToolStripMenuItem_Click);
//
// downToolStripMenuItem
//
this.downToolStripMenuItem.Name = "downToolStripMenuItem";
this.downToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.downToolStripMenuItem.Text = "&Down";
this.downToolStripMenuItem.Click += new System.EventHandler(this.downToolStripMenuItem_Click);
//
// bottomToolStripMenuItem
//
this.bottomToolStripMenuItem.Name = "bottomToolStripMenuItem";
this.bottomToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
this.bottomToolStripMenuItem.Text = "&Bottom";
this.bottomToolStripMenuItem.Click += new System.EventHandler(this.bottomToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(129, 6);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(132, 22);
this.toolStripMenuItem3.Text = "&Remove";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
// TileLayoutContainer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.panel1);
this.Controls.Add(this.label1);
this.Name = "TileLayoutContainer";
this.Size = new System.Drawing.Size(370, 150);
this.contextMenuStrip1.ResumeLayout(false);
this.contextMenuStrip2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private TileGroupLabel label1;
private TileLayoutPanel panel1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addListToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
private System.Windows.Forms.ToolStripMenuItem topToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem upToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem downToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem bottomToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
}
}

View File

@ -1,6 +1,7 @@
using AppLauncher.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Threading;
using System.Threading.Tasks;
@ -10,19 +11,19 @@ namespace AppLauncher.Windows.Forms
{
public partial class TileLayoutContainer : AUserControl
{
protected int collapseIncrement = 6;
protected int expandIncrement = 8;
protected TileGroupModel groupInfo = null;
protected readonly int labelHeight = 20;
protected readonly int collapseIncrement = 6;
protected readonly int expandIncrement = 8;
protected bool isAnimating = false;
protected bool isChecked = true;
public TileLayoutContainer(TileGroupModel model) : base()
{
InitializeComponent();
this.ContextMenuStrip = contextMenuStrip1;
label1.TileGroupPanel = this;
this.LoadModel(model);
panel1.Resize += panel1_Resize;
@ -32,9 +33,7 @@ namespace AppLauncher.Windows.Forms
{
base.OnLoad(e);
label1.Width = panel1.Width;
this.Margin = new Padding(0, 0, 0, 0);
this.Margin = new Padding(0);
this.Padding = new Padding(0, 0, 0, 10);
//this.MaximumSize = new Size(panel1.Width, ExpandedHeight);
//this.MinimumSize = new Size(panel1.Width, label1.Height);
@ -42,16 +41,23 @@ namespace AppLauncher.Windows.Forms
this.Size = new Size(panel1.Width, this.ExpandedHeight);
}
private async void panel1_Resize(object sender, EventArgs e)
protected override void OnPaint(PaintEventArgs e)
{
await this.InvalidateContainer();
base.OnPaint(e);
Graphics g = e.Graphics;
g.DrawImageUnscaled((isChecked ? Properties.Resources.toggle_right_ea_16 : Properties.Resources.toggle_left_ea_16), 2, 2);
TextRenderer.DrawText(g, groupInfo?.Title, new Font(this.Font.FontFamily, 8.25F), new Point(25, 4), Color.FromArgb(99, 105, 119));
}
public int CollapseHeight => label1.Height + panel1.CollapseHeight;
private async void panel1_Resize(object sender, EventArgs e) => await this.InvalidateContainer();
public int ExpandedHeight => label1.Height + panel1.ExpandedHeight + this.Padding.Top + this.Padding.Bottom;
public int CollapseHeight => labelHeight + panel1.CollapseHeight;
public bool IsAnimating => isAnimating;
public int ExpandedHeight => labelHeight + panel1.ExpandedHeight + this.Padding.Top + this.Padding.Bottom;
public TileGroupModel Model
{
@ -59,9 +65,9 @@ namespace AppLauncher.Windows.Forms
{
TileGroupModel rs = new TileGroupModel()
{
Title = label1.TitleText,
Title = groupInfo.Title,
GridSize = new Size(panel1.GridSize.X, panel1.GridSize.Y),
IsExpanded = label1.Checked,
IsExpanded = isChecked,
IsExclusive = groupInfo.IsExclusive,
Items = panel1.Tiles
};
@ -171,12 +177,12 @@ namespace AppLauncher.Windows.Forms
public async Task InvalidateContainer(bool animate = true)
{
if (this.IsAnimating)
if (isAnimating)
{
return;
}
if (label1.Checked)
if (isChecked)
{
await this.Expand();
}
@ -222,16 +228,17 @@ namespace AppLauncher.Windows.Forms
{
groupInfo = model;
label1.TitleText = groupInfo.Title;
panel1.SetGridSize(groupInfo.GridSize.Width, groupInfo.GridSize.Height);
this.Width = panel1.Width;
label1.Checked = groupInfo.IsExpanded;
isChecked = groupInfo.IsExpanded;
if (loadTiles)
{
panel1.LoadTiles(model.Items);
}
this.Invalidate();
}
public void MoveTop()
@ -300,5 +307,56 @@ namespace AppLauncher.Windows.Forms
private void addListTileMenuItem_Click(object sender, EventArgs e) => AddListTileForm.ShowDialog(panel1);
protected override async void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
bool isLabel = ((e.Location.X >= 0) && (e.Location.X <= this.Width) && (e.Location.Y >= 0) && (e.Location.Y <= 20));
if (e.Button == MouseButtons.Left)
{
if (isLabel)
{
isChecked = !isChecked;
this.Invalidate();
await this.InvalidateContainer();
}
else
{
}
}
else if (e.Button == MouseButtons.Right)
{
if (isLabel)
{
contextMenuStrip2.Show(this, e.Location);
}
else
{
contextMenuStrip1.Show(this, e.Location);
}
}
}
protected override void OnMouseDoubleClick(MouseEventArgs e) => base.OnMouseClick(e);
private void toolStripMenuItem2_Click(object sender, EventArgs e) => this.AddGroup();
private void toolStripMenuItem5_Click(object sender, EventArgs e) => this.AddRow();
private void toolStripMenuItem1_Click(object sender, EventArgs e) => this.EditGroup();
private void topToolStripMenuItem_Click(object sender, EventArgs e) => this.MoveTop();
private void upToolStripMenuItem_Click(object sender, EventArgs e) => this.MoveUp();
private void downToolStripMenuItem_Click(object sender, EventArgs e) => this.MoveDown();
private void bottomToolStripMenuItem_Click(object sender, EventArgs e) => this.MoveBottom();
private void toolStripMenuItem3_Click(object sender, EventArgs e) => this.Remove();
}
}

View File

@ -120,4 +120,7 @@
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>172, 17</value>
</metadata>
</root>