Hide buttons when list is not empty

This commit is contained in:
Jaex 2017-10-10 11:53:33 +03:00
parent b01e7aa0ef
commit 80ee274263
6 changed files with 13 additions and 9 deletions

View file

@ -2254,7 +2254,6 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem tsmiHideColumns;
private System.Windows.Forms.ToolStripMenuItem tsmiTextCapture;
private System.Windows.Forms.ToolStripMenuItem tsmiTrayTextCapture;
private System.Windows.Forms.FlowLayoutPanel flpPatreon;
private System.Windows.Forms.PictureBox pbPatreonOpen;
private System.Windows.Forms.PictureBox pbPatreonHide;
private System.Windows.Forms.ToolTip ttMain;
@ -2278,9 +2277,10 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem tsmiCopyMarkdownImage;
private System.Windows.Forms.ToolStripMenuItem tsmiCopyMarkdownLinkedImage;
private System.Windows.Forms.ToolStripSeparator tssCopy6;
private System.Windows.Forms.FlowLayoutPanel flpCommunity;
private System.Windows.Forms.FlowLayoutPanel flpDiscord;
private System.Windows.Forms.PictureBox pbDiscordOpen;
private System.Windows.Forms.PictureBox pbDiscordHide;
public System.Windows.Forms.FlowLayoutPanel flpCommunity;
public System.Windows.Forms.FlowLayoutPanel flpPatreon;
public System.Windows.Forms.FlowLayoutPanel flpDiscord;
}
}

View file

@ -203,9 +203,7 @@ public void UpdateControls()
niTray.Visible = Program.Settings.ShowTray;
flpPatreon.Visible = Program.Settings.ShowPatreonButton;
flpDiscord.Visible = Program.Settings.ShowDiscordButton;
TaskManager.UpdateMainFormTip();
TaskManager.RecentManager.InitItems();
bool isPositionChanged = false;

View file

@ -297,6 +297,9 @@
<data name="flpPatreon.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>567, 17</value>
</metadata>
<data name="pbPatreonOpen.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
@ -312,9 +315,6 @@
<data name="pbPatreonOpen.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>567, 17</value>
</metadata>
<data name="pbPatreonOpen.ToolTip" xml:space="preserve">
<value>Open ShareX Patreon campaign web page</value>
</data>
@ -1746,6 +1746,9 @@
<metadata name="timerTraySingleClick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>405, 17</value>
</metadata>
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>567, 17</value>
</metadata>
<data name="pbDiscordOpen.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -134,6 +134,9 @@ public static void StopAllTasks()
public static void UpdateMainFormTip()
{
Program.MainForm.lblMainFormTip.Visible = Program.Settings.ShowMainWindowTip && Tasks.Count == 0;
Program.MainForm.flpCommunity.Visible = Tasks.Count == 0 && (Program.Settings.ShowDiscordButton || Program.Settings.ShowPatreonButton);
Program.MainForm.flpDiscord.Visible = Program.Settings.ShowDiscordButton;
Program.MainForm.flpPatreon.Visible = Program.Settings.ShowPatreonButton;
}
private static ListViewItem FindListViewItem(WorkerTask task)