mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Fixed issues with the enum label losing it's number, fixed this... almost. Do not change the z-Order of the label.
This commit is contained in:
parent
efd144ad0d
commit
87406d90da
3 changed files with 20 additions and 5 deletions
|
@ -633,7 +633,7 @@ namespace Greenshot.Drawing {
|
||||||
public virtual void HandleMouseUp(int x, int y) {
|
public virtual void HandleMouseUp(int x, int y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SwitchParent(Surface newParent) {
|
protected virtual void SwitchParent(Surface newParent) {
|
||||||
if (_parent != null && _grippers != null) {
|
if (_parent != null && _grippers != null) {
|
||||||
for (int i=0; i<_grippers.Length; i++) {
|
for (int i=0; i<_grippers.Length; i++) {
|
||||||
_parent.Controls.Remove(_grippers[i]);
|
_parent.Controls.Remove(_grippers[i]);
|
||||||
|
|
|
@ -53,8 +53,23 @@ namespace Greenshot.Drawing {
|
||||||
_stringFormat = new StringFormat();
|
_stringFormat = new StringFormat();
|
||||||
_stringFormat.Alignment = StringAlignment.Center;
|
_stringFormat.Alignment = StringAlignment.Center;
|
||||||
_stringFormat.LineAlignment = StringAlignment.Center;
|
_stringFormat.LineAlignment = StringAlignment.Center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make sure the StepLabel is addded to the parent after deserializing
|
||||||
|
/// by removing it from the current parent and added it to the new
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newParent"></param>
|
||||||
|
protected override void SwitchParent(Surface newParent) {
|
||||||
|
if (Parent != null) {
|
||||||
|
Parent.RemoveStepLabel(this);
|
||||||
|
}
|
||||||
|
base.SwitchParent(newParent);
|
||||||
|
if (Parent != null) {
|
||||||
|
Parent.AddStepLabel(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override Size DefaultSize {
|
public override Size DefaultSize {
|
||||||
get {
|
get {
|
||||||
return new Size(30, 30);
|
return new Size(30, 30);
|
||||||
|
|
|
@ -208,10 +208,10 @@ namespace Greenshot.Drawing {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// all stepLabels for the surface, needed with serialization
|
/// all stepLabels for the surface, needed with serialization
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly LinkedList<IDrawableContainer> _stepLabels = new LinkedList<IDrawableContainer>();
|
private List<IDrawableContainer> _stepLabels = new List<IDrawableContainer>();
|
||||||
|
|
||||||
public void AddStepLabel(IDrawableContainer stepLabel) {
|
public void AddStepLabel(IDrawableContainer stepLabel) {
|
||||||
_stepLabels.AddLast(stepLabel);
|
_stepLabels.Add(stepLabel);
|
||||||
}
|
}
|
||||||
public void RemoveStepLabel(IDrawableContainer stepLabel) {
|
public void RemoveStepLabel(IDrawableContainer stepLabel) {
|
||||||
_stepLabels.Remove(stepLabel);
|
_stepLabels.Remove(stepLabel);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue