diff --git a/NAPS2.Lib/Config/ToolbarButtons.cs b/NAPS2.Lib/Config/ToolbarButtons.cs index 560fa71587..5c73b4f2a0 100644 --- a/NAPS2.Lib/Config/ToolbarButtons.cs +++ b/NAPS2.Lib/Config/ToolbarButtons.cs @@ -9,18 +9,19 @@ public enum ToolbarButtons Profiles = 1 << 2, Ocr = 1 << 3, Import = 1 << 4, - SavePdf = 1 << 5, - SaveImages = 1 << 6, - EmailPdf = 1 << 7, - Print = 1 << 8, - Image = 1 << 9, - Rotate = 1 << 10, - Move = 1 << 11, - Reorder = 1 << 12, - Delete = 1 << 13, - Clear = 1 << 14, - Language = 1 << 15, - Settings = 1 << 16, - About = 1 << 17, - Donate = 1 << 18 + Squeeze = 1 << 5, + SavePdf = 1 << 6, + SaveImages = 1 << 7, + EmailPdf = 1 << 8, + Print = 1 << 9, + Image = 1 << 10, + Rotate = 1 << 11, + Move = 1 << 12, + Reorder = 1 << 13, + Delete = 1 << 14, + Clear = 1 << 15, + Language = 1 << 16, + Settings = 1 << 17, + About = 1 << 18, + Donate = 1 << 19 } \ No newline at end of file diff --git a/NAPS2.Lib/EtoForms/Desktop/DesktopController.cs b/NAPS2.Lib/EtoForms/Desktop/DesktopController.cs index 210ade92ec..9f06e6e1e6 100644 --- a/NAPS2.Lib/EtoForms/Desktop/DesktopController.cs +++ b/NAPS2.Lib/EtoForms/Desktop/DesktopController.cs @@ -535,6 +535,10 @@ public void Import() ImportFiles(fileNames!); } } + public void Squeeze() + { + + } public void Suspend() { diff --git a/NAPS2.Lib/EtoForms/Desktop/DesktopSubFormController.cs b/NAPS2.Lib/EtoForms/Desktop/DesktopSubFormController.cs index 1fc028266f..b3f845c4ae 100644 --- a/NAPS2.Lib/EtoForms/Desktop/DesktopSubFormController.cs +++ b/NAPS2.Lib/EtoForms/Desktop/DesktopSubFormController.cs @@ -110,4 +110,9 @@ public void ShowAboutForm() { _formFactory.Create().ShowModal(); } + //Squeeze Anpassung + public void ShowSqueezeSettingsForm() + { + _formFactory.Create().ShowModal(); + } } \ No newline at end of file diff --git a/NAPS2.Lib/EtoForms/Desktop/DesktopToolbarMenuType.cs b/NAPS2.Lib/EtoForms/Desktop/DesktopToolbarMenuType.cs index 76cd8e0557..24990c265d 100644 --- a/NAPS2.Lib/EtoForms/Desktop/DesktopToolbarMenuType.cs +++ b/NAPS2.Lib/EtoForms/Desktop/DesktopToolbarMenuType.cs @@ -5,5 +5,6 @@ public enum DesktopToolbarMenuType Scan, SavePdf, SaveImages, - EmailPdf + EmailPdf, + Squeeze } \ No newline at end of file diff --git a/NAPS2.Lib/EtoForms/Desktop/IDesktopSubFormController.cs b/NAPS2.Lib/EtoForms/Desktop/IDesktopSubFormController.cs index 9bb084c3c8..31fa3901b0 100644 --- a/NAPS2.Lib/EtoForms/Desktop/IDesktopSubFormController.cs +++ b/NAPS2.Lib/EtoForms/Desktop/IDesktopSubFormController.cs @@ -18,4 +18,5 @@ public interface IDesktopSubFormController void ShowEmailSettingsForm(); void ShowAboutForm(); void ShowSettingsForm(); + void ShowSqueezeSettingsForm(); } \ No newline at end of file diff --git a/NAPS2.Lib/EtoForms/Ui/DesktopCommands.cs b/NAPS2.Lib/EtoForms/Ui/DesktopCommands.cs index 218ddb4056..21bdb7caea 100644 --- a/NAPS2.Lib/EtoForms/Ui/DesktopCommands.cs +++ b/NAPS2.Lib/EtoForms/Ui/DesktopCommands.cs @@ -71,6 +71,25 @@ public DesktopCommands(DesktopController desktopController, DesktopScanControlle Image = iconProvider.GetIcon("folder_picture"), Shortcut = Application.Instance.CommonModifier | Keys.O }; + // Squeeze Icon Shortcut? + Squeeze = new ActionCommand(desktopController.Squeeze) + { + Text = UiStrings.Squeeze, + Image = iconProvider.GetIcon("inbox_out-white") + }; + SqueezeAll = new ActionCommand(_imageListActions.SelectAll) + { + Text = UiStrings.SqueezeAll + }; + SqueezeSelected = new ActionCommand(_imageListActions.SelectAll) + { + Text = UiStrings.SqueezeSelected + }; + SqueezeSettings = new ActionCommand(desktopSubFormController.ShowSqueezeSettingsForm) + { + Text = UiStrings.SqueezeSettings, + Image = iconProvider.GetIcon("cog_small") + }; SaveAll = new ActionCommand(_imageListActions.SaveAllAsPdfOrImages) { Text = UiStrings.SaveAll, @@ -337,6 +356,10 @@ public DesktopCommands WithSelection(Func> selectionFunc) public ActionCommand Profiles { get; set; } public ActionCommand Ocr { get; set; } public ActionCommand Import { get; set; } + public ActionCommand Squeeze { get; set; } + public ActionCommand SqueezeAll { get; set; } + public ActionCommand SqueezeSelected { get; set; } + public ActionCommand SqueezeSettings { get; set; } public ActionCommand SaveAll { get; set; } public ActionCommand SaveSelected { get; set; } public ActionCommand SavePdf { get; set; } diff --git a/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs b/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs index e143174d3c..91aec0dbb0 100644 --- a/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs +++ b/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs @@ -257,6 +257,14 @@ protected virtual void CreateToolbarsAndMenus() CreateToolbarButton(Commands.Ocr); if (!hiddenButtons.HasFlag(ToolbarButtons.Import)) CreateToolbarButton(Commands.Import); + // CreateToolbarSeparator(); + // Anpassung für den Squeeze Button + if (!hiddenButtons.HasFlag(ToolbarButtons.Squeeze)) + CreateToolbarButtonWithMenu(Commands.Squeeze, DesktopToolbarMenuType.Squeeze, new MenuProvider() + .Append(Commands.SqueezeAll) + .Append(Commands.SqueezeSelected) + .Separator() + .Append(Commands.SqueezeSettings)); CreateToolbarSeparator(); if (!hiddenButtons.HasFlag(ToolbarButtons.SavePdf)) CreateToolbarButtonWithMenu(Commands.SavePdf, DesktopToolbarMenuType.SavePdf, new MenuProvider() diff --git a/NAPS2.Lib/Icons/inbox_out-white.png b/NAPS2.Lib/Icons/inbox_out-white.png new file mode 100644 index 0000000000..7a4393ea33 Binary files /dev/null and b/NAPS2.Lib/Icons/inbox_out-white.png differ diff --git a/NAPS2.Lib/Lang/Resources/UiStrings.Designer.cs b/NAPS2.Lib/Lang/Resources/UiStrings.Designer.cs index f6c0b16cd1..a96215d2d6 100644 --- a/NAPS2.Lib/Lang/Resources/UiStrings.Designer.cs +++ b/NAPS2.Lib/Lang/Resources/UiStrings.Designer.cs @@ -2065,7 +2065,37 @@ internal static string SkipSavePrompt { return ResourceManager.GetString("SkipSavePrompt", resourceCulture); } } - + + // Squeeze Anpassung + internal static string Squeeze + { + get + { + return ResourceManager.GetString("Squeeze", resourceCulture); + } + } + internal static string SqueezeAll + { + get + { + return ResourceManager.GetString("SqueezeAll", resourceCulture); + } + } + internal static string SqueezeSelected + { + get + { + return ResourceManager.GetString("SqueezeSelected", resourceCulture); + } + } + internal static string SqueezeSettings + { + get + { + return ResourceManager.GetString("SqueezeSettings", resourceCulture); + } + } + /// /// Looks up a localized string similar to Start. /// diff --git a/NAPS2.Lib/Lang/Resources/UiStrings.de.resx b/NAPS2.Lib/Lang/Resources/UiStrings.de.resx index fd8c966807..146cb54610 100644 --- a/NAPS2.Lib/Lang/Resources/UiStrings.de.resx +++ b/NAPS2.Lib/Lang/Resources/UiStrings.de.resx @@ -756,4 +756,16 @@ Auch teilen, wenn NAPS2 geschlossen ist + + Squeeze + + + Alle + + + Ausgewählte + + + Sqz Einstellungen + \ No newline at end of file