diff --git a/Source/TabControl/TabControl.cs b/Source/TabControl/TabControl.cs index b22075aa..ab3dd8b3 100644 --- a/Source/TabControl/TabControl.cs +++ b/Source/TabControl/TabControl.cs @@ -776,7 +776,7 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) bool isFirstTab = Items.IndexOf(currentItem) == 0; Font currentFont = Font; - if (currentItem == SelectedItem) + if (currentItem == SelectedItem) currentFont = new Font(Font, FontStyle.Bold); SizeF textSize = g.MeasureString(currentItem.Title, currentFont, new SizeF(200, 10), sf); @@ -785,7 +785,7 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) GraphicsPath path = new GraphicsPath(); LinearGradientBrush brush = null; - int mtop = 3; + int mtop = 2; #region Draw Not Right-To-Left Tab @@ -793,7 +793,7 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) { if (currentItem == SelectedItem || isFirstTab) { - path.AddLine(buttonRect.Left - 10, buttonRect.Bottom - 1, buttonRect.Left + (buttonRect.Height / 2) - 4, mtop + 4); + path.AddLine(buttonRect.Left - 10, buttonRect.Bottom - 0, buttonRect.Left + (buttonRect.Height / 2) - 4, mtop + 0); } else { @@ -803,11 +803,11 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) path.AddLine(buttonRect.Left + (buttonRect.Height / 2) + 2, mtop, buttonRect.Right - 3, mtop); path.AddLine(buttonRect.Right, mtop + 2, buttonRect.Right, buttonRect.Bottom - 1); - path.AddLine(buttonRect.Right - 4, buttonRect.Bottom - 1, buttonRect.Left, buttonRect.Bottom - 1); + path.AddLine(buttonRect.Right - 4, buttonRect.Bottom - 0, buttonRect.Left, buttonRect.Bottom - 0); path.CloseFigure(); try { if(currentItem == SelectedItem) { - brush = new LinearGradientBrush(buttonRect, SystemColors.ControlLightLight, SystemColors.Window, LinearGradientMode.Vertical); + brush = new LinearGradientBrush(buttonRect, SystemColors.GrayText, SystemColors.Window, LinearGradientMode.Vertical); } else { brush = new LinearGradientBrush(buttonRect, SystemColors.ControlLightLight, SystemColors.Control, LinearGradientMode.Vertical); } @@ -819,8 +819,9 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) if (currentItem == SelectedItem) { pen = new Pen(ToolStripRenderer.ColorTable.MenuStripGradientBegin); + g.DrawPath(pen, path); } - g.DrawPath(pen, path); + g.DrawPath(SystemPens.ControlDark, path); if (currentItem == SelectedItem) { pen.Dispose(); @@ -856,7 +857,7 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) { if (currentItem == SelectedItem || isFirstTab) { - path.AddLine(buttonRect.Right + 10, buttonRect.Bottom - 1, buttonRect.Right - (buttonRect.Height / 2) + 4, mtop + 4); + path.AddLine(buttonRect.Right + 10, buttonRect.Bottom - 0, buttonRect.Right - (buttonRect.Height / 2) + 4, mtop + 0); } else { @@ -866,12 +867,12 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) path.AddLine(buttonRect.Right - (buttonRect.Height / 2) - 2, mtop, buttonRect.Left + 3, mtop); path.AddLine(buttonRect.Left, mtop + 2, buttonRect.Left, buttonRect.Bottom - 1); - path.AddLine(buttonRect.Left + 4, buttonRect.Bottom - 1, buttonRect.Right, buttonRect.Bottom - 1); + path.AddLine(buttonRect.Left + 4, buttonRect.Bottom - 0, buttonRect.Right, buttonRect.Bottom - 0); path.CloseFigure(); if (currentItem == SelectedItem) { - brush = new LinearGradientBrush(buttonRect, SystemColors.ControlLightLight, SystemColors.Window, LinearGradientMode.Vertical); + brush = new LinearGradientBrush(buttonRect, SystemColors.GrayText, SystemColors.Window, LinearGradientMode.Vertical); } else { @@ -879,6 +880,12 @@ internal void OnDrawTabPage(Graphics g, TabControlItem currentItem) } g.FillPath(brush, path); + Pen pen = SystemPens.ControlDark; + if (currentItem == SelectedItem) + { + pen = new Pen(ToolStripRenderer.ColorTable.MenuStripGradientBegin); + g.DrawPath(pen, path); + } g.DrawPath(SystemPens.ControlDark, path); if (currentItem == SelectedItem) diff --git a/Source/Terminals/Forms/Controls/FavsList.Designer.cs b/Source/Terminals/Forms/Controls/FavsList.Designer.cs index d065f3b7..554770b5 100644 --- a/Source/Terminals/Forms/Controls/FavsList.Designer.cs +++ b/Source/Terminals/Forms/Controls/FavsList.Designer.cs @@ -242,6 +242,7 @@ private void InitializeComponent() // removeSelectedToolStripMenuItem // this.removeSelectedToolStripMenuItem.Image = global::Terminals.Properties.Resources.delete; + this.removeSelectedToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete; this.removeSelectedToolStripMenuItem.Name = "removeSelectedToolStripMenuItem"; this.removeSelectedToolStripMenuItem.Size = new System.Drawing.Size(243, 22); this.removeSelectedToolStripMenuItem.Text = "Delete"; @@ -250,6 +251,7 @@ private void InitializeComponent() // duplicateToolStripMenuItem // this.duplicateToolStripMenuItem.Name = "duplicateToolStripMenuItem"; + this.duplicateToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F9; this.duplicateToolStripMenuItem.Size = new System.Drawing.Size(243, 22); this.duplicateToolStripMenuItem.Text = "Duplicate"; this.duplicateToolStripMenuItem.ToolTipText = "Creates copy of first selected favorite including its group assignment"; @@ -267,6 +269,7 @@ private void InitializeComponent() // this.propertiesToolStripMenuItem.Image = global::Terminals.Properties.Resources.Properties; this.propertiesToolStripMenuItem.Name = "propertiesToolStripMenuItem"; + this.propertiesToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; this.propertiesToolStripMenuItem.Size = new System.Drawing.Size(243, 22); this.propertiesToolStripMenuItem.Text = "Properties"; this.propertiesToolStripMenuItem.ToolTipText = "Edit this favorite properties"; diff --git a/Source/Terminals/Forms/Controls/FavsList.cs b/Source/Terminals/Forms/Controls/FavsList.cs index 12617fdb..b398fdd4 100644 --- a/Source/Terminals/Forms/Controls/FavsList.cs +++ b/Source/Terminals/Forms/Controls/FavsList.cs @@ -397,7 +397,7 @@ private void DeleteAllFavoritesByTagToolStripMenuItem_Click(object sender, Event private void RemoveSelectedToolStripMenuItem_Click(object sender, EventArgs e) { IFavorite favorite = this.GetSelectedFavorite(); - if (favorite != null && OrganizeFavoritesForm.AskIfRealyDelete("favorite")) + if (favorite != null && OrganizeFavoritesForm.AskIfRealyDelete("favorite \n"+favorite.Name)) PersistedFavorites.Delete(favorite); } @@ -453,7 +453,8 @@ private void StartConnection(TreeView tv) if (favoriteNode != null && !tv.SelectedNode.IsEditing) { var definition = new ConnectionDefinition(favoriteNode.Favorite); - this.ConnectionsUiFactory.Connect(definition); + favoriteNode.Checked = true; + this.ConnectionsUiFactory.Connect(definition); tv.Parent.Focus(); } } @@ -530,11 +531,26 @@ private void FavsTree_KeyUp(object sender, KeyEventArgs e) switch (e.KeyCode) { case Keys.F2: + this.isRenaming = true; this.BeginRenameInFavsTree(); break; + case Keys.F1: + this.PropertiesToolStripMenuItem_Click(sender, e); + break; + case Keys.F9: + this.DuplicateToolStripMenuItem_Click(sender, e); + break; + case Keys.Delete: + this.RemoveSelectedToolStripMenuItem_Click(sender, e); + break; + case Keys.Insert: + this.CreateFavoriteToolStripMenuItem_Click(sender, e); + break; case Keys.Enter: - if (!this.isRenaming) - this.StartConnection(this.favsTree); + if (this.isRenaming) + { this.isRenaming = false; } + else + { this.StartConnection(this.favsTree); } break; } } @@ -558,6 +574,7 @@ private void FavsTree_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) if (string.IsNullOrEmpty(e.Label)) { e.CancelEdit = true; + this.isRenaming = true; return; } @@ -643,7 +660,7 @@ private void SheduleRename(IFavorite favorite, string newName) private void ApplyRename(IFavorite favorite, string newName) { this.renameCommand.ApplyRename(favorite, newName); - this.isRenaming = false; + //this.isRenaming = false; } private void SearchPanel_ResultListKeyUp(object sender, KeyEventArgs e) @@ -727,5 +744,7 @@ private void DisconnectToolStripMenuItem_Click(object sender, EventArgs e) this.CloseMenuStrips(); this.connectionCommands.Disconnect(); } + + } } diff --git a/Source/Terminals/Forms/EditFavorite/GeneralPropertiesUserControl.cs b/Source/Terminals/Forms/EditFavorite/GeneralPropertiesUserControl.cs index 42f1eb18..7851ac40 100644 --- a/Source/Terminals/Forms/EditFavorite/GeneralPropertiesUserControl.cs +++ b/Source/Terminals/Forms/EditFavorite/GeneralPropertiesUserControl.cs @@ -155,14 +155,15 @@ private void CmbServers_SelectedIndexChanged(object sender, EventArgs e) private void CmbServers_Leave(object sender, EventArgs e) { - if (this.txtName.Text == String.Empty) + + if (this.cmbServers.Text.Contains(":")) { - if (this.cmbServers.Text.Contains(":")) - { - this.FillServerName(this.cmbServers.Text); - } + this.FillServerName(this.cmbServers.Text); + } - this.txtName.Text = this.cmbServers.Text; + if (this.txtName.Text == String.Empty) + { + this.txtName.Text = this.cmbServers.Text; } } diff --git a/Source/Terminals/Forms/OrganizeFavoritesForm.cs b/Source/Terminals/Forms/OrganizeFavoritesForm.cs index cffc4c47..0dd534f1 100644 --- a/Source/Terminals/Forms/OrganizeFavoritesForm.cs +++ b/Source/Terminals/Forms/OrganizeFavoritesForm.cs @@ -260,9 +260,9 @@ private void DeleteSelectedFavorites() internal static bool AskIfRealyDelete(string target) { - string messsage = string.Format("Do your realy want to delete selected {0}?", target); + string messsage = string.Format("Do you really want to delete selected {0}?", target); return MessageBox.Show(messsage, "Terminals - Delete", - MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes; + MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes; } private void PerformDelete()