mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
This commit is contained in:
parent
15db5a1a3f
commit
8aca1c8282
4 changed files with 21 additions and 4 deletions
|
@ -93,6 +93,11 @@ namespace Greenshot.Base.Interfaces.Drawing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IList<IAdorner> Adorners { get; }
|
IList<IAdorner> Adorners { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is confirm/cancel possible for this container
|
||||||
|
/// </summary>
|
||||||
|
bool IsConfirmable { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adjust UI elements to the supplied DPI settings
|
/// Adjust UI elements to the supplied DPI settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -264,9 +264,18 @@ namespace Greenshot.Editor.Drawing
|
||||||
Invalidate();
|
Invalidate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
/// <inheritdoc cref="IDrawableContainer"/>
|
/// <inheritdoc />
|
||||||
|
/// <para/>
|
||||||
/// Make sure this container is not undoable
|
/// Make sure this container is not undoable
|
||||||
|
/// </summary>
|
||||||
public override bool IsUndoable => false;
|
public override bool IsUndoable => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <para/>
|
||||||
|
/// See dedicated confirm method <see cref="Surface.ConfirmCrop(bool)"/>
|
||||||
|
/// </summary>
|
||||||
|
public override bool IsConfirmable => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,9 +480,12 @@ namespace Greenshot.Editor.Drawing
|
||||||
g.DrawRectangle(pen, rect);
|
g.DrawRectangle(pen, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="IDrawableContainer"/>
|
/// <inheritdoc/>
|
||||||
public virtual bool IsUndoable => true;
|
public virtual bool IsUndoable => true;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public virtual bool IsConfirmable => false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make a following bounds change on this drawablecontainer undoable!
|
/// Make a following bounds change on this drawablecontainer undoable!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -2108,7 +2108,7 @@ namespace Greenshot.Editor.Drawing
|
||||||
{
|
{
|
||||||
// create new collection so that we can iterate safely (selectedElements might change due with confirm/cancel)
|
// create new collection so that we can iterate safely (selectedElements might change due with confirm/cancel)
|
||||||
List<IDrawableContainer> selectedDCs = new List<IDrawableContainer>(selectedElements);
|
List<IDrawableContainer> selectedDCs = new List<IDrawableContainer>(selectedElements);
|
||||||
foreach (IDrawableContainer dc in selectedDCs)
|
foreach (IDrawableContainer dc in selectedDCs.Where(c => c.IsConfirmable))
|
||||||
{
|
{
|
||||||
throw new NotImplementedException($"No confirm/cancel defined for Container type {dc.GetType()}");
|
throw new NotImplementedException($"No confirm/cancel defined for Container type {dc.GetType()}");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue