diff --git a/README.md b/README.md index c43544eec..1f47983e3 100644 --- a/README.md +++ b/README.md @@ -21,4 +21,4 @@ Being easy to understand and configurable, Greenshot is an efficient tool for pr About this repository --------------------- -This repository is for Greenshot 1.3, currently in development, but is the next planed release +This repository is for Greenshot 1.3, currently in development, but is the next planned release diff --git a/installer/innosetup/setup.iss b/installer/innosetup/setup.iss index ef2a2fc50..449cf2014 100644 --- a/installer/innosetup/setup.iss +++ b/installer/innosetup/setup.iss @@ -169,20 +169,20 @@ Root: HKLM; Subkey: Software\Classes\Greenshot; ValueType: none; ValueName: {#Ex ; Create the startup entries if requested to do so ; HKEY_LOCAL_USER - for current user only -Root: HKCU; Subkey: Software\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: {#ExeName}; ValueData: {app}\{#ExeName}.exe; Permissions: users-modify; Flags: uninsdeletevalue noerror; Tasks: startup; Check: IsRegularUser +Root: HKCU; Subkey: Software\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: {#ExeName}; ValueData: """{app}\{#ExeName}.exe"""; Permissions: users-modify; Flags: uninsdeletevalue noerror; Tasks: startup; Check: IsRegularUser ; HKEY_LOCAL_MACHINE - for all users when admin -Root: HKLM; Subkey: Software\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: {#ExeName}; ValueData: {app}\{#ExeName}.exe; Permissions: admins-modify; Flags: uninsdeletevalue noerror; Tasks: startup; Check: not IsRegularUser +Root: HKLM; Subkey: Software\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: {#ExeName}; ValueData: """{app}\{#ExeName}.exe"""; Permissions: admins-modify; Flags: uninsdeletevalue noerror; Tasks: startup; Check: not IsRegularUser ; Register our own filetype for all users ; HKEY_LOCAL_USER - for current user only Root: HKCU; Subkey: Software\Classes\.greenshot; ValueType: string; ValueName: ""; ValueData: "Greenshot"; Permissions: users-modify; Flags: uninsdeletevalue noerror; Check: IsRegularUser Root: HKCU; Subkey: Software\Classes\Greenshot; ValueType: string; ValueName: ""; ValueData: "Greenshot File"; Permissions: users-modify; Flags: uninsdeletevalue noerror; Check: IsRegularUser -Root: HKCU; Subkey: Software\Classes\Greenshot\DefaultIcon; ValueType: string; ValueName: ""; ValueData: "{app}\Greenshot.EXE,0"; Permissions: users-modify; Flags: uninsdeletevalue noerror; Check: IsRegularUser +Root: HKCU; Subkey: Software\Classes\Greenshot\DefaultIcon; ValueType: string; ValueName: ""; ValueData: """{app}\Greenshot.EXE,0"""; Permissions: users-modify; Flags: uninsdeletevalue noerror; Check: IsRegularUser Root: HKCU; Subkey: Software\Classes\Greenshot\shell\open\command; ValueType: string; ValueName: ""; ValueData: """{app}\Greenshot.EXE"" --openfile ""%1"""; Permissions: users-modify; Flags: uninsdeletevalue noerror; Check: IsRegularUser ; HKEY_LOCAL_MACHINE - for all users when admin Root: HKLM; Subkey: Software\Classes\.greenshot; ValueType: string; ValueName: ""; ValueData: "Greenshot"; Permissions: admins-modify; Flags: uninsdeletevalue noerror; Check: not IsRegularUser Root: HKLM; Subkey: Software\Classes\Greenshot; ValueType: string; ValueName: ""; ValueData: "Greenshot File"; Permissions: admins-modify; Flags: uninsdeletevalue noerror; Check: not IsRegularUser -Root: HKLM; Subkey: Software\Classes\Greenshot\DefaultIcon; ValueType: string; ValueName: ""; ValueData: "{app}\Greenshot.EXE,0"; Permissions: admins-modify; Flags: uninsdeletevalue noerror; Check: not IsRegularUser +Root: HKLM; Subkey: Software\Classes\Greenshot\DefaultIcon; ValueType: string; ValueName: ""; ValueData: """{app}\Greenshot.EXE,0"""; Permissions: admins-modify; Flags: uninsdeletevalue noerror; Check: not IsRegularUser Root: HKLM; Subkey: Software\Classes\Greenshot\shell\open\command; ValueType: string; ValueName: ""; ValueData: """{app}\Greenshot.EXE"" --openfile ""%1"""; Permissions: admins-modify; Flags: uninsdeletevalue noerror; Check: not IsRegularUser [Icons] @@ -215,7 +215,7 @@ Name: startup; Description: {cm:startup} dexfranconia=Frängisch (Deutsch) arSY=العربية caCA=Català -csCZ=Ceština +csCZ=Čeština daDK=Dansk elGR=ελληνικά esES=Español diff --git a/src/Directory.Build.props b/src/Directory.Build.props index f19f03423..b6533ddd7 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -6,8 +6,7 @@ https://github.com/greenshot/greenshot git https://github.com/greenshot/greenshot - https://www.gnu.org/licenses/gpl.html - GPL + GPL-3.0-only 9 true true @@ -47,11 +46,11 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Greenshot.Base/Controls/AnimatingForm.cs b/src/Greenshot.Base/Controls/AnimatingForm.cs index 60d5e7ce9..cde3997ae 100644 --- a/src/Greenshot.Base/Controls/AnimatingForm.cs +++ b/src/Greenshot.Base/Controls/AnimatingForm.cs @@ -21,8 +21,6 @@ using System; using System.Windows.Forms; -using Greenshot.Base.UnmanagedHelpers; -using Greenshot.Base.UnmanagedHelpers.Enums; using log4net; namespace Greenshot.Base.Controls @@ -104,6 +102,10 @@ namespace Greenshot.Base.Controls /// private void Timer_Tick(object sender, EventArgs e) { + if (!Visible) + { + return; + } try { Animate(); diff --git a/src/Greenshot.Base/Controls/GreenshotDoubleClickButton.cs b/src/Greenshot.Base/Controls/GreenshotDoubleClickButton.cs new file mode 100644 index 000000000..a70fff93c --- /dev/null +++ b/src/Greenshot.Base/Controls/GreenshotDoubleClickButton.cs @@ -0,0 +1,12 @@ +using System.Windows.Forms; + +namespace Greenshot.Base.Controls +{ + public class GreenshotDoubleClickButton : Button + { + public GreenshotDoubleClickButton() + { + SetStyle(ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, true); + } + } +} diff --git a/src/Greenshot.Base/Controls/GreenshotForm.cs b/src/Greenshot.Base/Controls/GreenshotForm.cs index 9393362e3..eff79e975 100644 --- a/src/Greenshot.Base/Controls/GreenshotForm.cs +++ b/src/Greenshot.Base/Controls/GreenshotForm.cs @@ -19,11 +19,14 @@ * along with this program. If not, see . */ -using System; -using System.Collections.Generic; + +#if DEBUG using System.ComponentModel; using System.ComponentModel.Design; using System.IO; +#endif +using System; +using System.Collections.Generic; using System.Reflection; using System.Windows.Forms; using Greenshot.Base.Core; @@ -40,24 +43,33 @@ namespace Greenshot.Base.Controls private static readonly ILog LOG = LogManager.GetLogger(typeof(GreenshotForm)); protected static CoreConfiguration coreConfiguration; private static readonly IDictionary reflectionCache = new Dictionary(); +#if DEBUG private IComponentChangeService m_changeService; private bool _isDesignModeLanguageSet; - private bool _applyLanguageManually; - private bool _storeFieldsManually; private IDictionary _designTimeControls; private IDictionary _designTimeToolStripItems; +#endif + private bool _applyLanguageManually; + private bool _storeFieldsManually; static GreenshotForm() { +#if DEBUG if (!IsInDesignMode) { +#endif coreConfiguration = IniConfig.GetIniSection(); +#if DEBUG } +#endif } +#if DEBUG [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] +#endif public string LanguageKey { get; set; } +#if DEBUG /// /// Used to check the designmode during a constructor /// @@ -71,6 +83,7 @@ namespace Greenshot.Base.Controls (Application.ExecutablePath.IndexOf("wdexpress.exe", StringComparison.OrdinalIgnoreCase) > -1)); } } +#endif protected bool ManualLanguageApply { @@ -89,6 +102,7 @@ namespace Greenshot.Base.Controls /// protected bool ToFront { get; set; } +#if DEBUG /// /// Code to initialize the language etc during design time /// @@ -106,19 +120,18 @@ namespace Greenshot.Base.Controls // this "type" Assembly currentAssembly = GetType().Assembly; - if (typeResService != null) - { - string assemblyPath = typeResService.GetPathOfAssembly(currentAssembly.GetName()); - string assemblyDirectory = Path.GetDirectoryName(assemblyPath); - if (assemblyDirectory != null && !Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\Greenshot\Languages\"))) - { - Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\..\Greenshot\Languages\")); - } + if (typeResService == null) return; - if (assemblyDirectory != null && !Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\Languages\"))) - { - Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\..\Languages\")); - } + string assemblyPath = typeResService.GetPathOfAssembly(currentAssembly.GetName()); + string assemblyDirectory = Path.GetDirectoryName(assemblyPath); + if (assemblyDirectory != null && !Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\Greenshot\Languages\"))) + { + Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\..\Greenshot\Languages\")); + } + + if (assemblyDirectory != null && !Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\Languages\"))) + { + Language.AddLanguageFilePath(Path.Combine(assemblyDirectory, @"..\..\..\Languages\")); } } catch (Exception ex) @@ -151,14 +164,17 @@ namespace Greenshot.Base.Controls base.OnPaint(e); } +#endif protected override void OnLoad(EventArgs e) { // Every GreenshotForm should have it's default icon // And it might not ne needed for a Tool Window, but still for the task manager / switcher it's important Icon = GreenshotResources.GetGreenshotIcon(); +#if DEBUG if (!DesignMode) { +#endif if (!_applyLanguageManually) { ApplyLanguage(); @@ -166,6 +182,7 @@ namespace Greenshot.Base.Controls FillFields(); base.OnLoad(e); +#if DEBUG } else { @@ -174,6 +191,7 @@ namespace Greenshot.Base.Controls base.OnLoad(e); ApplyLanguage(); } +#endif } /// @@ -207,6 +225,7 @@ namespace Greenshot.Base.Controls base.OnClosed(e); } +#if DEBUG /// /// This override allows the control to register event handlers for IComponentChangeService events /// at the time the control is sited, which happens only in design mode. @@ -322,6 +341,7 @@ namespace Greenshot.Base.Controls base.Dispose(disposing); } +#endif protected void ApplyLanguage(ToolStripItem applyTo, string languageKey) { @@ -454,7 +474,7 @@ namespace Greenshot.Base.Controls ApplyLanguage(applyToControl); } } - +#if DEBUG if (DesignMode) { foreach (Control designControl in _designTimeControls.Values) @@ -467,6 +487,7 @@ namespace Greenshot.Base.Controls ApplyLanguage(designToolStripItem); } } +#endif } finally { @@ -515,57 +536,55 @@ namespace Greenshot.Base.Controls { var controlObject = field.GetValue(this); IGreenshotConfigBindable configBindable = controlObject as IGreenshotConfigBindable; - if (!string.IsNullOrEmpty(configBindable?.SectionName) && !string.IsNullOrEmpty(configBindable.PropertyName)) + if (string.IsNullOrEmpty(configBindable?.SectionName) || string.IsNullOrEmpty(configBindable.PropertyName)) continue; + + IniSection section = IniConfig.GetIniSection(configBindable.SectionName); + if (section == null) continue; + + if (!section.Values.TryGetValue(configBindable.PropertyName, out var iniValue)) { - IniSection section = IniConfig.GetIniSection(configBindable.SectionName); - if (section != null) + LOG.DebugFormat("Wrong property '{0}' configured for field '{1}'", configBindable.PropertyName, field.Name); + continue; + } + + if (controlObject is CheckBox checkBox) + { + checkBox.Checked = (bool) iniValue.Value; + checkBox.Enabled = !iniValue.IsFixed; + continue; + } + + if (controlObject is RadioButton radíoButton) + { + radíoButton.Checked = (bool) iniValue.Value; + radíoButton.Enabled = !iniValue.IsFixed; + continue; + } + + if (controlObject is TextBox textBox) + { + if (controlObject is HotkeyControl hotkeyControl) { - if (!section.Values.TryGetValue(configBindable.PropertyName, out var iniValue)) + string hotkeyValue = (string) iniValue.Value; + if (!string.IsNullOrEmpty(hotkeyValue)) { - LOG.DebugFormat("Wrong property '{0}' configured for field '{1}'", configBindable.PropertyName, field.Name); - continue; + hotkeyControl.SetHotkey(hotkeyValue); + hotkeyControl.Enabled = !iniValue.IsFixed; } - if (controlObject is CheckBox checkBox) - { - checkBox.Checked = (bool) iniValue.Value; - checkBox.Enabled = !iniValue.IsFixed; - continue; - } - - if (controlObject is RadioButton radíoButton) - { - radíoButton.Checked = (bool) iniValue.Value; - radíoButton.Enabled = !iniValue.IsFixed; - continue; - } - - if (controlObject is TextBox textBox) - { - if (controlObject is HotkeyControl hotkeyControl) - { - string hotkeyValue = (string) iniValue.Value; - if (!string.IsNullOrEmpty(hotkeyValue)) - { - hotkeyControl.SetHotkey(hotkeyValue); - hotkeyControl.Enabled = !iniValue.IsFixed; - } - - continue; - } - - textBox.Text = iniValue.ToString(); - textBox.Enabled = !iniValue.IsFixed; - continue; - } - - if (controlObject is GreenshotComboBox comboxBox) - { - comboxBox.Populate(iniValue.ValueType); - comboxBox.SetValue((Enum) iniValue.Value); - comboxBox.Enabled = !iniValue.IsFixed; - } + continue; } + + textBox.Text = iniValue.ToString(); + textBox.Enabled = !iniValue.IsFixed; + continue; + } + + if (controlObject is GreenshotComboBox comboxBox) + { + comboxBox.Populate(iniValue.ValueType); + comboxBox.SetValue((Enum) iniValue.Value); + comboxBox.Enabled = !iniValue.IsFixed; } } @@ -587,50 +606,48 @@ namespace Greenshot.Base.Controls var controlObject = field.GetValue(this); IGreenshotConfigBindable configBindable = controlObject as IGreenshotConfigBindable; - if (!string.IsNullOrEmpty(configBindable?.SectionName) && !string.IsNullOrEmpty(configBindable.PropertyName)) + if (string.IsNullOrEmpty(configBindable?.SectionName) || string.IsNullOrEmpty(configBindable.PropertyName)) continue; + + IniSection section = IniConfig.GetIniSection(configBindable.SectionName); + if (section == null) continue; + + if (!section.Values.TryGetValue(configBindable.PropertyName, out var iniValue)) { - IniSection section = IniConfig.GetIniSection(configBindable.SectionName); - if (section != null) + continue; + } + + if (controlObject is CheckBox checkBox) + { + iniValue.Value = checkBox.Checked; + iniDirty = true; + continue; + } + + if (controlObject is RadioButton radioButton) + { + iniValue.Value = radioButton.Checked; + iniDirty = true; + continue; + } + + if (controlObject is TextBox textBox) + { + if (controlObject is HotkeyControl hotkeyControl) { - if (!section.Values.TryGetValue(configBindable.PropertyName, out var iniValue)) - { - continue; - } - - if (controlObject is CheckBox checkBox) - { - iniValue.Value = checkBox.Checked; - iniDirty = true; - continue; - } - - if (controlObject is RadioButton radioButton) - { - iniValue.Value = radioButton.Checked; - iniDirty = true; - continue; - } - - if (controlObject is TextBox textBox) - { - if (controlObject is HotkeyControl hotkeyControl) - { - iniValue.Value = hotkeyControl.ToString(); - iniDirty = true; - continue; - } - - iniValue.UseValueOrDefault(textBox.Text); - iniDirty = true; - continue; - } - - if (controlObject is GreenshotComboBox comboxBox) - { - iniValue.Value = comboxBox.GetSelectedEnum(); - iniDirty = true; - } + iniValue.Value = hotkeyControl.ToString(); + iniDirty = true; + continue; } + + iniValue.UseValueOrDefault(textBox.Text); + iniDirty = true; + continue; + } + + if (controlObject is GreenshotComboBox comboxBox) + { + iniValue.Value = comboxBox.GetSelectedEnum(); + iniDirty = true; } } diff --git a/src/Greenshot.Base/Core/CoreConfiguration.cs b/src/Greenshot.Base/Core/CoreConfiguration.cs index 9c1fbd913..4776a3985 100644 --- a/src/Greenshot.Base/Core/CoreConfiguration.cs +++ b/src/Greenshot.Base/Core/CoreConfiguration.cs @@ -24,6 +24,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.IO; +using System.Linq; using System.Reflection; using System.Windows.Forms; using Greenshot.Base.Core.Enums; @@ -386,7 +387,7 @@ namespace Greenshot.Base.Core /// public bool IsExperimentalFeatureEnabled(string experimentalFeature) { - return (ExperimentalFeatures != null && ExperimentalFeatures.Contains(experimentalFeature)); + return ExperimentalFeatures != null && ExperimentalFeatures.Contains(experimentalFeature); } /// @@ -398,17 +399,17 @@ namespace Greenshot.Base.Core { switch (property) { - case "PluginWhitelist": - case "PluginBacklist": + case nameof(ExcludePlugins): + case nameof(IncludePlugins): return new List(); - case "OutputFileAsFullpath": + case nameof(OutputFileAsFullpath): if (IniConfig.IsPortable) { return Path.Combine(Application.StartupPath, @"..\..\Documents\Pictures\Greenshots\dummy.png"); } return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "dummy.png"); - case "OutputFilePath": + case nameof(OutputFilePath): if (IniConfig.IsPortable) { string pafOutputFilePath = Path.Combine(Application.StartupPath, @"..\..\Documents\Pictures\Greenshots"); @@ -432,16 +433,16 @@ namespace Greenshot.Base.Core } return Environment.GetFolderPath(Environment.SpecialFolder.Desktop); - case "DWMBackgroundColor": + case nameof(DWMBackgroundColor): return Color.Transparent; - case "ActiveTitleFixes": + case nameof(ActiveTitleFixes): return new List { "Firefox", "IE", "Chrome" }; - case "TitleFixMatcher": + case nameof(TitleFixMatcher): return new Dictionary { { @@ -454,7 +455,7 @@ namespace Greenshot.Base.Core "Chrome", " - Google Chrome.*" } }; - case "TitleFixReplacer": + case nameof(TitleFixReplacer): return new Dictionary { { @@ -509,7 +510,7 @@ namespace Greenshot.Base.Core try { // Store version, this can be used later to fix settings after an update - LastSaveWithVersion = Assembly.GetEntryAssembly().GetName().Version.ToString(); + LastSaveWithVersion = Assembly.GetEntryAssembly()?.GetName().Version.ToString(); } catch { @@ -530,7 +531,7 @@ namespace Greenshot.Base.Core try { // Store version, this can be used later to fix settings after an update - LastSaveWithVersion = Assembly.GetEntryAssembly().GetName().Version.ToString(); + LastSaveWithVersion = Assembly.GetEntryAssembly()?.GetName().Version.ToString(); } catch { @@ -559,11 +560,6 @@ namespace Greenshot.Base.Core { ExcludeDestinations.Remove("OneNote"); } - else - { - // TODO: Remove with the release - ExcludeDestinations.Remove("OneNote"); - } } if (OutputDestinations == null) @@ -662,6 +658,16 @@ namespace Greenshot.Base.Core { WebRequestReadWriteTimeout = 100; } + + // Workaround for the Windows 11 clipboard issue found here: https://github.com/greenshot/greenshot/issues/348 + if (WindowsVersion.IsWindows11OrLater) + { + // If the format DIB is used, remove it and replace it with BITMAP. + if (ClipboardFormats.Contains(ClipboardFormat.DIB)) + { + ClipboardFormats = ClipboardFormats.Where(cf => cf != ClipboardFormat.DIB).Append(ClipboardFormat.BITMAP).ToList(); + } + } } /// diff --git a/src/Greenshot.Base/Core/DpiHelper.cs b/src/Greenshot.Base/Core/DpiHelper.cs index a9cbe9a34..d3c7e61b6 100644 --- a/src/Greenshot.Base/Core/DpiHelper.cs +++ b/src/Greenshot.Base/Core/DpiHelper.cs @@ -114,6 +114,10 @@ namespace Greenshot.Base.Core /// uint public static uint GetDpi(POINT location) { + if (!WindowsVersion.IsWindows81OrLater) + { + return DefaultScreenDpi; + } RECT rect = new RECT(location.X, location.Y, 1, 1); IntPtr hMonitor = User32.MonitorFromRect(ref rect, User32.MONITOR_DEFAULTTONEAREST); var result = GetDpiForMonitor(hMonitor, MonitorDpiType.EffectiveDpi, out var dpiX, out var dpiY); @@ -172,7 +176,7 @@ namespace Greenshot.Base.Core /// /// IntPtr /// uint with dpi - [DllImport("User32.dll")] + [DllImport("user32.dll")] private static extern uint GetDpiForWindow(IntPtr hWnd); /// @@ -193,7 +197,7 @@ namespace Greenshot.Base.Core /// Returns the system DPI. /// /// uint with the system DPI - [DllImport("User32.dll")] + [DllImport("user32.dll")] private static extern uint GetDpiForSystem(); } } \ No newline at end of file diff --git a/src/Greenshot.Base/Core/EnvironmentInfo.cs b/src/Greenshot.Base/Core/EnvironmentInfo.cs index 6bf0adc01..3452180fa 100644 --- a/src/Greenshot.Base/Core/EnvironmentInfo.cs +++ b/src/Greenshot.Base/Core/EnvironmentInfo.cs @@ -68,7 +68,15 @@ namespace Greenshot.Base.Core if (!string.IsNullOrEmpty(assemblyFileVersionAttribute?.Version)) { var assemblyFileVersion = new Version(assemblyFileVersionAttribute.Version); - greenshotVersion = assemblyFileVersion.ToString(3); + greenshotVersion = assemblyFileVersion.ToString(2); + try + { + greenshotVersion = assemblyFileVersion.ToString(3); + } + catch (Exception ex) + { + // Ignore + } } if (!shortVersion) diff --git a/src/Greenshot.Base/Core/WindowsVersion.cs b/src/Greenshot.Base/Core/WindowsVersion.cs index bf3af14ce..ca9e96d47 100644 --- a/src/Greenshot.Base/Core/WindowsVersion.cs +++ b/src/Greenshot.Base/Core/WindowsVersion.cs @@ -21,6 +21,12 @@ namespace Greenshot.Base.Core /// true if we are running on Windows 10 public static bool IsWindows10 { get; } = WinVersion.Major == 10; + /// + /// Test if the current OS is Windows 11 or later + /// + /// true if we are running on Windows 11 or later + public static bool IsWindows11OrLater { get; } = WinVersion.Major == 10 && WinVersion.Build >= 22000; + /// /// Test if the current OS is Windows 10 or later /// diff --git a/src/Greenshot.Base/Greenshot.Base.csproj b/src/Greenshot.Base/Greenshot.Base.csproj index c0bb88aff..958e14fcf 100644 --- a/src/Greenshot.Base/Greenshot.Base.csproj +++ b/src/Greenshot.Base/Greenshot.Base.csproj @@ -5,10 +5,10 @@ - - - - + + + + diff --git a/src/Greenshot.Base/IniFile/IniConfig.cs b/src/Greenshot.Base/IniFile/IniConfig.cs index 08bcd1217..cbe04e11b 100644 --- a/src/Greenshot.Base/IniFile/IniConfig.cs +++ b/src/Greenshot.Base/IniFile/IniConfig.cs @@ -137,7 +137,7 @@ namespace Greenshot.Base.IniFile { AssemblyProductAttribute[] assemblyProductAttributes = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false) as AssemblyProductAttribute[]; - if (assemblyProductAttributes != null && assemblyProductAttributes.Length > 0) + if (assemblyProductAttributes is { Length: > 0 }) { string productName = assemblyProductAttributes[0].Product; Log.InfoFormat("Using ProductName {0}", productName); diff --git a/src/Greenshot.Base/IniFile/IniSection.cs b/src/Greenshot.Base/IniFile/IniSection.cs index a55ffe504..73a02ee1e 100644 --- a/src/Greenshot.Base/IniFile/IniSection.cs +++ b/src/Greenshot.Base/IniFile/IniSection.cs @@ -143,7 +143,7 @@ namespace Greenshot.Base.IniFile IniPropertyAttribute iniPropertyAttribute = (IniPropertyAttribute) fieldInfo.GetCustomAttributes(typeof(IniPropertyAttribute), false)[0]; if (!Values.ContainsKey(iniPropertyAttribute.Name)) { - Values.Add(iniPropertyAttribute.Name, new IniValue(this, fieldInfo, iniPropertyAttribute)); + Values[iniPropertyAttribute.Name] = new IniValue(this, fieldInfo, iniPropertyAttribute); } } } @@ -155,7 +155,7 @@ namespace Greenshot.Base.IniFile if (!Values.ContainsKey(propertyInfo.Name)) { IniPropertyAttribute iniPropertyAttribute = (IniPropertyAttribute) propertyInfo.GetCustomAttributes(typeof(IniPropertyAttribute), false)[0]; - Values.Add(iniPropertyAttribute.Name, new IniValue(this, propertyInfo, iniPropertyAttribute)); + Values[iniPropertyAttribute.Name] = new IniValue(this, propertyInfo, iniPropertyAttribute); } } } diff --git a/src/Greenshot.Base/Interfaces/Drawing/Container.cs b/src/Greenshot.Base/Interfaces/Drawing/Container.cs index 7eb595fdf..4f653ac8a 100644 --- a/src/Greenshot.Base/Interfaces/Drawing/Container.cs +++ b/src/Greenshot.Base/Interfaces/Drawing/Container.cs @@ -111,6 +111,10 @@ namespace Greenshot.Base.Interfaces.Drawing bool HasIntersectingFilters(Rectangle clipRectangle); bool IntersectsWith(Rectangle clipRectangle); void Draw(Graphics g, Bitmap bitmap, RenderMode renderMode, Rectangle clipRectangle); + void SetForegroundColor(Color color); + void SetBackgroundColor(Color color); + int IncreaseLineThickness(int increaseBy); + bool FlipShadow(); void Invalidate(); void PullElementsToTop(IDrawableContainerList elements); bool CanPushDown(IDrawableContainerList elements); diff --git a/src/Greenshot.Base/Interfaces/ISurface.cs b/src/Greenshot.Base/Interfaces/ISurface.cs index 7b8d6884e..d5df7ff44 100644 --- a/src/Greenshot.Base/Interfaces/ISurface.cs +++ b/src/Greenshot.Base/Interfaces/ISurface.cs @@ -38,6 +38,10 @@ namespace Greenshot.Base.Interfaces event SurfaceMessageEventHandler SurfaceMessage; event SurfaceDrawingModeEventHandler DrawingModeChanged; event SurfaceElementEventHandler MovingElementChanged; + event SurfaceForegroundColorEventHandler ForegroundColorChanged; + event SurfaceBackgroundColorEventHandler BackgroundColorChanged; + event SurfaceLineThicknessEventHandler LineThicknessChanged; + event SurfaceShadowEventHandler ShadowChanged; /// /// Start value of the step-labels (counts) diff --git a/src/Greenshot.Base/Interfaces/SurfaceBackgroundColorEventArgs.cs b/src/Greenshot.Base/Interfaces/SurfaceBackgroundColorEventArgs.cs new file mode 100644 index 000000000..6972d52d0 --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceBackgroundColorEventArgs.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +using System; +using System.Drawing; + +namespace Greenshot.Base.Interfaces +{ + public class SurfaceBackgroundColorEventArgs : EventArgs + { + public Color Color { get; set; } + } +} \ No newline at end of file diff --git a/src/Greenshot.Base/Interfaces/SurfaceBackgroundColorEventHandler.cs b/src/Greenshot.Base/Interfaces/SurfaceBackgroundColorEventHandler.cs new file mode 100644 index 000000000..a2a93703b --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceBackgroundColorEventHandler.cs @@ -0,0 +1,25 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +namespace Greenshot.Base.Interfaces +{ + public delegate void SurfaceBackgroundColorEventHandler (object sender, SurfaceBackgroundColorEventArgs e); +} \ No newline at end of file diff --git a/src/Greenshot.Base/Interfaces/SurfaceForegroundColorEventArgs.cs b/src/Greenshot.Base/Interfaces/SurfaceForegroundColorEventArgs.cs new file mode 100644 index 000000000..00de9aec4 --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceForegroundColorEventArgs.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +using System; +using System.Drawing; + +namespace Greenshot.Base.Interfaces +{ + public class SurfaceForegroundColorEventArgs : EventArgs + { + public Color Color { get; set; } + } +} \ No newline at end of file diff --git a/src/Greenshot.Base/Interfaces/SurfaceForegroundColorEventHandler.cs b/src/Greenshot.Base/Interfaces/SurfaceForegroundColorEventHandler.cs new file mode 100644 index 000000000..9c62cee2d --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceForegroundColorEventHandler.cs @@ -0,0 +1,25 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +namespace Greenshot.Base.Interfaces +{ + public delegate void SurfaceForegroundColorEventHandler (object sender, SurfaceForegroundColorEventArgs e); +} \ No newline at end of file diff --git a/src/Greenshot.Base/Interfaces/SurfaceLineThicknessEventArgs.cs b/src/Greenshot.Base/Interfaces/SurfaceLineThicknessEventArgs.cs new file mode 100644 index 000000000..5fd5694ba --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceLineThicknessEventArgs.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +using System; +using System.Drawing; + +namespace Greenshot.Base.Interfaces +{ + public class SurfaceLineThicknessEventArgs : EventArgs + { + public int Thickness { get; set; } + } +} \ No newline at end of file diff --git a/src/Greenshot.Base/Interfaces/SurfaceLineThicknessEventHandler.cs b/src/Greenshot.Base/Interfaces/SurfaceLineThicknessEventHandler.cs new file mode 100644 index 000000000..9f8ac3ebe --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceLineThicknessEventHandler.cs @@ -0,0 +1,25 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +namespace Greenshot.Base.Interfaces +{ + public delegate void SurfaceLineThicknessEventHandler (object sender, SurfaceLineThicknessEventArgs e); +} \ No newline at end of file diff --git a/src/Greenshot.Base/Interfaces/SurfaceShadowEventArgs.cs b/src/Greenshot.Base/Interfaces/SurfaceShadowEventArgs.cs new file mode 100644 index 000000000..a7bd682b7 --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceShadowEventArgs.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +using System; +using System.Drawing; + +namespace Greenshot.Base.Interfaces +{ + public class SurfaceShadowEventArgs : EventArgs + { + public bool HasShadow { get; set; } + } +} \ No newline at end of file diff --git a/src/Greenshot.Base/Interfaces/SurfaceShadowEventHandler.cs b/src/Greenshot.Base/Interfaces/SurfaceShadowEventHandler.cs new file mode 100644 index 000000000..a303aea62 --- /dev/null +++ b/src/Greenshot.Base/Interfaces/SurfaceShadowEventHandler.cs @@ -0,0 +1,25 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: https://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * 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 1 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, see . + */ + +namespace Greenshot.Base.Interfaces +{ + public delegate void SurfaceShadowEventHandler (object sender, SurfaceShadowEventArgs e); +} \ No newline at end of file diff --git a/src/Greenshot.Base/UnmanagedHelpers/Enums/ExtendedWindowStyleFlags.cs b/src/Greenshot.Base/UnmanagedHelpers/Enums/ExtendedWindowStyleFlags.cs index cbd81219c..aaeb23fa9 100644 --- a/src/Greenshot.Base/UnmanagedHelpers/Enums/ExtendedWindowStyleFlags.cs +++ b/src/Greenshot.Base/UnmanagedHelpers/Enums/ExtendedWindowStyleFlags.cs @@ -28,9 +28,44 @@ namespace Greenshot.Base.UnmanagedHelpers.Enums [SuppressMessage("ReSharper", "InconsistentNaming")] public enum ExtendedWindowStyleFlags : uint { - WS_EX_TOOLWINDOW = 0x00000080, + WS_EX_DLGMODALFRAME = 0x00000001, + WS_EX_NOPARENTNOTIFY = 0x00000004, + WS_EX_TOPMOST = 0x00000008, + WS_EX_ACCEPTFILES = 0x00000010, + WS_EX_TRANSPARENT = 0x00000020, - WS_EX_NOREDIRECTIONBITMAP = - 0x00200000, //The window does not render to a redirection surface. This is for windows that do not have visible content or that use mechanisms other than surfaces to provide their visual. + //#if(WINVER >= 0x0400) + WS_EX_MDICHILD = 0x00000040, + WS_EX_TOOLWINDOW = 0x00000080, + WS_EX_WINDOWEDGE = 0x00000100, + WS_EX_CLIENTEDGE = 0x00000200, + WS_EX_CONTEXTHELP = 0x00000400, + + WS_EX_RIGHT = 0x00001000, + WS_EX_LEFT = 0x00000000, + WS_EX_RTLREADING = 0x00002000, + WS_EX_LTRREADING = 0x00000000, + WS_EX_LEFTSCROLLBAR = 0x00004000, + WS_EX_RIGHTSCROLLBAR = 0x00000000, + + WS_EX_CONTROLPARENT = 0x00010000, + WS_EX_STATICEDGE = 0x00020000, + WS_EX_APPWINDOW = 0x00040000, + + //WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE), + //WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST), + + WS_EX_LAYERED = 0x00080000, + WS_EX_NOINHERITLAYOUT = 0x00100000, // Disable inheritence of mirroring by children + WS_EX_NOREDIRECTIONBITMAP = 0x00200000, //The window does not render to a redirection surface. This is for windows that do not have visible content or that use mechanisms other than surfaces to provide their visual. + WS_EX_LAYOUTRTL = 0x00400000, // Right to left mirroring + /// + /// Paints all descendants of a window in bottom-to-top painting order using double-buffering. + /// Bottom-to-top painting order allows a descendent window to have translucency (alpha) and transparency (color-key) effects, but only if the descendent window also has the WS_EX_TRANSPARENT bit set. + /// Double-buffering allows the window and its descendents to be painted without flicker. + /// This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. + /// + WS_EX_COMPOSITED = 0x02000000, + WS_EX_NOACTIVATE = 0x08000000 // A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. } } \ No newline at end of file diff --git a/src/Greenshot.Base/UnmanagedHelpers/Enums/WindowStyleFlags.cs b/src/Greenshot.Base/UnmanagedHelpers/Enums/WindowStyleFlags.cs index 8c64ee09a..603e58196 100644 --- a/src/Greenshot.Base/UnmanagedHelpers/Enums/WindowStyleFlags.cs +++ b/src/Greenshot.Base/UnmanagedHelpers/Enums/WindowStyleFlags.cs @@ -29,8 +29,24 @@ namespace Greenshot.Base.UnmanagedHelpers.Enums /// [Flags] [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum WindowStyleFlags : long + public enum WindowStyleFlags : int { + //WS_OVERLAPPED = 0x00000000, + WS_POPUP = -2147483648, + WS_CHILD = 0x40000000, + WS_MINIMIZE = 0x20000000, WS_VISIBLE = 0x10000000, + WS_DISABLED = 0x08000000, + WS_CLIPSIBLINGS = 0x04000000, + WS_CLIPCHILDREN = 0x02000000, + WS_MAXIMIZE = 0x01000000, + WS_BORDER = 0x00800000, + WS_DLGFRAME = 0x00400000, + WS_VSCROLL = 0x00200000, + WS_HSCROLL = 0x00100000, + WS_SYSMENU = 0x00080000, + WS_THICKFRAME = 0x00040000, + WS_GROUP = 0x00020000, + WS_TABSTOP = 0x00010000 } } \ No newline at end of file diff --git a/src/Greenshot.Editor/Drawing/DrawableContainerList.cs b/src/Greenshot.Editor/Drawing/DrawableContainerList.cs index 9465d7779..a7ed4f75b 100644 --- a/src/Greenshot.Editor/Drawing/DrawableContainerList.cs +++ b/src/Greenshot.Editor/Drawing/DrawableContainerList.cs @@ -30,6 +30,7 @@ using Greenshot.Base.Core; using Greenshot.Base.Interfaces; using Greenshot.Base.Interfaces.Drawing; using Greenshot.Editor.Configuration; +using Greenshot.Editor.Drawing.Fields; using Greenshot.Editor.Forms; using Greenshot.Editor.Memento; @@ -430,6 +431,70 @@ namespace Greenshot.Editor.Drawing } } + public void SetForegroundColor(Color color) + { + var dcs = ToArray(); + var field = FieldType.LINE_COLOR; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; + + fh.SetFieldValue(field, color); + } + } + + public void SetBackgroundColor(Color color) + { + var dcs = ToArray(); + var field = FieldType.FILL_COLOR; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; + + fh.SetFieldValue(field, color); + } + } + + public int IncreaseLineThickness(int increaseBy) + { + var dcs = ToArray(); + var field = FieldType.LINE_THICKNESS; + var lastThickness = 0; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; + + var currentThickness = (int)fh.GetFieldValue(field); + var thickness = Math.Max(0, currentThickness + increaseBy); + fh.SetFieldValue(field, thickness); + lastThickness = thickness; + } + + return lastThickness; + } + + public bool FlipShadow() + { + var dcs = ToArray(); + var field = FieldType.SHADOW; + var lastShadow = false; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; + + var currentShadow = (bool)fh.GetFieldValue(field); + var shadow = !currentShadow; + fh.SetFieldValue(field, shadow); + lastShadow = shadow; + } + + return lastShadow; + } + /// /// Indicates whether the given list of elements can be pushed down, /// i.e. whether there is at least one unselected element lower in hierarchy diff --git a/src/Greenshot.Editor/Drawing/EllipseContainer.cs b/src/Greenshot.Editor/Drawing/EllipseContainer.cs index d2c854cb1..f7799ac71 100644 --- a/src/Greenshot.Editor/Drawing/EllipseContainer.cs +++ b/src/Greenshot.Editor/Drawing/EllipseContainer.cs @@ -22,6 +22,7 @@ using System; using System.Drawing; using System.Drawing.Drawing2D; +using System.Runtime.Serialization; using Greenshot.Base.Interfaces.Drawing; using Greenshot.Editor.Drawing.Fields; using Greenshot.Editor.Helpers; @@ -35,6 +36,17 @@ namespace Greenshot.Editor.Drawing public class EllipseContainer : DrawableContainer { public EllipseContainer(Surface parent) : base(parent) + { + Init(); + } + + protected override void OnDeserialized(StreamingContext streamingContext) + { + base.OnDeserialized(streamingContext); + Init(); + } + + private void Init() { CreateDefaultAdorners(); } diff --git a/src/Greenshot.Editor/Drawing/HighlightContainer.cs b/src/Greenshot.Editor/Drawing/HighlightContainer.cs index 3e104b85f..417725322 100644 --- a/src/Greenshot.Editor/Drawing/HighlightContainer.cs +++ b/src/Greenshot.Editor/Drawing/HighlightContainer.cs @@ -56,6 +56,7 @@ namespace Greenshot.Editor.Drawing { FieldChanged += HighlightContainer_OnFieldChanged; ConfigurePreparedFilters(); + CreateDefaultAdorners(); } protected void HighlightContainer_OnFieldChanged(object sender, FieldChangedEventArgs e) diff --git a/src/Greenshot.Editor/Drawing/Surface.cs b/src/Greenshot.Editor/Drawing/Surface.cs index 7fd7485d0..2f956d132 100644 --- a/src/Greenshot.Editor/Drawing/Surface.cs +++ b/src/Greenshot.Editor/Drawing/Surface.cs @@ -112,6 +112,38 @@ namespace Greenshot.Editor.Drawing remove => _surfaceMessage -= value; } + [NonSerialized] private SurfaceForegroundColorEventHandler _foregroundColorChanged; + + public event SurfaceForegroundColorEventHandler ForegroundColorChanged + { + add => _foregroundColorChanged += value; + remove => _foregroundColorChanged -= value; + } + + [NonSerialized] private SurfaceBackgroundColorEventHandler _backgroundColorChanged; + + public event SurfaceBackgroundColorEventHandler BackgroundColorChanged + { + add => _backgroundColorChanged += value; + remove => _backgroundColorChanged -= value; + } + + [NonSerialized] private SurfaceLineThicknessEventHandler _lineThicknessChanged; + + public event SurfaceLineThicknessEventHandler LineThicknessChanged + { + add => _lineThicknessChanged += value; + remove => _lineThicknessChanged -= value; + } + + [NonSerialized] private SurfaceShadowEventHandler _shadowChanged; + + public event SurfaceShadowEventHandler ShadowChanged + { + add => _shadowChanged += value; + remove => _shadowChanged -= value; + } + /// /// inUndoRedo makes sure we don't undo/redo while in a undo/redo action /// @@ -1060,6 +1092,74 @@ namespace Greenshot.Editor.Drawing } } + /// + /// Use to update UI when pressing a key to change the foreground color + /// + /// Who send + /// new color + public void UpdateForegroundColorEvent(object source, Color color) + { + if (_foregroundColorChanged != null) + { + var eventArgs = new SurfaceForegroundColorEventArgs + { + Color = color, + }; + _foregroundColorChanged(source, eventArgs); + } + } + + /// + /// Use to update UI when pressing a key to change the background color + /// + /// Who send + /// new color + public void UpdateBackgroundColorEvent(object source, Color color) + { + if (_lineThicknessChanged != null) + { + var eventArgs = new SurfaceBackgroundColorEventArgs + { + Color = color, + }; + _backgroundColorChanged(source, eventArgs); + } + } + + /// + /// Use to update UI when pressing a key to change the line thickness + /// + /// Who send + /// new thickness + public void UpdateLineThicknessEvent(object source, int thickness) + { + if (_lineThicknessChanged != null) + { + var eventArgs = new SurfaceLineThicknessEventArgs + { + Thickness = thickness, + }; + _lineThicknessChanged(source, eventArgs); + } + } + + /// + /// Use to update UI when pressing the key to show/hide the shadow + /// + /// Who send + /// has shadow + public void UpdateShadowEvent(object source, bool hasShadow) + { + if (_shadowChanged != null) + { + var eventArgs = new SurfaceShadowEventArgs + { + HasShadow = hasShadow, + }; + _shadowChanged(source, eventArgs); + } + } + /// /// Crop the surface /// @@ -2212,6 +2312,87 @@ namespace Greenshot.Editor.Drawing case Keys.Escape: ConfirmSelectedConfirmableElements(false); break; + case Keys.NumPad0: + SetSelectedElementColor(Color.Orange, true, shiftModifier); + break; + case Keys.NumPad1: + SetSelectedElementColor(Color.Red, true, shiftModifier); + break; + case Keys.NumPad2: + SetSelectedElementColor(Color.FromArgb(0,255,0), true, shiftModifier); // Color.Green is #008000 and not #00FF00 + break; + case Keys.NumPad3: + SetSelectedElementColor(Color.Blue, true, shiftModifier); + break; + case Keys.NumPad4: + SetSelectedElementColor(Color.Cyan, true, shiftModifier); + break; + case Keys.NumPad5: + SetSelectedElementColor(Color.Magenta, true, shiftModifier); + break; + case Keys.NumPad6: + SetSelectedElementColor(Color.Yellow, true, shiftModifier); + break; + case Keys.NumPad7: + SetSelectedElementColor(Color.Black, true, shiftModifier); + break; + case Keys.NumPad8: + SetSelectedElementColor(Color.Gray, true, shiftModifier); + break; + case Keys.NumPad9: + SetSelectedElementColor(Color.White, true, shiftModifier); + break; + case Keys.D0: + case Keys.D0 | Keys.Shift: + SetSelectedElementColor(shiftModifier ? Color.Orange : Color.Transparent, false, shiftModifier); + break; + case Keys.D1: + case Keys.D1 | Keys.Shift: + SetSelectedElementColor(Color.Red, false, shiftModifier); + break; + case Keys.D2: + case Keys.D2 | Keys.Shift: + SetSelectedElementColor(Color.Green, false, shiftModifier); + break; + case Keys.D3: + case Keys.D3 | Keys.Shift: + SetSelectedElementColor(Color.Blue, false, shiftModifier); + break; + case Keys.D4: + case Keys.D4 | Keys.Shift: + SetSelectedElementColor(Color.Cyan, false, shiftModifier); + break; + case Keys.D5: + case Keys.D5 | Keys.Shift: + SetSelectedElementColor(Color.Magenta, false, shiftModifier); + break; + case Keys.D6: + case Keys.D6 | Keys.Shift: + SetSelectedElementColor(Color.Yellow, false, shiftModifier); + break; + case Keys.D7: + case Keys.D7 | Keys.Shift: + SetSelectedElementColor(Color.Black, false, shiftModifier); + break; + case Keys.D8: + case Keys.D8 | Keys.Shift: + SetSelectedElementColor(Color.Gray, false, shiftModifier); + break; + case Keys.D9: + case Keys.D9 | Keys.Shift: + SetSelectedElementColor(Color.White, false, shiftModifier); + break; + case Keys.Add: + case Keys.Add | Keys.Shift: + ChangeLineThickness(shiftModifier ? 5 : 1); + break; + case Keys.Subtract: + case Keys.Subtract | Keys.Shift: + ChangeLineThickness(shiftModifier ? -5 : -1); + break; + case Keys.Divide: + FlipShadow(); + break; /*case Keys.Delete: RemoveSelectedElements(); break;*/ @@ -2231,6 +2412,36 @@ namespace Greenshot.Editor.Drawing return false; } + // for laptops without numPads, also allow shift modifier + private void SetSelectedElementColor(Color color, bool numPad, bool shift) + { + if (numPad || shift) + { + selectedElements.SetForegroundColor(color); + UpdateForegroundColorEvent(this, color); + } + else + { + selectedElements.SetBackgroundColor(color); + UpdateBackgroundColorEvent(this, color); + } + selectedElements.Invalidate(); + } + + private void ChangeLineThickness(int increaseBy) + { + var newThickness = selectedElements.IncreaseLineThickness(increaseBy); + UpdateLineThicknessEvent(this, newThickness); + selectedElements.Invalidate(); + } + + private void FlipShadow() + { + var shadow = selectedElements.FlipShadow(); + UpdateShadowEvent(this, shadow); + selectedElements.Invalidate(); + } + /// /// Property for accessing the elements on the surface /// diff --git a/src/Greenshot.Editor/Forms/ColorDialog.cs b/src/Greenshot.Editor/Forms/ColorDialog.cs index 50211782f..ce8dd4b4c 100644 --- a/src/Greenshot.Editor/Forms/ColorDialog.cs +++ b/src/Greenshot.Editor/Forms/ColorDialog.cs @@ -21,10 +21,12 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Globalization; using System.Threading; using System.Windows.Forms; +using Greenshot.Base.Controls; using Greenshot.Base.IniFile; using Greenshot.Editor.Configuration; using Greenshot.Editor.Controls; @@ -114,7 +116,7 @@ namespace Greenshot.Editor.Forms private Button CreateColorButton(Color color, int x, int y, int w, int h) { - Button b = new Button + Button b = new GreenshotDoubleClickButton { BackColor = color, FlatStyle = FlatStyle.Flat, @@ -124,10 +126,17 @@ namespace Greenshot.Editor.Forms }; b.FlatAppearance.BorderSize = 0; b.Click += ColorButtonClick; - _toolTip.SetToolTip(b, ColorTranslator.ToHtml(color) + " | R:" + color.R + ", G:" + color.G + ", B:" + color.B); + b.DoubleClick += ColorButtonDoubleClick; + SetButtonTooltip(b, color); return b; } + private void ColorButtonDoubleClick(object sender, EventArgs e) + { + ColorButtonClick(sender, e); + BtnApplyClick(sender, e); + } + private void CreateLastUsedColorButtonRow(int x, int y, int w, int h) { for (int i = 0; i < 12; i++) @@ -147,6 +156,7 @@ namespace Greenshot.Editor.Forms { _recentColorButtons[i].BackColor = EditorConfig.RecentColors[i]; _recentColorButtons[i].Enabled = true; + SetButtonTooltip(_recentColorButtons[i], EditorConfig.RecentColors[i]); } } @@ -189,7 +199,7 @@ namespace Greenshot.Editor.Forms return; } - TextBox textBox = (TextBox) sender; + TextBox textBox = (TextBox)sender; string text = textBox.Text.Replace("#", string.Empty); Color c; if (int.TryParse(text, NumberStyles.AllowHexSpecifier, Thread.CurrentThread.CurrentCulture, out var i)) @@ -200,7 +210,7 @@ namespace Greenshot.Editor.Forms { try { - var knownColor = (KnownColor) Enum.Parse(typeof(KnownColor), text, true); + var knownColor = (KnownColor)Enum.Parse(typeof(KnownColor), text, true); c = Color.FromKnownColor(knownColor); } catch (Exception) @@ -220,7 +230,7 @@ namespace Greenshot.Editor.Forms return; } - TextBox textBox = (TextBox) sender; + TextBox textBox = (TextBox)sender; PreviewColor( Color.FromArgb(GetColorPartIntFromString(textBoxAlpha.Text), GetColorPartIntFromString(textBoxRed.Text), GetColorPartIntFromString(textBoxGreen.Text), GetColorPartIntFromString(textBoxBlue.Text)), textBox); @@ -241,10 +251,15 @@ namespace Greenshot.Editor.Forms private void ColorButtonClick(object sender, EventArgs e) { - Button b = (Button) sender; + Button b = (Button)sender; PreviewColor(b.BackColor, b); } + private void SetButtonTooltip(Button colorButton, Color color) + { + _toolTip.SetToolTip(colorButton, ColorTranslator.ToHtml(color) + " | R:" + color.R + ", G:" + color.G + ", B:" + color.B); + } + private void BtnTransparentClick(object sender, EventArgs e) { ColorButtonClick(sender, e); diff --git a/src/Greenshot.Editor/Forms/ImageEditorForm.cs b/src/Greenshot.Editor/Forms/ImageEditorForm.cs index ffbea1a8b..4cae6f8e5 100644 --- a/src/Greenshot.Editor/Forms/ImageEditorForm.cs +++ b/src/Greenshot.Editor/Forms/ImageEditorForm.cs @@ -230,6 +230,10 @@ namespace Greenshot.Editor.Forms _surface.DrawingModeChanged += Surface_DrawingModeChanged; _surface.SurfaceSizeChanged += SurfaceSizeChanged; _surface.SurfaceMessage += SurfaceMessageReceived; + _surface.ForegroundColorChanged += ForegroundColorChanged; + _surface.BackgroundColorChanged += BackgroundColorChanged; + _surface.LineThicknessChanged += LineThicknessChanged; + _surface.ShadowChanged += ShadowChanged; _surface.FieldAggregator.FieldChanged += FieldAggregatorFieldChanged; SurfaceSizeChanged(Surface, null); @@ -498,6 +502,46 @@ namespace Greenshot.Editor.Forms } } + /// + /// This is called when the foreground color of the select element chances, used for shortcuts + /// + /// + /// + private void ForegroundColorChanged(object sender, SurfaceForegroundColorEventArgs eventArgs) + { + btnLineColor.SelectedColor = eventArgs.Color; + } + + /// + /// This is called when the background color of the select element chances, used for shortcuts + /// + /// + /// + private void BackgroundColorChanged(object sender, SurfaceBackgroundColorEventArgs eventArgs) + { + btnFillColor.SelectedColor = eventArgs.Color; + } + + /// + /// This is called when the line thickness of the select element chances, used for shortcuts + /// + /// + /// + private void LineThicknessChanged(object sender, SurfaceLineThicknessEventArgs eventArgs) + { + lineThicknessUpDown.Value = eventArgs.Thickness; + } + + /// + /// This is called when the shadow of the select element chances, used for shortcuts + /// + /// + /// + private void ShadowChanged(object sender, SurfaceShadowEventArgs eventArgs) + { + shadowButton.Checked = eventArgs.HasShadow; + } + /// /// This is called when the size of the surface chances, used for resizing and displaying the size information /// @@ -995,7 +1039,7 @@ namespace Greenshot.Editor.Forms case Keys.G: // Grayscale Ctrl + G GrayscaleToolStripMenuItemClick(sender, e); break; - case Keys.Delete: // Grayscale Ctrl + Delete + case Keys.Delete: // Clear capture, use transparent background Ctrl + Delete ClearToolStripMenuItemClick(sender, e); break; case Keys.Oemcomma: // Rotate CCW Ctrl + , diff --git a/src/Greenshot.Editor/Memento/SurfaceBackgroundChangeMemento.cs b/src/Greenshot.Editor/Memento/SurfaceBackgroundChangeMemento.cs index 8bb9c229c..71d2e9f36 100644 --- a/src/Greenshot.Editor/Memento/SurfaceBackgroundChangeMemento.cs +++ b/src/Greenshot.Editor/Memento/SurfaceBackgroundChangeMemento.cs @@ -39,9 +39,12 @@ namespace Greenshot.Editor.Memento { _surface = surface; _image = surface.Image; - _matrix = matrix.Clone(); - // Make sure the reverse is applied - _matrix.Invert(); + if (matrix != null) + { + _matrix = matrix.Clone(); + // Make sure the reverse is applied + _matrix.Invert(); + } } public void Dispose() diff --git a/src/Greenshot.Plugin.Confluence/ConfluenceDestination.cs b/src/Greenshot.Plugin.Confluence/ConfluenceDestination.cs index 7f7a90f62..ddcb66530 100644 --- a/src/Greenshot.Plugin.Confluence/ConfluenceDestination.cs +++ b/src/Greenshot.Plugin.Confluence/ConfluenceDestination.cs @@ -51,7 +51,7 @@ namespace Greenshot.Plugin.Confluence IsInitialized = false; try { - Uri confluenceIconUri = new Uri("/GreenshotConfluencePlugin;component/Images/Confluence.ico", UriKind.Relative); + Uri confluenceIconUri = new Uri("/Greenshot.Plugin.Confluence;component/Images/Confluence.ico", UriKind.Relative); using (Stream iconStream = Application.GetResourceStream(confluenceIconUri)?.Stream) { // TODO: Check what to do with the IImage diff --git a/src/Greenshot.Plugin.Jira/Greenshot.Plugin.Jira.csproj b/src/Greenshot.Plugin.Jira/Greenshot.Plugin.Jira.csproj index a39835600..e75002ed7 100644 --- a/src/Greenshot.Plugin.Jira/Greenshot.Plugin.Jira.csproj +++ b/src/Greenshot.Plugin.Jira/Greenshot.Plugin.Jira.csproj @@ -6,7 +6,7 @@ - - + + \ No newline at end of file diff --git a/src/Greenshot.Plugin.Win10/Greenshot.Plugin.Win10.csproj b/src/Greenshot.Plugin.Win10/Greenshot.Plugin.Win10.csproj index 349b4d79e..c1c1729e0 100644 --- a/src/Greenshot.Plugin.Win10/Greenshot.Plugin.Win10.csproj +++ b/src/Greenshot.Plugin.Win10/Greenshot.Plugin.Win10.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/Greenshot/Forms/AboutForm.Designer.cs b/src/Greenshot/Forms/AboutForm.Designer.cs index fe22ee423..1dbdbdc2d 100644 --- a/src/Greenshot/Forms/AboutForm.Designer.cs +++ b/src/Greenshot/Forms/AboutForm.Designer.cs @@ -69,8 +69,10 @@ namespace Greenshot.Forms { // // lblTitle // - this.lblTitle.Font = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif, 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTitle.Location = new System.Drawing.Point(108, 12); + var fontsize = (this.DeviceDpi / 96) * lblTitle.Font.Size; + this.lblTitle.AutoSize = true; + this.lblTitle.Font = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif, fontsize, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblTitle.Location = new System.Drawing.Point(108, 12); this.lblTitle.Name = "lblTitle"; this.lblTitle.Size = new System.Drawing.Size(263, 19); this.lblTitle.TabIndex = 2; @@ -119,8 +121,9 @@ namespace Greenshot.Forms { this.linkLblBugs.Size = new System.Drawing.Size(465, 23); this.linkLblBugs.TabIndex = 8; this.linkLblBugs.TabStop = true; - this.linkLblBugs.Text = "https://getgreenshot.org/tickets/?version=" + EnvironmentInfo.GetGreenshotVersion(true); - this.linkLblBugs.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); + this.linkLblBugs.Text = "https://getgreenshot.org/tickets"; + this.linkLblBugs.Tag = "https://getgreenshot.org/tickets/?version=" + EnvironmentInfo.GetGreenshotVersion(true); + this.linkLblBugs.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); // // lblBugs // @@ -137,8 +140,9 @@ namespace Greenshot.Forms { this.linkLblDonations.Size = new System.Drawing.Size(465, 23); this.linkLblDonations.TabIndex = 10; this.linkLblDonations.TabStop = true; - this.linkLblDonations.Text = "https://getgreenshot.org/support/?version=" + EnvironmentInfo.GetGreenshotVersion(true); - this.linkLblDonations.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); + this.linkLblDonations.Text = "https://getgreenshot.org/support"; + this.linkLblDonations.Tag = "https://getgreenshot.org/support/?version=" + EnvironmentInfo.GetGreenshotVersion(true); + this.linkLblDonations.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); // // lblDonations // @@ -173,9 +177,10 @@ namespace Greenshot.Forms { this.linkLabel1.Size = new System.Drawing.Size(130, 23); this.linkLabel1.TabIndex = 13; this.linkLabel1.TabStop = true; - this.linkLabel1.Text = "https://getgreenshot.org/?version=" + EnvironmentInfo.GetGreenshotVersion(true); + this.linkLabel1.Text = "https://getgreenshot.org"; this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.TopRight; - this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); + this.linkLabel1.Tag = "https://getgreenshot.org/?version=" + EnvironmentInfo.GetGreenshotVersion(true); + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelClicked); // // pictureBox1 // @@ -197,10 +202,10 @@ namespace Greenshot.Forms { // // AboutForm // - //this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoScaleDimensions = new System.Drawing.SizeF(96, 96); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + //this.AutoScaleDimensions = new System.Drawing.SizeF(96, 96); + //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(530, 293); this.Controls.Add(this.lblTranslation); diff --git a/src/Greenshot/Forms/AboutForm.cs b/src/Greenshot/Forms/AboutForm.cs index a801cc63e..edb00a6ac 100644 --- a/src/Greenshot/Forms/AboutForm.cs +++ b/src/Greenshot/Forms/AboutForm.cs @@ -219,14 +219,15 @@ namespace Greenshot.Forms private void LinkLabelClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (!(sender is LinkLabel linkLabel)) return; + var link = linkLabel.Tag?.ToString() ?? linkLabel.Text; try { linkLabel.LinkVisited = true; - Process.Start(linkLabel.Text); + Process.Start(link); } catch (Exception) { - MessageBox.Show(Language.GetFormattedString(LangKey.error_openlink, linkLabel.Text), Language.GetString(LangKey.error)); + MessageBox.Show(Language.GetFormattedString(LangKey.error_openlink, link), Language.GetString(LangKey.error)); } } diff --git a/src/Greenshot/Forms/CaptureForm.cs b/src/Greenshot/Forms/CaptureForm.cs index 6176c732e..7be9c8d6a 100644 --- a/src/Greenshot/Forms/CaptureForm.cs +++ b/src/Greenshot/Forms/CaptureForm.cs @@ -36,6 +36,7 @@ using Greenshot.Base.IniFile; using Greenshot.Base.Interfaces; using Greenshot.Base.Interfaces.Ocr; using Greenshot.Base.UnmanagedHelpers; +using Greenshot.Base.UnmanagedHelpers.Enums; using Greenshot.Editor.Helpers; namespace Greenshot.Forms @@ -111,7 +112,8 @@ namespace Greenshot.Forms get { CreateParams createParams = base.CreateParams; - createParams.ExStyle |= 0x02000000; + createParams.ExStyle |= (int)ExtendedWindowStyleFlags.WS_EX_COMPOSITED; + createParams.Style = (int)WindowStyleFlags.WS_POPUP; return createParams; } } @@ -151,12 +153,9 @@ namespace Greenshot.Forms _currentForm = this; - // Enable the AnimatingForm - EnableAnimation = true; - // clean up FormClosed += ClosedHandler; - + Resize += CaptureForm_Resize; _capture = capture; _windows = windows; _captureMode = capture.CaptureDetails.CaptureMode; @@ -169,6 +168,8 @@ namespace Greenshot.Forms DoubleBuffered = !IsTerminalServerSession; Text = @"Greenshot capture form"; + SetSize(); + // Make sure we never capture the capture-form WindowDetails.RegisterIgnoreHandle(Handle); // Un-register at close @@ -186,8 +187,27 @@ namespace Greenshot.Forms // Set the zoomer animation InitializeZoomer(Conf.ZoomerEnabled); + // Enable the AnimatingForm + EnableAnimation = true; + } + + private void CaptureForm_Resize(object sender, EventArgs e) + { + Log.DebugFormat("Resize was called, new size: {0}", this.Bounds); + if (Bounds.Equals(_capture.ScreenBounds)) + { + // We have the correct size + return; + } + // Initiate resize + SetSize(); + } + + private void SetSize() + { + Log.DebugFormat("Setting CaptureForm with dimensions {0}", _capture.ScreenBounds); SuspendLayout(); - Bounds = capture.ScreenBounds; + Bounds = _capture.ScreenBounds; ResumeLayout(); // Fix missing focus @@ -200,15 +220,16 @@ namespace Greenshot.Forms /// private void InitializeZoomer(bool isOn) { + var startingPosition = new Rectangle(_cursorPos, Size.Empty); if (isOn) { // Initialize the zoom with a invalid position - _zoomAnimator = new RectangleAnimator(Rectangle.Empty, new Rectangle(int.MaxValue, int.MaxValue, 0, 0), FramesForMillis(1000), EasingType.Quintic, EasingMode.EaseOut); + _zoomAnimator = new RectangleAnimator( startingPosition , new Rectangle(int.MaxValue, int.MaxValue, 0, 0), FramesForMillis(1000), EasingType.Quintic, EasingMode.EaseOut); VerifyZoomAnimation(_cursorPos, false); } else { - _zoomAnimator?.ChangeDestination(new Rectangle(Point.Empty, Size.Empty), FramesForMillis(1000)); + _zoomAnimator?.ChangeDestination(startingPosition, FramesForMillis(1000)); } } diff --git a/src/Greenshot/Forms/MainForm.Designer.cs b/src/Greenshot/Forms/MainForm.Designer.cs index eed646231..015e0060b 100644 --- a/src/Greenshot/Forms/MainForm.Designer.cs +++ b/src/Greenshot/Forms/MainForm.Designer.cs @@ -223,7 +223,7 @@ namespace Greenshot.Forms { this.contextmenu_help.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_help.Image"))); this.contextmenu_help.Name = "contextmenu_help"; this.contextmenu_help.Size = new System.Drawing.Size(170, 22); - this.contextmenu_help.Click += new System.EventHandler(this.Contextmenu_helpClick); + this.contextmenu_help.Click += new System.EventHandler(this.Contextmenu_HelpClick); // // contextmenu_donate // @@ -248,7 +248,7 @@ namespace Greenshot.Forms { this.contextmenu_exit.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_exit.Image"))); this.contextmenu_exit.Name = "contextmenu_exit"; this.contextmenu_exit.Size = new System.Drawing.Size(170, 22); - this.contextmenu_exit.Click += new System.EventHandler(this.Contextmenu_exitClick); + this.contextmenu_exit.Click += new System.EventHandler(this.Contextmenu_ExitClick); // // notifyIcon // diff --git a/src/Greenshot/Forms/MainForm.cs b/src/Greenshot/Forms/MainForm.cs index f00174843..f1c4f8bbc 100644 --- a/src/Greenshot/Forms/MainForm.cs +++ b/src/Greenshot/Forms/MainForm.cs @@ -1122,12 +1122,18 @@ namespace Greenshot.Forms Rectangle allScreensBounds = WindowCapture.GetScreenBounds(); var captureScreenItem = new ToolStripMenuItem(Language.GetString(LangKey.contextmenu_capturefullscreen_all)); - captureScreenItem.Click += delegate { BeginInvoke((MethodInvoker) delegate { CaptureHelper.CaptureFullscreen(false, ScreenCaptureMode.FullScreen); }); }; + captureScreenItem.Click += delegate { + BeginInvoke((MethodInvoker) delegate { + CaptureHelper.CaptureFullscreen(false, ScreenCaptureMode.FullScreen); + }); + }; + captureScreenMenuItem.DropDownItems.Add(captureScreenItem); foreach (Screen screen in Screen.AllScreens) { Screen screenToCapture = screen; - string deviceAlignment = string.Empty; + string deviceAlignment = screenToCapture.DeviceName; + if (screen.Bounds.Top == allScreensBounds.Top && screen.Bounds.Bottom != allScreensBounds.Bottom) { deviceAlignment += " " + Language.GetString(LangKey.contextmenu_capturefullscreen_top); @@ -1147,7 +1153,13 @@ namespace Greenshot.Forms } captureScreenItem = new ToolStripMenuItem(deviceAlignment); - captureScreenItem.Click += delegate { BeginInvoke((MethodInvoker) delegate { CaptureHelper.CaptureRegion(false, screenToCapture.Bounds); }); }; + captureScreenItem.Click += delegate + { + BeginInvoke((MethodInvoker) delegate + { + CaptureHelper.CaptureRegion(false, screenToCapture.Bounds); + }); + }; captureScreenMenuItem.DropDownItems.Add(captureScreenItem); } } @@ -1426,7 +1438,7 @@ namespace Greenshot.Forms /// /// /// - private void Contextmenu_helpClick(object sender, EventArgs e) + private void Contextmenu_HelpClick(object sender, EventArgs e) { HelpFileLoader.LoadHelp(); } @@ -1436,7 +1448,7 @@ namespace Greenshot.Forms /// /// /// - private void Contextmenu_exitClick(object sender, EventArgs e) + private void Contextmenu_ExitClick(object sender, EventArgs e) { Exit(); } diff --git a/src/Greenshot/Forms/SettingsForm.Designer.cs b/src/Greenshot/Forms/SettingsForm.Designer.cs index 92eb61eef..e8f284850 100644 --- a/src/Greenshot/Forms/SettingsForm.Designer.cs +++ b/src/Greenshot/Forms/SettingsForm.Designer.cs @@ -1257,8 +1257,8 @@ namespace Greenshot.Forms { // // SettingsForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(451, 431); this.Controls.Add(this.tabcontrol); this.Controls.Add(this.settings_confirm); diff --git a/src/Greenshot/Forms/SettingsForm.cs b/src/Greenshot/Forms/SettingsForm.cs index 4ac354aca..7fecda8e2 100644 --- a/src/Greenshot/Forms/SettingsForm.cs +++ b/src/Greenshot/Forms/SettingsForm.cs @@ -94,6 +94,14 @@ namespace Greenshot.Forms // Changes for BUG-2077 numericUpDown_daysbetweencheck.ValueChanged += NumericUpDownDaysbetweencheckOnValueChanged; + // Expert mode, the clipboard formats + foreach (ClipboardFormat clipboardFormat in Enum.GetValues(typeof(ClipboardFormat))) + { + ListViewItem item = listview_clipboardformats.Items.Add(Language.Translate(clipboardFormat)); + item.Tag = clipboardFormat; + item.Checked = coreConfiguration.ClipboardFormats.Contains(clipboardFormat); + } + _daysBetweenCheckPreviousValue = (int) numericUpDown_daysbetweencheck.Value; DisplayPluginTab(); UpdateUi(); @@ -470,14 +478,6 @@ namespace Greenshot.Forms { colorButton_window_background.SelectedColor = coreConfiguration.DWMBackgroundColor; - // Expert mode, the clipboard formats - foreach (ClipboardFormat clipboardFormat in Enum.GetValues(typeof(ClipboardFormat))) - { - ListViewItem item = listview_clipboardformats.Items.Add(Language.Translate(clipboardFormat)); - item.Tag = clipboardFormat; - item.Checked = coreConfiguration.ClipboardFormats.Contains(clipboardFormat); - } - if (Language.CurrentLanguage != null) { combobox_language.SelectedValue = Language.CurrentLanguage; diff --git a/src/Greenshot/Greenshot.csproj b/src/Greenshot/Greenshot.csproj index 757714790..78fa3f6c6 100644 --- a/src/Greenshot/Greenshot.csproj +++ b/src/Greenshot/Greenshot.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Greenshot/Languages/installer/language-installer-zh-TW.xml b/src/Greenshot/Languages/installer/language-installer-zh-TW.xml new file mode 100644 index 000000000..3ab339773 --- /dev/null +++ b/src/Greenshot/Languages/installer/language-installer-zh-TW.xml @@ -0,0 +1,14 @@ + + + + 讓 {#ExeName} 隨 Windows 自動啟動 + 啟動 {#ExeName} + Jira 擴充功能 + Confluence 擴充功能 + 使用外部指令擴充功能開啟 + OCR 擴充功能 (需要 Microsoft Office Document Imaging (MODI)) + Imgur 擴充功能 (請見:https://imgur.com) + 其他語言 + 正在最佳化性能,這可能需要一點時間。 + + diff --git a/src/Greenshot/Languages/language-cs-CZ.xml b/src/Greenshot/Languages/language-cs-CZ.xml index c34389ebf..915fd3fe0 100644 --- a/src/Greenshot/Languages/language-cs-CZ.xml +++ b/src/Greenshot/Languages/language-cs-CZ.xml @@ -1,33 +1,34 @@ - + Chyby prosím hlaste na adrese Pokud se vám Greenshot líbí, uvítáme Vaší podporu - Greenshot je hostován na sourceforge.net + Greenshot je hostován na github.com Ikony pochází ze sady Yusuke Kamiyamane's Fugue (licence Creative Commons Attribution 3.0) Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot je ABSOLUTNĚ BEZ ZÁRUKY. Toto je svobodný software, můžete jej dále šířit za určitých podmínek. Podrobnosti o GNU General Public License: O programu Greenshot - Překlad: Zdeněk Chalupský <chalzd@gmail.com>. Korektura: Petr Toman + Překlad: Zdeněk Chalupský <chalzd@gmail.com>. Korektura: Petr Toman a Svatopluk Vít Greenshot - revoluční utilita pro snímání obrazovky Zavřít Omlouváme se, ale došlo k neočekávané chybě. + Dobrá zpráva: můžete nám pomoci odstranit chybu, když o ní podáte hlášení. Navštivte prosím níže uvedenou adresu, vytvořte nové hlášení o chybě a vložte popis chyby. Zadejte prosím smysluplné shrnutí a připojte informace, které považujete za užitečné pro popis hlášeného problému. Také bychom velmi ocenili, kdybyste zkontrolovali, zda tato chyba již není evidována. (Můžete použít rychlé vyhledávání.) Děkujeme :-) Chyba - Zrušit + Zrušit Neočekávaná chyba při zápisu do schránky. Greenshot nemohl zapsat data do schránky, je {0} blokován přístup. Obrázek ve schránce nebyl nalezen. Windows Bitmap - Zařízení Independent Bitmap (DIB) + Device Independent Bitmap (DIB) HTML HTML s vloženými obrázky - PNG + PNG Alfa Použít Modrá @@ -44,17 +45,17 @@ Také bychom velmi ocenili, kdybyste zkontrolovali, zda tato chyba již není ev Označit oblast snímání Otevřít obrázek ze schránky Zachytit celou obrazovku - vše - spodní - vlevo - vpravo - horní - Zachytávat aplikaci Internet Explorer + Vše + Spodní + Vlevo + Vpravo + Nahoře + Zachytávat aplikaci Internet Explorer Zachytit Internet Explorer ze seznamu - Zachycení poslední oblasti - Vybrat okno pro zachycení - Zachytit okno ze seznamu - Podpora pro Greenshot + Zachycení posledně snímané oblasti + Vybrat snímané okno + Snímat okno ze seznamu + Podpora Greenshotu Konec Nápověda Otevřít obrázek ze souboru @@ -70,22 +71,22 @@ Také bychom velmi ocenili, kdybyste zkontrolovali, zda tato chyba již není ev Vpravo Nahoře Vertikální zarovnání - Uspořádat + Uspořádat Tvar šipky Oba Koncový bod Žádný Počáteční bod - Automatické oříznutí + Automatické oříznutí Barva výplně Poloměr rozostření Tučné - Hranice + Okraj Jas Zrušit Chyba při přístupu do schránky. Zkuste to prosím znovu. Zavřít - Přejete si uložit snímek? + Chcete uložit snímek? Uložit snímek? Potvrdit Kopírovat obrázek do schránky @@ -99,15 +100,15 @@ Také bychom velmi ocenili, kdybyste zkontrolovali, zda tato chyba již není ev Úplně dolů Nakreslit šipku (A) Nakreslit elipsu (E) - Kreslení od ruky (F) + Kreslení od ruky (F) Zvýraznit (H) Nakreslit linku (L) Nakreslit obdélník (R) - Přidat textbox (T) + Přidat textový rámec (T) Duplikovat vybraný prvek Úpravy Efekty - E-Mail + E-mail Soubor Velikost Barva čáry @@ -120,20 +121,20 @@ Také bychom velmi ocenili, kdybyste zkontrolovali, zda tato chyba již není ev Vržený stín Obrázek uložen do {0}. Vložit okno - Invertovat - Italika + Invertovat + Skloněné Načíst objekty ze souboru Faktor zvětšení - Přizpůsobit velikosti snímku + Přizpůsobit velikosti snímku Zamlžit (O) Rozmazat Ztížení rozeznání obsahu Pixelizace Objekt - Otevřít složku v prohlížeči Windows + Otevřít složku v průzkumníkovi Windows Vložit Velikost pixelu - Náhled kvality + Kvalita náhledu Tisk Znovu {0} Obnovit velikost @@ -151,7 +152,7 @@ Také bychom velmi ocenili, kdybyste zkontrolovali, zda tato chyba již není ev Tloušťka linky Greenshot editor obrázků Potrhané okraje - Zpět {0} + Zpět {0} Nahoru o jednu úroveň Posunout úplně nahoru MAPI klient @@ -159,7 +160,7 @@ Také bychom velmi ocenili, kdybyste zkontrolovali, zda tato chyba již není ev Aplikace Outlook s prostým textem Chyba Program Greenshot je již spuštěn - Nelze uložit soubor do {0}. + Nelze uložit soubor do {0}. Zkontrolujte prosím dostupnost vybraného cíle. Soubor "{0}" nelze otevřít. Nelze otevřít odkaz. @@ -167,7 +168,7 @@ Zkontrolujte prosím dostupnost vybraného cíle. Vygenerovaný název souboru nebo složky není platný. Opravte prosím vzor názvu a zkuste to znovu. Expert Vytvořit 8bitový obrázek, pokud má méně než 256 barev - Kontrolovat nestabilní aktualizace + Kontrolovat aktualizace nestabilních verzí Formáty schránky Číslo pro ${NUM} ve vzoru pro název souboru Vím, co dělám! @@ -177,12 +178,12 @@ Zkontrolujte prosím dostupnost vybraného cíle. Znovu použít editor, je-li to možné Potlačit dialog Uložit při zavírání editoru Zobrazovat miniatury oken v kontextové nabídce (pro Vista a Windows 7) - Exportovat do: {0} + Exportovat do: {0} Došlo k chybě při exportu do{0}: Nápověda Greenshot - Klávesové zkratky - Vyberte nastavení kvality obrázku v JPEG formátu - Ok + Klávesové zkratky + Nastavte kvalitu obrázku v JPEG formátu + Ok Nastala chyba při pokusu o tisk. Centrovat obrázek na stránce Zvětšit oblast tisku, aby odpovídala velikosti papíru @@ -213,15 +214,15 @@ Zkontrolujte prosím dostupnost vybraného cíle. Cíl snímku Kopírovat do schránky Otevřít v editoru obrázků - E-Mail + E-mail Uložit přímo (pomocí nastavení níže) Uložit jako (zobrazit dialog) Vybrat cíl dynamicky Odeslat na tiskárnu - Editor + Editor Vzor pro název souboru Obecné - Snímek aplikace Internet Explorer + Snímek aplikace Internet Explorer Kvalita JPEG Jazyk Následující symboly budou automaticky nahrazeny: @@ -232,17 +233,20 @@ ${hh} hodina, 2 číslice ${mm} minuta, 2 číslice ${ss} sekunda, 2 číslice ${NUM} počítadlo, 6 číslic +${RRR...} náhodný alfanumerický znak, délka dle počtu použitých znaků R ${title} titulek okna ${user} uživatel Windows -${domain} doména Windows +${domain} doména Windows ${hostname} název počítače Složky také můžete vytvářet dynamicky pomocí zpětného lomítka (symbol \). -Například: ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss} vytvoří ve výchozím úložišti složku pro dnešní den, např. 2008-06-29, a název souboru snímku bude odvozen od aktuálního času, např. 11_58_32 (plus rozšíření uvedené v nastavení). - Síť a aktualizace +Například: ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss} +vytvoří ve výchozím úložišti složku pro dnešní den, např. 2008-06-29, a název souboru snímku bude odvozen od aktuálního času, +např. 11_58_32 (plus rozšíření uvedené v nastavení). + Síť a aktualizace Výstup - Přehrát zvuk uzávěrky fotoaparátu - Pluginy + Přehrát zvuk závěrky fotoaparátu + Zásuvné moduly Autor Cesta k DLL Název @@ -252,10 +256,10 @@ Například: ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss} vytvoří ve výchozím úlo Tisk Možnosti tisku Nastavení kvality - Snížit počet barev na maximálně 256 + Snížit počet barev na maximálně 256 Registrovat klávesové zkratky Použít blesk - Zobrazovat upozornění + Zobrazovat upozornění Zobrazit lupu Cíl Nastavení @@ -264,14 +268,14 @@ Například: ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss} vytvoří ve výchozím úlo Výchozí formát obrázku Definuje klávesové zkratky Prnt, Ctrl + Print, Alt + Prnt, které jsou vyhrazeny pro globální použití od startu do ukončení Greenshotu. Výchozí místo pro uložení snímků (ponechte prázdné pro uložení do počítače) - Použít výchozí systémovou proxy + Použít výchozí systémovou proxy Efekty Před zachycením počkat daný počet milisekund Režim zachycování okna - Snímek okna + Snímek okna Klikněte pravým tlačítkem myši nebo stiskněte klávesu PrtSc. - K dispozici je novější verze Greenshot! Přejete si stáhnout Greenshot {0}? - Počkejte prosím než bude zachycena stránka v aplikaci Internet Explorer... + K dispozici je novější verze aplikace Greenshot! Přejete si stáhnout Greenshot {0}? + Počkejte prosím než bude zachycena stránka v aplikaci Internet Explorer... Upozornění Klávesovou(é) zkratku(y) "{0}" nelze použít. Tento problém je pravděpodobně způsoben jiným programem používajícím tytéž klávesové zkratky! Můžete změnit nastavení klávesových zkratek, deaktivovat je nebo změnit nastavení softwaru využívajícího shodné klávesové zkratky. @@ -281,7 +285,7 @@ Všechny funkce Greenshotu jsou stále dostupné přímo z místní nabídky bez Automaticky Použít výchozí barvu Jak je zobrazeno - + Intenzita stínu Vyrovnání stínu @@ -298,7 +302,7 @@ Všechny funkce Greenshotu jsou stále dostupné přímo z místní nabídky bez Horní strana Dolní strana Vytvořit stín - + Přidat počítadlo (I) Přidat textovou bublinu (S) diff --git a/src/Greenshot/Languages/language-da-DK.xml b/src/Greenshot/Languages/language-da-DK.xml index 7e8b6c01a..166774d34 100644 --- a/src/Greenshot/Languages/language-da-DK.xml +++ b/src/Greenshot/Languages/language-da-DK.xml @@ -4,6 +4,7 @@ Dansk oversættelse af Jens Jacob Thomsen diff --git a/src/Greenshot/Languages/language-en-US.xml b/src/Greenshot/Languages/language-en-US.xml index 3db9fbf0e..b575f549b 100644 --- a/src/Greenshot/Languages/language-en-US.xml +++ b/src/Greenshot/Languages/language-en-US.xml @@ -78,7 +78,7 @@ Also, we would highly appreciate if you checked whether a tracker item already e None Start point Auto crop - Fill color + Fill color (0-9) Blur radius Bold Border @@ -111,7 +111,7 @@ Also, we would highly appreciate if you checked whether a tracker item already e E-Mail File Size - Line color + Line color (NumPad0-9, Shift+0-9) Grayscale Highlight area Grayscale @@ -147,7 +147,7 @@ Also, we would highly appreciate if you checked whether a tracker item already e Save as... Select all Print job was sent to '{0}'. - Drop shadow + Drop shadow (/) Image stored to clipboard. Line thickness Greenshot image editor diff --git a/src/Greenshot/Languages/language-nl-NL.xml b/src/Greenshot/Languages/language-nl-NL.xml index 507ece7dc..52e12a895 100644 --- a/src/Greenshot/Languages/language-nl-NL.xml +++ b/src/Greenshot/Languages/language-nl-NL.xml @@ -78,7 +78,7 @@ Controleer ook even of dit probleem mogelijk al gemeld is! Gebruik de zoekfuncti Geen Startpunt Automatisch bijsnijden - Vulkleur + Vulkleur (0-9) Vervagingsradius Vet Rand @@ -111,7 +111,7 @@ Controleer ook even of dit probleem mogelijk al gemeld is! Gebruik de zoekfuncti E-mail Bestand Grootte - Lijnkleur + Lijnkleur (NumPad0-9, Shift+0-9) Grijstinten Gebied markeren Grijstinten @@ -147,7 +147,7 @@ Controleer ook even of dit probleem mogelijk al gemeld is! Gebruik de zoekfuncti Opslaan als… Alles selecteren Afdruktaak verzonden naar '{0}'. - Schaduw + Schaduw (/) Afbeelding opgeslagen op het klembord. Lijndikte Greenshot beeldbewerker diff --git a/src/Greenshot/Languages/language-ro-RO.xml b/src/Greenshot/Languages/language-ro-RO.xml index 11f17a736..7e67ecb52 100644 --- a/src/Greenshot/Languages/language-ro-RO.xml +++ b/src/Greenshot/Languages/language-ro-RO.xml @@ -4,6 +4,7 @@ Traducere în limba română - Radu Mogoș diff --git a/src/Greenshot/Languages/language-zh-TW.xml b/src/Greenshot/Languages/language-zh-TW.xml index 590ec8f05..da3881d2c 100644 --- a/src/Greenshot/Languages/language-zh-TW.xml +++ b/src/Greenshot/Languages/language-zh-TW.xml @@ -1,14 +1,15 @@  - + 請回報錯誤到以下網址 如果您喜歡 Greenshot,歡迎您支持我們: Greenshot 的主機在 GitHub 網址是 圖片來源: Yusuke Kamiyamane's Fugue 圖示集 (Creative Commons Attribution 3.0 授權) Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom -Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您可以在 GNU General Public License 下任意散佈本軟體。 -關於GNU General Public License 詳細資料: +Greenshot 不對這個程式做任何擔保。這個程式是自由軟體,您可以在 GNU General Public License 下任意散佈本軟體。 +關於 GNU General Public License 詳細資料: 關於 Greenshot + Greenshot - 革命性的螢幕截圖工具 關閉 很抱歉,發生未預期錯誤。 @@ -24,7 +25,7 @@ Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您 Greenshot 無法將資料寫入剪貼簿,因為 {0} 已將剪貼簿鎖定。 找不到剪貼簿圖片。 Windows 點陣圖 - Device Independend Bitmap (DIB) + Device Independent Bitmap (DIB) HTML HTML 含內嵌圖像 PNG @@ -104,10 +105,6 @@ Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您 繪製直線 (L) 繪製矩形 (R) 加入文字方塊 (T) - 陰影黑暗 - 陰影偏移 - 陰影設定 - 陰影厚度 複製選取的元素 編輯 效果 @@ -155,12 +152,8 @@ Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您 直線粗細 Greenshot 圖片編輯器 撕裂邊緣 - 水平鋸齒範圍 - 撕裂邊緣設定 - 鋸齒大小 - 垂直鋸齒範圍 - 復原 {0} - 上移一層 + 復原 {0} + 上移一層 移到最上層 MAPI 用戶端 Outlook 使用 HTML @@ -172,12 +165,13 @@ Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您 無法開啟檔案「{0}」。 無法開啟連結「{0}」。 無法儲存螢幕擷圖,請尋找適合的位置。 + 產生的檔名或是路徑名稱無效。請修正檔名樣式並重試。 專家 在 > 8 位元圖像時,如果色彩小於 256 則建立 8 位元圖像 檢查 Beta 版更新 剪貼簿格式 檔案名稱樣式中 ${NUM} 的數字 - 我明白我所做的動作! + 我知道我在做什麼! 印表機頁尾樣式 最小化記憶體佔用空間,但降低效能 (不建議)。 進行使用遠端桌面的一些最佳化 @@ -188,7 +182,7 @@ Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您 匯出到 {0} 時發生錯誤: Greenshot 說明 熱鍵 - 請選擇圖片的 JPEG品質。 + 請選擇圖片的 JPEG 品質。 確定 嘗試列印時發生錯誤。 列印在紙張的正中央 @@ -231,7 +225,7 @@ Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您 Internet Explorer 擷取 JPEG 品質 語言 - 在樣式定義中以下預留位置將自動取代: + 在樣式定義中以下預留位置將自動取代: ${YYYY} 年,4 位數字 ${MM} 月,2 位數字 ${DD} 日,2 位數字 @@ -239,6 +233,7 @@ ${hh} 時,2 位數字 ${mm} 分,2 位數字 ${ss} 秒,2 位數字 ${NUM} 自動編號,6 位數字 +${RRR...} 隨機編號, 與 R 的長度相同 ${title} 視窗標題 ${user} Windows 使用者名稱 ${domain} Windows 網域名稱 @@ -278,7 +273,7 @@ ${hostname} 電腦名稱 視窗擷取 顯示放大鏡 右鍵按一下這裡或是按下 {0} 鍵。 - Greenshot 的新版本可以使用! 您要下載 Greenshot {0} 嗎? + Greenshot 的新版本可以使用! 您要下載 Greenshot {0} 嗎? 擷取 Internet Explorer 中頁面時請稍候... 警告 無法註冊熱鍵「{0}」。 這個問題可能是另一個工具要求使用相同的熱鍵。 您可以變更熱鍵設定或停用/變更軟體使用熱鍵。 @@ -289,5 +284,33 @@ Greenshot 所有功能仍然可以直接從通知區圖示的內容功能表動 自動 使用預設色彩 如顯示 + + + 陰影黑暗 + 陰影偏移 + 陰影設定 + 陰影厚度 + + 水平鋸齒範圍 + 撕裂邊緣設定 + 鋸齒大小 + 垂直鋸齒範圍 + 撕裂所有邊緣 + 左側 + 右側 + 上方 + 下方 + 產生陰影 + + 加入計數器 (I) + 加入對話框 (S) + + 縮放 + 縮放設定 + 維持長寬比 + 長度 + 寬度 + 圖示大小 + - \ No newline at end of file + diff --git a/src/Greenshot/Languages/website/language-website-en-US.xml b/src/Greenshot/Languages/website/language-website-en-US.xml index 45267679b..3920492ef 100644 --- a/src/Greenshot/Languages/website/language-website-en-US.xml +++ b/src/Greenshot/Languages/website/language-website-en-US.xml @@ -12,8 +12,8 @@ Quickly create screenshots of a selected region, window or fullscreen; you can even capture complete (scrolling) web pages from Internet Explorer. Easily annotate, highlight or obfuscate parts of the screenshot. Greenshot is a light-weight screenshot software tool for Windows with the following key features: - ...and a lot more options simplyfying creation of and work with screenshots every day. + ...and a lot more options simplifying creation of and work with screenshots every day. Export the screenshot in various ways: save to file, send to printer, copy to clipboard, attach to e-mail, send Office programs or upload to photo sites like Flickr or Picasa, and others. Being easy to understand and configurable, Greenshot is an efficient tool for project managers, software developers, technical writers, testers and anyone else creating screenshots. - \ No newline at end of file + diff --git a/src/Greenshot/Languages/website/language-website-zh-TW.xml b/src/Greenshot/Languages/website/language-website-zh-TW.xml new file mode 100644 index 000000000..f0427212a --- /dev/null +++ b/src/Greenshot/Languages/website/language-website-zh-TW.xml @@ -0,0 +1,19 @@ + + + + 下載 + Greenshot - 為生產力最佳化的免費截圖工具 + Greenshot 免費且開源 + 如果 Greenshot 為您節省了許多時間和/或金錢,歡迎 <a href="/support/">贊助</a> Greenshot 的開發。 + Greenshot 採用 <a href="https://zh.wikipedia.org/zh-tw/GNU通用公共许可证" target="_blank">GPL</a> 授權,這表示該軟體能夠免費下載使用,即使是在商業環境中。 + 想要了解更多嗎? + Greenshot 當然不只有這些功能而已。看看 Greenshot 的 <a title="Screenshots of Greenshot in action" href="/screenshots/">使用截圖</a>,或者試試 <a title="下載 Greenshot 的最新版本" href="/downloads/">Greenshot 的最新版本</a>。 + 什麼是 Greenshot???? + 快速擷取指定區域、視窗、或是全螢幕;您甚至可以在 Internet Explorer 中完整擷取整個網頁。 + 輕鬆地在截圖上作註解、醒目提示、及模糊區域。 + Greenshot 是輕量化的截圖軟體,專為 Windows 設計,並有以下重點功能: + ...還有更多功能幫助您簡化截圖流程。 + 以多種方式匯出截圖:儲存成檔案,傳送至印表機、複製到剪貼簿、作為附件傳送、傳送至 Office 程式、或是上傳到網路相簿,像是 Flickr 或 Picasa...等。 + 容易上手,又能客製化,對於專案經理、軟體開發者、技術寫作人員、測試人員以及其他需要經常截圖的工作者來說,Greenshot 絕對是幫助他們提升效率的好工具。 + + diff --git a/src/Greenshot/greenshot.manifest b/src/Greenshot/greenshot.manifest index 89cf7a2b6..fa9d5520d 100644 --- a/src/Greenshot/greenshot.manifest +++ b/src/Greenshot/greenshot.manifest @@ -16,7 +16,7 @@ - +