mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Screen color picker top most false when color picker stopped
This commit is contained in:
parent
d9be353b7b
commit
ebc1d10b40
5 changed files with 14 additions and 95 deletions
|
@ -1,43 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Greenshot", "Greenshot.csproj", "{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotPlugin", "..\GreenshotPlugin\GreenshotPlugin.csproj", "{5B924697-4DCD-4F98-85F1-105CB84B7341}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|x86.Build.0 = Debug|x86
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|x86.ActiveCfg = Release|x86
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|x86.ActiveCfg = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
using System;
|
||||
using System.Resources;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using Greenshot.Configuration;
|
||||
using System.Diagnostics;
|
||||
|
||||
|
||||
namespace Greenshot
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of Language.
|
||||
/// </summary>
|
||||
public class Language
|
||||
{
|
||||
private ResourceManager rm;
|
||||
private static Language uniqueInstance;
|
||||
private Language() {
|
||||
rm = new ResourceManager("Greenshot.UI", System.Reflection.Assembly.GetExecutingAssembly());
|
||||
SetLanguage(AppConfig.GetInstance().Ui_Language);
|
||||
}
|
||||
|
||||
public static Language GetInstance() {
|
||||
if(uniqueInstance == null) {
|
||||
uniqueInstance = new Language();
|
||||
}
|
||||
return uniqueInstance;
|
||||
|
||||
}
|
||||
public void SetLanguage(string cultureInfo) {
|
||||
Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureInfo);
|
||||
}
|
||||
public string GetString(string id) {
|
||||
string s = rm.GetString(id);
|
||||
return (s != null) ? s : "string ###"+id+"### not found";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -116,7 +116,6 @@
|
|||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="History.ico" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\ShareX_Icon.ico" />
|
||||
</ItemGroup>
|
||||
|
|
3
ShareX/Forms/ScreenColorPicker.Designer.cs
generated
3
ShareX/Forms/ScreenColorPicker.Designer.cs
generated
|
@ -133,7 +133,8 @@ private void InitializeComponent()
|
|||
this.Controls.Add(this.lblX);
|
||||
this.KeyPreview = true;
|
||||
this.Name = "ScreenColorPicker";
|
||||
this.Text = "ShareX - Screen color picker (You can double click any field to copy its value)";
|
||||
this.Text = "ShareX - Screen color picker";
|
||||
this.TopMost = false;
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ScreenColorPicker_KeyDown);
|
||||
this.Controls.SetChildIndex(this.txtHex, 0);
|
||||
this.Controls.SetChildIndex(this.colorPicker, 0);
|
||||
|
|
|
@ -52,8 +52,8 @@ public ScreenColorPicker(TaskSettings taskSettings)
|
|||
InitializeComponent();
|
||||
colorPicker.DrawCrosshair = true;
|
||||
colorTimer.Tick += colorTimer_Tick;
|
||||
colorTimer.Start();
|
||||
UpdateColorPickerButtonText();
|
||||
|
||||
UpdateControls(true);
|
||||
|
||||
foreach (Control control in Controls)
|
||||
{
|
||||
|
@ -95,9 +95,11 @@ private void UpdateColor(int x, int y, Color color)
|
|||
colorPicker.ChangeColor(color);
|
||||
}
|
||||
|
||||
private void UpdateColorPickerButtonText()
|
||||
private void UpdateControls(bool colorTimerEnable)
|
||||
{
|
||||
if (colorTimer.Enabled)
|
||||
colorTimer.Enabled = colorTimerEnable;
|
||||
|
||||
if (colorTimerEnable)
|
||||
{
|
||||
btnColorPicker.Text = "Stop screen color picker";
|
||||
}
|
||||
|
@ -106,21 +108,21 @@ private void UpdateColorPickerButtonText()
|
|||
btnColorPicker.Text = "Start screen color picker";
|
||||
}
|
||||
|
||||
lblScreenColorPickerTip.Visible = colorTimer.Enabled;
|
||||
lblScreenColorPickerTip.Visible = colorTimerEnable;
|
||||
|
||||
TopMost = colorTimerEnable;
|
||||
}
|
||||
|
||||
private void btnColorPicker_Click(object sender, EventArgs e)
|
||||
{
|
||||
colorTimer.Enabled = !colorTimer.Enabled;
|
||||
UpdateColorPickerButtonText();
|
||||
UpdateControls(!colorTimer.Enabled);
|
||||
}
|
||||
|
||||
private void btnPipette_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
colorTimer.Enabled = false;
|
||||
UpdateColorPickerButtonText();
|
||||
UpdateControls(false);
|
||||
|
||||
Hide();
|
||||
Thread.Sleep(100);
|
||||
|
@ -156,8 +158,7 @@ private void ScreenColorPicker_KeyDown(object sender, KeyEventArgs e)
|
|||
if (e.KeyCode == Keys.ControlKey && !txtHex.Focused)
|
||||
{
|
||||
btnColorPicker.Focus();
|
||||
colorTimer.Enabled = !colorTimer.Enabled;
|
||||
UpdateColorPickerButtonText();
|
||||
UpdateControls(!colorTimer.Enabled);
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue