Browse Source

Fixed Dock GetPrev

Jean-David Moisan 3 years ago
parent
commit
9ba396b1cf
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Source/Dock.cs

+ 4 - 1
Source/Dock.cs

@@ -70,7 +70,7 @@ namespace Apos.Gui {
         public int NextIndex() => 0;
 
         public override IComponent GetPrev() {
-            return Parent != null ? Parent.GetPrev(this) : Child != null ? Child : this;
+            return Parent != null ? Parent.GetPrev(this) : Child != null ? Child.GetLast() : this;
         }
         public override IComponent GetNext() {
             return Child != null ? Child : Parent != null ? Parent.GetNext(this) : this;
@@ -81,6 +81,9 @@ namespace Apos.Gui {
         public virtual IComponent GetNext(IComponent c) {
             return Parent != null ? Parent.GetNext(this) : this;
         }
+        public virtual IComponent GetLast() {
+            return Child != null ? Child.GetLast() : this;
+        }
 
         public virtual void SendToTop(IComponent c) {
             Parent?.SendToTop(this);