diff --git a/LinearAppLauncher.csproj b/LinearAppLauncher.csproj index 9acbc22..46d5330 100644 --- a/LinearAppLauncher.csproj +++ b/LinearAppLauncher.csproj @@ -149,11 +149,11 @@ TileGroupLabel.cs - + UserControl - - TileContainer.cs + + TileLayoutContainer.cs UserControl @@ -210,8 +210,8 @@ TileGroupLabel.cs - - TileContainer.cs + + TileLayoutContainer.cs TileLayoutPanel.cs diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 436d180..0b32b86 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -31,13 +31,13 @@ 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(); + this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.contextMenuStrip1.SuspendLayout(); this.SuspendLayout(); @@ -66,56 +66,58 @@ this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new System.Drawing.Size(100, 76); // - // toolStripSeparator1 + // toolStripMenuItem4 // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + this.toolStripMenuItem4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem2}); + this.toolStripMenuItem4.Name = "toolStripMenuItem4"; + this.toolStripMenuItem4.Size = new System.Drawing.Size(99, 22); + this.toolStripMenuItem4.Text = "&File"; // - // exitToolStripMenuItem + // toolStripMenuItem2 // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.exitToolStripMenuItem.Text = "E&xit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 59); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(600, 369); - this.flowLayoutPanel1.TabIndex = 27; - this.flowLayoutPanel1.WrapContents = false; + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(123, 22); + this.toolStripMenuItem2.Text = "&Save As..."; + this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); // // toolStripMenuItem3 // this.toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem1}); this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 22); + this.toolStripMenuItem3.Size = new System.Drawing.Size(99, 22); this.toolStripMenuItem3.Text = "&View"; // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.toolStripMenuItem1.Size = new System.Drawing.Size(152, 22); this.toolStripMenuItem1.Text = "Always On &Top"; this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click); // - // toolStripMenuItem4 + // toolStripSeparator1 // - this.toolStripMenuItem4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItem2}); - this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(180, 22); - this.toolStripMenuItem4.Text = "&File"; + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(96, 6); // - // toolStripMenuItem2 + // exitToolStripMenuItem // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22); - this.toolStripMenuItem2.Text = "&Save As..."; - this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(99, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.AutoScroll = true; + this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 59); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(600, 361); + this.flowLayoutPanel1.TabIndex = 27; + this.flowLayoutPanel1.WrapContents = false; // // saveFileDialog1 // diff --git a/MainForm.cs b/MainForm.cs index 675b10c..77fbd79 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -30,7 +30,6 @@ namespace AppLauncher loadSession(jsonfigFilename); } - this.Width = flowLayoutPanel1.Width + (flowLayoutPanel1.Left * 2); } public async Task ToggleSize() @@ -78,12 +77,12 @@ namespace AppLauncher List rs = new List(); for (int i = 0; i < flowLayoutPanel1.Controls.Count; i++) { - if (flowLayoutPanel1.Controls[i].GetType() != typeof(TileContainer)) + if (flowLayoutPanel1.Controls[i].GetType() != typeof(TileLayoutContainer)) { continue; } - TileContainer container = flowLayoutPanel1.Controls[i] as TileContainer; + TileLayoutContainer container = flowLayoutPanel1.Controls[i] as TileLayoutContainer; rs.Add(container.Model); } @@ -177,13 +176,16 @@ namespace AppLauncher foreach (TileGroupModel item in rs) { - TileContainer panel = new TileContainer(item); + TileLayoutContainer panel = new TileLayoutContainer(item); maxWidth = Math.Max(maxWidth, panel.Width); flowLayoutPanel1.Controls.Add(panel); } - flowLayoutPanel1.Width = maxWidth; + flowLayoutPanel1.Width = maxWidth + SystemInformation.VerticalScrollBarWidth; + + //this.Width = flowLayoutPanel1.Width + (flowLayoutPanel1.Left * 2); + this.Width = flowLayoutPanel1.Width + flowLayoutPanel1.Left; } } diff --git a/RyzStudio/Windows/ThemedForms/Button.cs b/RyzStudio/Windows/ThemedForms/Button.cs index e15b8de..dc40b99 100644 --- a/RyzStudio/Windows/ThemedForms/Button.cs +++ b/RyzStudio/Windows/ThemedForms/Button.cs @@ -1,6 +1,7 @@ namespace RyzStudio.Windows.ThemedForms { - using System; + using RyzStudio.Drawing; + using System; using System.ComponentModel; using System.Drawing; @@ -19,6 +20,7 @@ label1.MouseLeave += delegate { this.VisualState = ButtonState.Normal; }; label1.MouseDown += delegate { this.VisualState = ButtonState.Down; }; label1.MouseUp += delegate { this.VisualState = ButtonState.Normal; }; + } protected override void OnLoad(EventArgs e) @@ -31,9 +33,9 @@ this.StyleDefault = new ButtonStyle(Color.White, Color.Black, this.DefaultImage); this.VisualState = ButtonState.Normal; - } + } - protected ButtonState VisualState + protected ButtonState VisualState { get { return buttonState; } set @@ -71,9 +73,16 @@ label1.ForeColor = style.PenColour; label1.BackColor = style.BackColour; label1.Image = style.ForeImage; - } - [Browsable(true)] + //var rect = label1.ClientRectangle; + ////rect.Inflate(-3, -3); + //Rectangoid area = new Rectangoid(rect, 3, 1); + + //label1.Region = new Region(area.ToGraphicsPath()); + + } + + [Browsable(true)] [Category("Appearance")] public string LabelText { get => label1.Text; set => label1.Text = value; } diff --git a/RyzStudio/Windows/ThemedForms/UserControl.cs b/RyzStudio/Windows/ThemedForms/UserControl.cs index 9ca33c0..babfbde 100644 --- a/RyzStudio/Windows/ThemedForms/UserControl.cs +++ b/RyzStudio/Windows/ThemedForms/UserControl.cs @@ -28,12 +28,12 @@ base.OnPaintBackground(e); Graphics g = e.Graphics; - //// g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; - //// g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; - //// g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; - //// g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + //g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + //g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; + //g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; + //g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; - updateBackground(g, styleActive); + updateBackground(g, styleActive); } [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] diff --git a/Windows/Forms/Tile/EditGroupForm.cs b/Windows/Forms/Tile/EditGroupForm.cs index b3386d6..eecc3d3 100644 --- a/Windows/Forms/Tile/EditGroupForm.cs +++ b/Windows/Forms/Tile/EditGroupForm.cs @@ -11,7 +11,7 @@ namespace AppLauncher.Windows.Forms private Button button1; private PickerBox pickerBox1; private TextBox textBox1; - protected TileContainer parentContainer = null; + protected TileLayoutContainer parentContainer = null; public EditGroupForm() : base() { @@ -19,7 +19,7 @@ namespace AppLauncher.Windows.Forms initialiseComponents2(); } - public EditGroupForm(TileContainer container) : base() + public EditGroupForm(TileLayoutContainer container) : base() { parentContainer = container; @@ -162,7 +162,7 @@ namespace AppLauncher.Windows.Forms if (parentContainer != null) { textBox1.Text = parentContainer.Model.Title; - pickerBox1.ComboBox.SelectedIndex = (parentContainer.Model.IsExpanded ? 1 : 0); + pickerBox1.ComboBox.SelectedIndex = (parentContainer.Model.IsExclusive ? 1 : 0); } } diff --git a/Windows/Forms/Tile/TileGroupLabel.Designer.cs b/Windows/Forms/Tile/TileGroupLabel.Designer.cs index 498aff0..2c268d6 100644 --- a/Windows/Forms/Tile/TileGroupLabel.Designer.cs +++ b/Windows/Forms/Tile/TileGroupLabel.Designer.cs @@ -42,6 +42,7 @@ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -69,32 +70,33 @@ // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem2, + this.toolStripMenuItem5, this.toolStripMenuItem1, this.toolStripSeparator2, this.toolStripMenuItem4, this.toolStripSeparator1, this.toolStripMenuItem3}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(133, 104); + this.contextMenuStrip1.Size = new System.Drawing.Size(181, 148); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22); this.toolStripMenuItem2.Text = "&Add Group"; this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 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); + this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6); // // toolStripMenuItem4 // @@ -104,46 +106,46 @@ this.downToolStripMenuItem, this.bottomToolStripMenuItem}); this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem4.Size = new System.Drawing.Size(180, 22); this.toolStripMenuItem4.Text = "&Move"; // // topToolStripMenuItem // this.topToolStripMenuItem.Name = "topToolStripMenuItem"; - this.topToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + 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(180, 22); + 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(180, 22); + 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(180, 22); + 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); + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); // // toolStripMenuItem3 // this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(132, 22); + this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 22); this.toolStripMenuItem3.Text = "&Remove"; this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click); // @@ -167,6 +169,13 @@ this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick); this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseClick); // + // toolStripMenuItem5 + // + this.toolStripMenuItem5.Name = "toolStripMenuItem5"; + this.toolStripMenuItem5.Size = new System.Drawing.Size(180, 22); + this.toolStripMenuItem5.Text = "Add &Row"; + this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click); + // // TileGroupLabel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -199,5 +208,6 @@ private System.Windows.Forms.ToolStripMenuItem upToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem downToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem bottomToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5; } } diff --git a/Windows/Forms/Tile/TileGroupLabel.cs b/Windows/Forms/Tile/TileGroupLabel.cs index b0575d1..0566f6e 100644 --- a/Windows/Forms/Tile/TileGroupLabel.cs +++ b/Windows/Forms/Tile/TileGroupLabel.cs @@ -30,7 +30,7 @@ namespace AppLauncher.Windows.Forms } [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] - public TileContainer TileGroupPanel { get; set; } = null; + public TileLayoutContainer TileGroupPanel { get; set; } = null; protected void panel_MouseClick(object sender, MouseEventArgs e) { @@ -92,5 +92,10 @@ namespace AppLauncher.Windows.Forms if (this.TileGroupPanel != null) this.TileGroupPanel.Remove(); } + private void toolStripMenuItem5_Click(object sender, System.EventArgs e) + { + if (this.TileGroupPanel != null) this.TileGroupPanel.AddRow(); + } + } } \ No newline at end of file diff --git a/Windows/Forms/Tile/TileContainer.Designer.cs b/Windows/Forms/Tile/TileLayoutContainer.Designer.cs similarity index 99% rename from Windows/Forms/Tile/TileContainer.Designer.cs rename to Windows/Forms/Tile/TileLayoutContainer.Designer.cs index 9ae6583..a311414 100644 --- a/Windows/Forms/Tile/TileContainer.Designer.cs +++ b/Windows/Forms/Tile/TileLayoutContainer.Designer.cs @@ -1,6 +1,6 @@ namespace AppLauncher.Windows.Forms { - partial class TileContainer + partial class TileLayoutContainer { /// /// Required designer variable. diff --git a/Windows/Forms/Tile/TileContainer.cs b/Windows/Forms/Tile/TileLayoutContainer.cs similarity index 95% rename from Windows/Forms/Tile/TileContainer.cs rename to Windows/Forms/Tile/TileLayoutContainer.cs index e3285c5..35d240a 100644 --- a/Windows/Forms/Tile/TileContainer.cs +++ b/Windows/Forms/Tile/TileLayoutContainer.cs @@ -8,14 +8,14 @@ using System.Windows.Forms; namespace AppLauncher.Windows.Forms { - public partial class TileContainer : AUserControl + public partial class TileLayoutContainer : AUserControl { protected int collapseIncrement = 6; protected int expandIncrement = 8; protected TileGroupModel groupInfo = null; protected bool isAnimating = false; - public TileContainer(TileGroupModel model) : base() + public TileLayoutContainer(TileGroupModel model) : base() { InitializeComponent(); @@ -200,13 +200,18 @@ namespace AppLauncher.Windows.Forms return; } - this.FlowLayoutPanel.Controls.Add(new TileContainer(new TileGroupModel() + this.FlowLayoutPanel.Controls.Add(new TileLayoutContainer(new TileGroupModel() { Title = "New Group", GridSize = new Size(8, 1) })); } + public void AddRow() + { + panel1.SetGridSize(groupInfo.GridSize.Width, (groupInfo.GridSize.Height + 1)); + } + public void EditGroup() { EditGroupForm editForm = new EditGroupForm(this); @@ -220,6 +225,7 @@ namespace AppLauncher.Windows.Forms label1.TitleText = groupInfo.Title; panel1.SetGridSize(groupInfo.GridSize.Width, groupInfo.GridSize.Height); this.Width = panel1.Width; + label1.Checked = groupInfo.IsExpanded; if (loadTiles) diff --git a/Windows/Forms/Tile/TileContainer.resx b/Windows/Forms/Tile/TileLayoutContainer.resx similarity index 100% rename from Windows/Forms/Tile/TileContainer.resx rename to Windows/Forms/Tile/TileLayoutContainer.resx diff --git a/Windows/Forms/Tile/TileLayoutPanel.cs b/Windows/Forms/Tile/TileLayoutPanel.cs index 73f99e8..d3de5be 100644 --- a/Windows/Forms/Tile/TileLayoutPanel.cs +++ b/Windows/Forms/Tile/TileLayoutPanel.cs @@ -30,7 +30,7 @@ namespace AppLauncher.Windows.Forms InitializeComponent(); this.AllowDrop = true; - this.BackColor = System.Drawing.Color.Transparent; + this.BackColor = Color.Transparent; } private void InitializeComponent() @@ -63,7 +63,7 @@ namespace AppLauncher.Windows.Forms } } - public TileContainer TileContainer + public TileLayoutContainer TileContainer { get { @@ -72,12 +72,12 @@ namespace AppLauncher.Windows.Forms return null; } - if (this.Parent.GetType() != typeof(TileContainer)) + if (this.Parent.GetType() != typeof(TileLayoutContainer)) { return null; } - return (TileContainer)this.Parent; + return (TileLayoutContainer)this.Parent; } }