Fixes #1314 - hide elements until they are needed

Fixes #1314
This commit is contained in:
Sean Kaim
2019-02-24 19:26:50 -05:00
parent d3f3a14b1f
commit f14fd6bf5a
3 changed files with 16 additions and 3 deletions

View File

@@ -28,7 +28,11 @@ namespace mRemoteNG.Messages.MessageWriters
if (_messageWindow.lvErrorCollector.InvokeRequired)
_messageWindow.lvErrorCollector.Invoke((MethodInvoker)(() => AddToList(lvItem)));
else
{
_messageWindow.lvErrorCollector.Items.Insert(0, lvItem);
if (_messageWindow.lvErrorCollector.Items.Count > 0)
_messageWindow.pbError.Visible = true;
}
}
}
}

View File

@@ -1,4 +1,4 @@

namespace mRemoteNG.UI.Window
{
public partial class ErrorAndInfoWindow
@@ -16,7 +16,7 @@ namespace mRemoteNG.UI.Window
{
this.components = new System.ComponentModel.Container();
this.txtMsgText = new mRemoteNG.UI.Controls.Base.NGTextBox();
this.pbError = new Controls.Base.NGPictureBox();
this.pbError = new mRemoteNG.UI.Controls.Base.NGPictureBox(this.components);
this.lvErrorCollector = new System.Windows.Forms.ListView();
this.clmMessage = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.cMenMC = new System.Windows.Forms.ContextMenuStrip(this.components);
@@ -33,6 +33,7 @@ namespace mRemoteNG.UI.Window
// txtMsgText
//
this.txtMsgText.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtMsgText.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtMsgText.Location = new System.Drawing.Point(40, 19);
this.txtMsgText.Multiline = true;
this.txtMsgText.Name = "txtMsgText";
@@ -51,6 +52,7 @@ namespace mRemoteNG.UI.Window
this.pbError.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pbError.TabIndex = 0;
this.pbError.TabStop = false;
this.pbError.Visible = false;
//
// lvErrorCollector
//

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Drawing;
using System.Collections;
using System.Globalization;
@@ -296,6 +296,7 @@ namespace mRemoteNG.UI.Window
{
cMenMCCopy.Enabled = true;
cMenMCDelete.Enabled = true;
pbError.Visible = true;
}
else
{
@@ -387,6 +388,12 @@ namespace mRemoteNG.UI.Window
{
lvErrorCollector.Items.Clear();
}
if (lvErrorCollector.Items.Count == 0)
{
pbError.Visible = false;
txtMsgText.Visible = false;
}
}
catch (Exception ex)
{