mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
fixed #696: Label auto copy bug workaround
This commit is contained in:
parent
8c6a9151f0
commit
cc68931c00
4 changed files with 64 additions and 2 deletions
|
@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
|
||||||
|
|
||||||
#endregion License Information (GPL v3)
|
#endregion License Information (GPL v3)
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Design;
|
using System.Drawing.Design;
|
||||||
|
@ -53,6 +54,7 @@ public override string Text
|
||||||
{
|
{
|
||||||
text = value;
|
text = value;
|
||||||
Refresh();
|
Refresh();
|
||||||
|
OnTextChanged(EventArgs.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
57
ShareX.HelpersLib/Controls/LabelNoCopy.cs
Normal file
57
ShareX.HelpersLib/Controls/LabelNoCopy.cs
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#region License Information (GPL v3)
|
||||||
|
|
||||||
|
/*
|
||||||
|
ShareX - A program that allows you to take screenshots and share any file type
|
||||||
|
Copyright © 2007-2015 ShareX Developers
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endregion License Information (GPL v3)
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace ShareX.HelpersLib
|
||||||
|
{
|
||||||
|
public class LabelNoCopy : Label
|
||||||
|
{
|
||||||
|
private string text;
|
||||||
|
|
||||||
|
public override string Text
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
value = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text != value)
|
||||||
|
{
|
||||||
|
text = value;
|
||||||
|
Refresh();
|
||||||
|
OnTextChanged(EventArgs.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -102,6 +102,9 @@
|
||||||
<Compile Include="Colors\HSB.cs" />
|
<Compile Include="Colors\HSB.cs" />
|
||||||
<Compile Include="Colors\MyColor.cs" />
|
<Compile Include="Colors\MyColor.cs" />
|
||||||
<Compile Include="Colors\RGBA.cs" />
|
<Compile Include="Colors\RGBA.cs" />
|
||||||
|
<Compile Include="Controls\LabelNoCopy.cs">
|
||||||
|
<SubType>Component</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Controls\ToolStripButtonColorAnimation.cs">
|
<Compile Include="Controls\ToolStripButtonColorAnimation.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -30,7 +30,7 @@ private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HotkeySelectionControl));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HotkeySelectionControl));
|
||||||
this.lblHotkeyStatus = new System.Windows.Forms.Label();
|
this.lblHotkeyStatus = new System.Windows.Forms.Label();
|
||||||
this.lblHotkeyDescription = new System.Windows.Forms.Label();
|
this.lblHotkeyDescription = new ShareX.HelpersLib.LabelNoCopy();
|
||||||
this.btnHotkey = new System.Windows.Forms.Button();
|
this.btnHotkey = new System.Windows.Forms.Button();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
|
@ -79,7 +79,7 @@ private void InitializeComponent()
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Label lblHotkeyStatus;
|
private System.Windows.Forms.Label lblHotkeyStatus;
|
||||||
private System.Windows.Forms.Label lblHotkeyDescription;
|
private ShareX.HelpersLib.LabelNoCopy lblHotkeyDescription;
|
||||||
private System.Windows.Forms.Button btnHotkey;
|
private System.Windows.Forms.Button btnHotkey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue