Skip to content

Commit

Permalink
Add placeholder forms for Split/Combine
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Mar 5, 2024
1 parent 34f6e5f commit 963ccab
Show file tree
Hide file tree
Showing 13 changed files with 1,413 additions and 524 deletions.
3 changes: 3 additions & 0 deletions NAPS2.Lib.Mac/EtoForms/Ui/MacDesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ protected override void CreateToolbarsAndMenus()
Commands.Sharpen,
Commands.DocumentCorrection,
new SeparatorMenuItem(),
Commands.Split,
Commands.Combine,
new SeparatorMenuItem(),
Commands.RotateLeft,
Commands.RotateRight,
Commands.Flip,
Expand Down
3 changes: 3 additions & 0 deletions NAPS2.Lib/EtoForms/Desktop/DesktopSubFormController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public class DesktopSubFormController : IDesktopSubFormController
public void ShowHueSaturationForm() => ShowImageForm<HueSatForm>();
public void ShowBlackWhiteForm() => ShowImageForm<BlackWhiteForm>();
public void ShowSharpenForm() => ShowImageForm<SharpenForm>();
public void ShowSplitForm() => ShowImageForm<SplitForm>();
public void ShowCombineForm() => ShowImageForm<CombineForm>();

public void ShowRotateForm() => ShowImageForm<RotateForm>();

private void ShowImageForm<T>() where T : ImageFormBase
Expand Down
2 changes: 2 additions & 0 deletions NAPS2.Lib/EtoForms/Desktop/IDesktopSubFormController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public interface IDesktopSubFormController
void ShowHueSaturationForm();
void ShowBlackWhiteForm();
void ShowSharpenForm();
void ShowSplitForm();
void ShowCombineForm();
void ShowRotateForm();
void ShowProfilesForm();
void ShowOcrForm();
Expand Down
16 changes: 16 additions & 0 deletions NAPS2.Lib/EtoForms/Ui/CombineForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Eto.Drawing;
using NAPS2.EtoForms.Widgets;

namespace NAPS2.EtoForms.Ui;

public class CombineForm : ImageFormBase
{
public CombineForm(Naps2Config config, UiImageList imageList, ThumbnailController thumbnailController) :
base(config, imageList, thumbnailController)
{
Icon = new Icon(1f, Icons.combine.ToEtoImage());
Title = UiStrings.Combine;
}

protected override List<Transform> Transforms => [];
}
12 changes: 12 additions & 0 deletions NAPS2.Lib/EtoForms/Ui/DesktopCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ public class DesktopCommands
Text = UiStrings.DocumentCorrection,
Image = iconProvider.GetIcon("document")
};
Split = new ActionCommand(desktopSubFormController.ShowSplitForm)
{
Text = UiStrings.Split,
Image = iconProvider.GetIcon("split")
};
Combine = new ActionCommand(desktopSubFormController.ShowCombineForm)
{
Text = UiStrings.Combine,
Image = iconProvider.GetIcon("combine")
};
ResetImage = new ActionCommand(desktopController.ResetImage)
{
Text = UiStrings.Reset
Expand Down Expand Up @@ -379,6 +389,8 @@ public DesktopCommands WithSelection(Func<ListSelection<UiImage>> selectionFunc)
public ActionCommand BlackWhite { get; set; }
public ActionCommand Sharpen { get; set; }
public ActionCommand DocumentCorrection { get; set; }
public ActionCommand Split { get; set; }
public ActionCommand Combine { get; set; }
public ActionCommand ResetImage { get; set; }
public ActionCommand RotateMenu { get; set; }
public ActionCommand RotateLeft { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions NAPS2.Lib/EtoForms/Ui/DesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ protected virtual void CreateToolbarsAndMenus()
.Append(Commands.Sharpen)
.Append(Commands.DocumentCorrection)
.Separator()
.Append(Commands.Split)
.Append(Commands.Combine)
.Separator()
.Append(Commands.ResetImage));
if (!hiddenButtons.HasFlag(ToolbarButtons.Rotate))
CreateToolbarMenu(Commands.RotateMenu, GetRotateMenuProvider());
Expand Down
15 changes: 15 additions & 0 deletions NAPS2.Lib/EtoForms/Ui/SplitForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Eto.Drawing;

namespace NAPS2.EtoForms.Ui;

public class SplitForm : ImageFormBase
{
public SplitForm(Naps2Config config, UiImageList imageList, ThumbnailController thumbnailController) :
base(config, imageList, thumbnailController)
{
Icon = new Icon(1f, Icons.split.ToEtoImage());
Title = UiStrings.Split;
}

protected override List<Transform> Transforms => [];
}
20 changes: 20 additions & 0 deletions NAPS2.Lib/Icons.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions NAPS2.Lib/Icons.resx
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,10 @@
<data name="document" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\document.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="split" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\split.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="combine" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\combine.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
Binary file added NAPS2.Lib/Icons/combine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added NAPS2.Lib/Icons/split.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 963ccab

Please sign in to comment.