diff --git a/FizzyLauncher.csproj b/FizzyLauncher.csproj index 79510dc..edcf398 100644 --- a/FizzyLauncher.csproj +++ b/FizzyLauncher.csproj @@ -69,6 +69,9 @@ True AppResource.resx + + Form + UserControl diff --git a/MainForm.cs b/MainForm.cs index 982c774..ac8dee2 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -162,6 +162,14 @@ namespace FizzyLauncher public LauncherSession CurrentSession { get; set; } = null; + public void Clear(int columnCount) + { + tileContainer1.Clear(); + tileContainer1.Add(columnCount); + + sessionFilename = null; + } + protected async Task collapseWindow(int width, int increment = 6) { await Task.Run(() => @@ -232,7 +240,8 @@ namespace FizzyLauncher protected void newSession() { - tileContainer1.Clear(true); + NewForm form = new NewForm(this); + form.ShowDialog(); } protected async Task loadFile(string filename) @@ -392,6 +401,11 @@ namespace FizzyLauncher #region main menu + /// + /// New + /// + /// + /// private void newToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(sessionFilename)) @@ -407,15 +421,11 @@ namespace FizzyLauncher if (rv) { newSession(); - - sessionFilename = null; } } else if (dr == DialogResult.No) { newSession(); - - sessionFilename = null; } else if (dr == DialogResult.Cancel) { @@ -424,6 +434,11 @@ namespace FizzyLauncher } } + /// + /// Open + /// + /// + /// private async void openToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(sessionFilename)) @@ -461,6 +476,11 @@ namespace FizzyLauncher } } + /// + /// Close + /// + /// + /// private void closeToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(sessionFilename)) @@ -493,6 +513,11 @@ namespace FizzyLauncher } } + /// + /// Save + /// + /// + /// private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(sessionFilename)) @@ -505,11 +530,21 @@ namespace FizzyLauncher } } + /// + /// Save As + /// + /// + /// private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { saveAsFile(); } + /// + /// Exit + /// + /// + /// private void exitToolStripMenuItem2_Click(object sender, EventArgs e) { requestExit = true; @@ -535,6 +570,11 @@ namespace FizzyLauncher } + /// + /// Show big icons + /// + /// + /// private void showBigIconsToolStripMenuItem_Click(object sender, EventArgs e) { if (this.CurrentSession == null) @@ -547,6 +587,11 @@ namespace FizzyLauncher showBigIconsToolStripMenuItem.Checked = this.CurrentSession.EnableBigIconInFolder; } + /// + /// Enable animations + /// + /// + /// private void enableAnimationsToolStripMenuItem_Click(object sender, EventArgs e) { if (this.CurrentSession == null) @@ -559,12 +604,22 @@ namespace FizzyLauncher enableAnimationsToolStripMenuItem.Checked = this.CurrentSession.EnableAnimation; } + /// + /// Always on top + /// + /// + /// private void alwaysOnTopToolStripMenuItem_Click(object sender, EventArgs e) { this.TopMost = !this.TopMost; } + /// + /// Options + /// + /// + /// private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { if (optionsForm == null) optionsForm = new OptionsForm(this); @@ -574,6 +629,11 @@ namespace FizzyLauncher } + /// + /// View help + /// + /// + /// private void viewHelpToolStripMenuItem1_Click(object sender, EventArgs e) { try @@ -586,6 +646,11 @@ namespace FizzyLauncher } } + /// + /// About + /// + /// + /// private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) { MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information); @@ -598,7 +663,6 @@ namespace FizzyLauncher saveAsToolStripMenuItem.Enabled = !string.IsNullOrWhiteSpace(sessionFilename); } - #endregion #region notification icon diff --git a/NewForm.cs b/NewForm.cs new file mode 100644 index 0000000..24d6442 --- /dev/null +++ b/NewForm.cs @@ -0,0 +1,126 @@ +using RyzStudio.Windows.ThemedForms; +using System; + +namespace FizzyLauncher +{ + public class NewForm : TDialogForm + { + private System.Windows.Forms.Label label1; + private TButton button1; + private TNumericBox numericBox1; + private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; + + + public NewForm(MainForm parent) : base() + { + InitializeComponent(); + + parentForm = parent; + + numericBox1.InnerControl.Minimum = 4; + numericBox1.InnerControl.Maximum = 24; + numericBox1.InnerControl.Value = 6; + } + + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); + this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + this.numericBox1 = new RyzStudio.Windows.ThemedForms.TNumericBox(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.ForeColor = System.Drawing.SystemColors.ControlText; + this.label1.Location = new System.Drawing.Point(10, 21); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); + this.label1.Size = new System.Drawing.Size(137, 34); + this.label1.TabIndex = 153; + this.label1.Text = "Number of Tiles Per Row"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button1.BackColor = System.Drawing.Color.Transparent; + this.button1.DefaultImage = null; + this.button1.DownImage = null; + this.button1.IsSelected = false; + this.button1.LabelText = "&Save"; + this.button1.Location = new System.Drawing.Point(241, 109); + this.button1.Margin = new System.Windows.Forms.Padding(10); + this.button1.Name = "button1"; + this.button1.OverImage = null; + this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.button1.Size = new System.Drawing.Size(128, 32); + this.button1.TabIndex = 173; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // tHorizontalSeparator1 + // + this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); + this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; + this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 77); + this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 0); + this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); + this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; + this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); + this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); + this.tHorizontalSeparator1.TabIndex = 188; + // + // numericBox1 + // + this.numericBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.numericBox1.BackColor = System.Drawing.Color.Transparent; + this.numericBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.numericBox1.Location = new System.Drawing.Point(285, 20); + this.numericBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); + this.numericBox1.Name = "numericBox1"; + this.numericBox1.Padding = new System.Windows.Forms.Padding(8, 8, 7, 7); + this.numericBox1.Size = new System.Drawing.Size(84, 34); + this.numericBox1.SubmitButton = null; + this.numericBox1.TabIndex = 189; + this.numericBox1.Value = 0; + // + // NewForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 161); + this.Controls.Add(this.numericBox1); + this.Controls.Add(this.tHorizontalSeparator1); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.MinimumSize = new System.Drawing.Size(400, 200); + this.Name = "NewForm"; + this.Text = "New"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + + public MainForm parentForm { get; set; } = null; + + + private void button1_Click(object sender, EventArgs e) + { + if (parentForm != null) + { + parentForm.Clear(numericBox1.Value); + } + + this.Close(); + } + + } +} \ No newline at end of file diff --git a/NewForm.resx b/NewForm.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/NewForm.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/OptionsForm.resx b/OptionsForm.resx index e3d054b..c8f691f 100644 --- a/OptionsForm.resx +++ b/OptionsForm.resx @@ -61,7 +61,7 @@ iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vQAADr0BR/uQrQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAClSURBVDhP7dI/ + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAClSURBVDhP7dI/ DgFBGIbxSVTKjcRx3MLqXYCOjkocQcMF3MAZOIKaE5AthOexf2QnbJQKb/JLJvO9XzLFhCgtbHDBveB5 DWcfM8ANC0wKnr1LUUsbHXSxxBlJxDtnduy6E04on/Utd0IPOxwxxBT9iHfO7Nh155kV9vmxMXbsVvkv vvIji4f82Bg7tcUxrpih/NyxOeyMUMVPu0WGd39TzuzQDeEB5/ZKvTSyulEAAAAASUVORK5CYII= @@ -70,7 +70,7 @@ iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vQAADr0BR/uQrQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADTSURBVDhP7ZI7 + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADTSURBVDhP7ZI7 CsJQEEUfWFmK4HLchdpnA9ppp5W4BBtdQNyBC0ilRf6VdVyBwUL03JdXxC/YWThwmDcz94YJjKmH7/uN OI7XaZqekiS5Cr1hpZmTPQemAeILeU4eC/dWr+9kVQRB0MzzvB2GYQfBAsExiqJWHfU0k0ZaeQyNAuxa X1CYLMu6/MOW4kD2YAK9B9TznGYrj12XVZY0drb4ENJI68q/sR4/YoS9K9+GNHdGLmIEJV+cku1xP4Jh diff --git a/RyzStudio/Windows/ThemedForms/TNumericBox.cs b/RyzStudio/Windows/ThemedForms/TNumericBox.cs new file mode 100644 index 0000000..76a1f7e --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TNumericBox.cs @@ -0,0 +1,99 @@ +using RyzStudio.Drawing; +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace RyzStudio.Windows.ThemedForms +{ + public partial class TNumericBox : RyzStudio.Windows.ThemedForms.TUserControl + { + protected readonly Padding textboxPadding = new Padding(4, 4, 4, 4); + + + public TNumericBox() : base() + { + InitializeComponent(); + + this.Margin = new Padding(10, 6, 10, 6); + this.Font = new Font(this.Font, FontStyle.Regular); + + numericUpDown1.Font = this.Font; + numericUpDown1.PreviewKeyDown += textBox_PreviewKeyDown; + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + + int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding; + + this.Height = numericUpDown1.Height + (b + textboxPadding.Top) + ((b - 1) + textboxPadding.Bottom); + + this.Invalidate(); + } + + protected override void OnGotFocus(EventArgs e) + { + base.OnGotFocus(e); + + numericUpDown1.Focus(); + } + + protected void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + switch (e.KeyCode) + { + case Keys.Enter: + if (this.SubmitButton != null) + { + this.SubmitButton.PerformClick(); + } + + break; + case Keys.Escape: + close(); + break; + default: break; + } + } + + [Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + [Category("Appearance")] + public System.Windows.Forms.NumericUpDown InnerControl { get => numericUpDown1; set => numericUpDown1 = value; } + + [Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + [Category("Appearance")] + public int Value + { + get => (int)numericUpDown1.Value; + set + { + numericUpDown1.Value = value; + } + } + + //[Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + //[Category("Appearance")] + //public bool UseSystemPasswordChar { get => textBox1.UseSystemPasswordChar; set => textBox1.UseSystemPasswordChar = value; } + + [Browsable(true), EditorBrowsable(EditorBrowsableState.Advanced)] + [Category("Appearance")] + public TButton SubmitButton { get; set; } = null; + + [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new Padding Margin { get { return base.Margin; } set { base.Margin = value; } } + + protected override void updateBackground(Graphics g, ThemeStyle style) + { + int b = (styleActive.BorderWidth + 1) + styleActive.BorderPadding; + + this.Padding = new Padding((b + textboxPadding.Left), (b + textboxPadding.Top), ((b - 1) + textboxPadding.Right), ((b - 1) + textboxPadding.Bottom)); + + Rectangoid area = new Rectangoid(this.ClientRectangle, style.BorderRadius, style.BorderWidth); + g.FillPath(new SolidBrush(style.BackColour), area.ToGraphicsPath()); + g.DrawPath(new Pen(new SolidBrush(style.BorderColour), style.BorderWidth), area.ToGraphicsPath()); + } + + } +} \ No newline at end of file diff --git a/RyzStudio/Windows/ThemedForms/TNumericBox.designer.cs b/RyzStudio/Windows/ThemedForms/TNumericBox.designer.cs new file mode 100644 index 0000000..799db24 --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TNumericBox.designer.cs @@ -0,0 +1,60 @@ +namespace RyzStudio.Windows.ThemedForms +{ + partial class TNumericBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); + this.SuspendLayout(); + // + // numericUpDown1 + // + this.numericUpDown1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.numericUpDown1.Dock = System.Windows.Forms.DockStyle.Fill; + this.numericUpDown1.Location = new System.Drawing.Point(4, 4); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(121, 19); + this.numericUpDown1.TabIndex = 0; + // + // TNumericBox + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.Controls.Add(this.numericUpDown1); + this.Name = "TNumericBox"; + this.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + this.Size = new System.Drawing.Size(128, 32); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.NumericUpDown numericUpDown1; + } +} diff --git a/RyzStudio/Windows/ThemedForms/TNumericBox.resx b/RyzStudio/Windows/ThemedForms/TNumericBox.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/RyzStudio/Windows/ThemedForms/TNumericBox.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Windows/Forms/EditGroupForm.cs b/Windows/Forms/EditGroupForm.cs index 8b85caa..2e03992 100644 --- a/Windows/Forms/EditGroupForm.cs +++ b/Windows/Forms/EditGroupForm.cs @@ -90,7 +90,7 @@ namespace FizzyLauncher.Windows.Forms this.button1.DefaultImage = null; this.button1.DownImage = null; this.button1.IsSelected = false; - this.button1.LabelText = "&OK"; + this.button1.LabelText = "&Save"; this.button1.Location = new System.Drawing.Point(241, 469); this.button1.Margin = new System.Windows.Forms.Padding(10); this.button1.Name = "button1"; @@ -131,7 +131,6 @@ namespace FizzyLauncher.Windows.Forms // // EditGroupForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.ClientSize = new System.Drawing.Size(384, 521); this.Controls.Add(this.horizontalSeparator2); this.Controls.Add(this.pickerBox1); diff --git a/Windows/Forms/EditTileFolderForm.cs b/Windows/Forms/EditTileFolderForm.cs index 459b35f..3bd30d8 100644 --- a/Windows/Forms/EditTileFolderForm.cs +++ b/Windows/Forms/EditTileFolderForm.cs @@ -63,10 +63,10 @@ namespace FizzyLauncher.Windows.Forms this.label2 = new System.Windows.Forms.Label(); this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); this.SuspendLayout(); - // + // // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox1.BackColor = System.Drawing.Color.Transparent; this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); @@ -78,9 +78,9 @@ namespace FizzyLauncher.Windows.Forms this.textBox1.SubmitButton = null; this.textBox1.TabIndex = 152; this.textBox1.UseSystemPasswordChar = false; - // + // // label1 - // + // this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.ForeColor = System.Drawing.SystemColors.ControlText; @@ -92,15 +92,15 @@ namespace FizzyLauncher.Windows.Forms this.label1.TabIndex = 153; this.label1.Text = "Title"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // button1 - // + // this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.button1.BackColor = System.Drawing.Color.Transparent; this.button1.DefaultImage = null; this.button1.DownImage = null; this.button1.IsSelected = false; - this.button1.LabelText = "&OK"; + this.button1.LabelText = "&Save"; this.button1.Location = new System.Drawing.Point(241, 469); this.button1.Margin = new System.Windows.Forms.Padding(10); this.button1.Name = "button1"; @@ -109,10 +109,10 @@ namespace FizzyLauncher.Windows.Forms this.button1.Size = new System.Drawing.Size(128, 32); this.button1.TabIndex = 173; this.button1.Click += new System.EventHandler(this.button1_Click); - // + // // horizontalSeparator2 - // - this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.horizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); this.horizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); @@ -125,12 +125,12 @@ namespace FizzyLauncher.Windows.Forms this.horizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); this.horizontalSeparator2.Size = new System.Drawing.Size(364, 22); this.horizontalSeparator2.TabIndex = 177; - // + // // listBox1 - // + // this.listBox1.AllowDrop = true; - this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.listBox1.BackColor = System.Drawing.Color.Transparent; this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); @@ -145,9 +145,9 @@ namespace FizzyLauncher.Windows.Forms this.listBox1.OnEdit += new System.EventHandler(this.listBox1_OnEdit); this.listBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.listBox1_DragDrop); this.listBox1.DragOver += new System.Windows.Forms.DragEventHandler(this.listBox1_DragOver); - // + // // label2 - // + // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.ForeColor = System.Drawing.SystemColors.ControlText; @@ -158,10 +158,10 @@ namespace FizzyLauncher.Windows.Forms this.label2.TabIndex = 181; this.label2.Text = "List"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // tHorizontalSeparator1 - // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + // + this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); @@ -174,10 +174,9 @@ namespace FizzyLauncher.Windows.Forms this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); this.tHorizontalSeparator1.TabIndex = 182; - // - // AddTileFolderForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + // + // EditTileFolderForm + // this.ClientSize = new System.Drawing.Size(384, 521); this.Controls.Add(this.tHorizontalSeparator1); this.Controls.Add(this.label2); @@ -187,7 +186,7 @@ namespace FizzyLauncher.Windows.Forms this.Controls.Add(this.label1); this.Controls.Add(this.textBox1); this.MinimumSize = new System.Drawing.Size(400, 560); - this.Name = "AddTileFolderForm"; + this.Name = "EditTileFolderForm"; this.Text = "Add List Tile"; this.ResumeLayout(false); this.PerformLayout(); diff --git a/Windows/Forms/EditTileForm.cs b/Windows/Forms/EditTileForm.cs index 4c962c7..a3d1efb 100644 --- a/Windows/Forms/EditTileForm.cs +++ b/Windows/Forms/EditTileForm.cs @@ -98,10 +98,10 @@ namespace FizzyLauncher.Windows.Forms this.horizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); this.horizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); this.SuspendLayout(); - // + // // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox1.BackColor = System.Drawing.Color.Transparent; this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); @@ -113,9 +113,9 @@ namespace FizzyLauncher.Windows.Forms this.textBox1.SubmitButton = null; this.textBox1.TabIndex = 152; this.textBox1.UseSystemPasswordChar = false; - // + // // label6 - // + // this.label6.AutoSize = true; this.label6.BackColor = System.Drawing.Color.Transparent; this.label6.ForeColor = System.Drawing.SystemColors.ControlText; @@ -126,9 +126,9 @@ namespace FizzyLauncher.Windows.Forms this.label6.TabIndex = 163; this.label6.Text = "Run As Admin"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label7 - // + // this.label7.AutoSize = true; this.label7.BackColor = System.Drawing.Color.Transparent; this.label7.ForeColor = System.Drawing.SystemColors.ControlText; @@ -139,9 +139,9 @@ namespace FizzyLauncher.Windows.Forms this.label7.TabIndex = 161; this.label7.Text = "Window Style"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label4 - // + // this.label4.AutoSize = true; this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.ForeColor = System.Drawing.SystemColors.ControlText; @@ -152,9 +152,9 @@ namespace FizzyLauncher.Windows.Forms this.label4.TabIndex = 159; this.label4.Text = "Working Directory"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label3 - // + // this.label3.AutoSize = true; this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.ForeColor = System.Drawing.SystemColors.ControlText; @@ -165,9 +165,9 @@ namespace FizzyLauncher.Windows.Forms this.label3.TabIndex = 157; this.label3.Text = "Argument"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label2 - // + // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.ForeColor = System.Drawing.SystemColors.ControlText; @@ -178,9 +178,9 @@ namespace FizzyLauncher.Windows.Forms this.label2.TabIndex = 155; this.label2.Text = "Filename"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label1 - // + // this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.ForeColor = System.Drawing.SystemColors.ControlText; @@ -192,10 +192,10 @@ namespace FizzyLauncher.Windows.Forms this.label1.TabIndex = 153; this.label1.Text = "Title"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // textBox2 - // - this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox2.BackColor = System.Drawing.Color.Transparent; this.textBox2.FileDialog = null; @@ -210,10 +210,10 @@ namespace FizzyLauncher.Windows.Forms this.textBox2.SubmitButton = null; this.textBox2.TabIndex = 170; this.textBox2.UseSystemPasswordChar = false; - // + // // textBox3 - // - this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox3.BackColor = System.Drawing.Color.Transparent; this.textBox3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); @@ -225,10 +225,10 @@ namespace FizzyLauncher.Windows.Forms this.textBox3.SubmitButton = null; this.textBox3.TabIndex = 171; this.textBox3.UseSystemPasswordChar = false; - // + // // textBox4 - // - this.textBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.textBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox4.BackColor = System.Drawing.Color.Transparent; this.textBox4.FolderDialog = null; @@ -243,15 +243,15 @@ namespace FizzyLauncher.Windows.Forms this.textBox4.SubmitButton = null; this.textBox4.TabIndex = 172; this.textBox4.UseSystemPasswordChar = false; - // + // // button1 - // + // this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.button1.BackColor = System.Drawing.Color.Transparent; this.button1.DefaultImage = null; this.button1.DownImage = null; this.button1.IsSelected = false; - this.button1.LabelText = "&OK"; + this.button1.LabelText = "&Save"; this.button1.Location = new System.Drawing.Point(241, 469); this.button1.Margin = new System.Windows.Forms.Padding(10); this.button1.Name = "button1"; @@ -260,9 +260,9 @@ namespace FizzyLauncher.Windows.Forms this.button1.Size = new System.Drawing.Size(128, 32); this.button1.TabIndex = 173; this.button1.Click += new System.EventHandler(this.button1_Click); - // + // // pickerBox1 - // + // this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.pickerBox1.BackColor = System.Drawing.Color.Transparent; this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); @@ -273,9 +273,9 @@ namespace FizzyLauncher.Windows.Forms this.pickerBox1.Size = new System.Drawing.Size(128, 34); this.pickerBox1.SubmitButton = null; this.pickerBox1.TabIndex = 174; - // + // // pickerBox2 - // + // this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.pickerBox2.BackColor = System.Drawing.Color.Transparent; this.pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); @@ -286,10 +286,10 @@ namespace FizzyLauncher.Windows.Forms this.pickerBox2.Size = new System.Drawing.Size(84, 34); this.pickerBox2.SubmitButton = null; this.pickerBox2.TabIndex = 175; - // + // // horizontalSeparator1 - // - this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.horizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); this.horizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); @@ -302,10 +302,10 @@ namespace FizzyLauncher.Windows.Forms this.horizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); this.horizontalSeparator1.Size = new System.Drawing.Size(364, 22); this.horizontalSeparator1.TabIndex = 176; - // + // // horizontalSeparator2 - // - this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + // + this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.horizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); this.horizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); @@ -318,10 +318,9 @@ namespace FizzyLauncher.Windows.Forms this.horizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); this.horizontalSeparator2.Size = new System.Drawing.Size(364, 22); this.horizontalSeparator2.TabIndex = 177; - // - // AddTileForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + // + // EditTileForm + // this.ClientSize = new System.Drawing.Size(384, 521); this.Controls.Add(this.horizontalSeparator2); this.Controls.Add(this.horizontalSeparator1); @@ -339,7 +338,7 @@ namespace FizzyLauncher.Windows.Forms this.Controls.Add(this.label1); this.Controls.Add(this.textBox1); this.MinimumSize = new System.Drawing.Size(400, 560); - this.Name = "AddTileForm"; + this.Name = "EditTileForm"; this.Text = "Add Tile"; this.ResumeLayout(false); this.PerformLayout(); diff --git a/Windows/Forms/EditTileForm.resx b/Windows/Forms/EditTileForm.resx index 0fa2bef..0220ec4 100644 --- a/Windows/Forms/EditTileForm.resx +++ b/Windows/Forms/EditTileForm.resx @@ -61,7 +61,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAAK9JREFUOE/t0zsKwkAURuGp1BWJK3EhIrgAV+EOLLWwtRQLwQdiIbbiIkwynj+O + vgAADr4B6kKxwAAAAK9JREFUOE/t0zsKwkAURuGp1BWJK3EhIrgAV+EOLLWwtRQLwQdiIbbiIkwynj+O IVwnyhR2XvjyInNIkXHee8f0cEQBPbDOaKEarSvXhsAJO4wirlB4jipiA3phoIvIrLFChhnKiA3o8Ckw RR93LNBODVwwwRL62kNKYIxNzQ1FSsDOEHk08HrYJMw/8KtA06/cCef6KJDZgDbTFrHNZO3x9idqOyui m2+07bvPgHcPXOhtG3D6cUIAAAAASUVORK5CYII= @@ -70,7 +70,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAAMZJREFUOE/tk7sNwjAQQF3BRohJGAQhMQBTsAElFLSUiAKJTxIXhBZlCILNuyRG + vgAADr4B6kKxwAAAAMZJREFUOE/tk7sNwjAQQF3BRohJGAQhMQBTsAElFLSUiAKJTxIXhBZlCILNuyRG iXEQKeg46fmsO/slhU9Za5XWehiXYcD6JElygZ6qhdwTioVDGo4wDXDjsohXdYkvMDTHVa8R9Hb0tpCz XzqJL5Df/CRYRFE0Yn8nr9M07XcSwBXmXN6QDfncRTCjt6+Rgfla4Adfn3D+ERS4Yht/wY8FxVN2xTac gLP5qyYLAhmmA4SGyeeEoPkSq3EWydsoB4gRDEqBVU/p15ajstHKCgAAAABJRU5ErkJggg== @@ -79,7 +79,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wQAADsEBuJFr7QAAAJtJREFUOE/t0zEKwkAQheEpvILHSLySlTeJ6AnEzpPYi0ERPIKWKtZKNv9LNS5x + wAAADsABataJCQAAAJtJREFUOE/t0zEKwkAQheEpvILHSLySlTeJ6AnEzpPYi0ERPIKWKtZKNv9LNS5x E6xS+OCDJew8tsgYmeCECsGZo1dKXLBwtnghQ2fe0JDPGHecsW6xwgwjNM8tdIgyxQ0qij2gORV9LejK Bk8dfi3QjGY/C0IISS7/gkEVtP3KfbKEZm0PLZM++IVK0d0rdrAcR8TrnKK7BzPLa7Wb+WX/Nb8PAAAA AElFTkSuQmCC @@ -88,7 +88,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wQAADsEBuJFr7QAAALZJREFUOE/tkzEKwjAYRjt4BY9hvZKTN1HsCYqbJzGzKBGb9gY6qjgrxvdJK7ZS + wAAADsABataJCQAAALZJREFUOE/tkzEKwjAYRjt4BY9hvZKTN1HsCYqbJzGzKBGb9gY6qjgrxvdJK7ZS Gpwc/ODBnzTvg0AT5Xk+hB3cwVc456ZRSIqi2MAeafbGEq5Zlg3KY+1Bvkkql89Ya/vsnUCZN8FJYWyM 6ekKnsWkdF9hb8S3I6ioyRnkpa0FXcFbwOXrAjlyawXe+06q/At+qoDh41cOCU4iV8OaQY8pUVEgOnuA VcSzjRm2UHvOHeisdc7FDwDnJKIbLgP9AAAAAElFTkSuQmCC diff --git a/Windows/Forms/TileContainer.cs b/Windows/Forms/TileContainer.cs index 30a78df..5976040 100644 --- a/Windows/Forms/TileContainer.cs +++ b/Windows/Forms/TileContainer.cs @@ -86,35 +86,42 @@ namespace FizzyLauncher.Windows.Forms public int TileWidthCount { get; private set; } = DEFAULT_COLUMN; - public void Add(TilePanelLayout tilePanelLayout) - { - ThreadControl.Add(flowLayoutPanel1, tilePanelLayout); - } - public void Add() { - ThreadControl.Add(flowLayoutPanel1, new TilePanelLayout(new TileGroupModel() + this.Add(new TilePanelLayout(new TileGroupModel() { Title = "New Group", IsExpanded = true, - GridSize = new Size(6, 1) + GridSize = new Size(this.TileWidthCount, 1) })); - - this.TileWidthCount = Math.Max(this.TileWidthCount, 6); } - public void Clear(bool addDefault = false) + public void Add(TilePanelLayout tilePanelLayout) + { + ThreadControl.Add(flowLayoutPanel1, tilePanelLayout); + + this.InvalidateColumnSize(); + } + + public void Add(int columnCount) + { + this.TileWidthCount = ((columnCount <= 0) ? DEFAULT_COLUMN : columnCount); + + this.Add(); + } + + public void Clear() { ThreadControl.Clear(flowLayoutPanel1); this.TileWidthCount = DEFAULT_COLUMN; - if (addDefault) - { - this.Add(); - } + InvalidateColumnSize(); + } - ColumnSizeChanged(); + public void InvalidateColumnSize() + { + this.OnColumnSizeChanged?.Invoke(this, null); } public void Load(List groupList) @@ -135,14 +142,10 @@ namespace FizzyLauncher.Windows.Forms this.Add(panel); } - ColumnSizeChanged(); + InvalidateColumnSize(); } - protected void ColumnSizeChanged() - { - this.OnColumnSizeChanged?.Invoke(this, null); - } }