* Several small fixes 4.x-dev

Thu, 15 Jul 2021 12:50:41 +0300

author
cemkalyoncu
date
Thu, 15 Jul 2021 12:50:41 +0300
branch
4.x-dev
changeset 1718
fc59bffda6f7
parent 1717
2ec8ce4582c3
child 1719
2194cd4edde7

* Several small fixes

Source/Gorgon/String/Markdown.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Inputbox.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Label.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Panel.h file | annotate | diff | comparison | revisions
--- a/Source/Gorgon/String/Markdown.cpp	Thu Jul 15 08:51:57 2021 +0300
+++ b/Source/Gorgon/String/Markdown.cpp	Thu Jul 15 12:50:41 2021 +0300
@@ -21,6 +21,9 @@
                 return acc;
             
             String::AppendUnicode(acc, g);
+
+            if(it == end)
+                --it;
         }
         
         return acc;
@@ -78,7 +81,7 @@
             spaceadded = false;
         };
         
-        for(auto it = text.begin(); it!=end; ++it) {
+        for(auto it = text.begin(); it!=end; (it!= end) ? ++it : it) {
             prev = g;
             g = internal::decode_impl(it, end);
             
--- a/Source/Gorgon/Widgets/Inputbox.cpp	Thu Jul 15 08:51:57 2021 +0300
+++ b/Source/Gorgon/Widgets/Inputbox.cpp	Thu Jul 15 12:50:41 2021 +0300
@@ -184,6 +184,9 @@
             updateselection();
         }
         
+        changed();
+        dirty = false;
+
         return true;
     }
 
@@ -219,9 +222,6 @@
                 case Keycodes::Numpad_Enter:
                     if(!readonly) {
                         Done();
-                        
-                        changed();
-                        dirty = false;
                     }
                     
                     return blockenter;
--- a/Source/Gorgon/Widgets/Label.cpp	Thu Jul 15 08:51:57 2021 +0300
+++ b/Source/Gorgon/Widgets/Label.cpp	Thu Jul 15 12:50:41 2021 +0300
@@ -114,6 +114,7 @@
                 
                 for(auto &r : regions) {
                     if(IsInside(r.Bounds, point)) {
+                        Focus();
                         if(links.size() > r.ID) {
                             auto &dest = links[r.ID].Destination;
                             if(dest.substr(0, 1) == "#") {
--- a/Source/Gorgon/Widgets/Panel.h	Thu Jul 15 08:51:57 2021 +0300
+++ b/Source/Gorgon/Widgets/Panel.h	Thu Jul 15 12:50:41 2021 +0300
@@ -72,6 +72,13 @@
         }
         
         
+        virtual bool Done() override {
+            if(HasFocusedWidget())
+                return GetFocus().Done();
+
+            return false;
+        }
+
         using Widget::EnsureVisible;
         
         bool EnsureVisible(const UI::Widget &widget) override;

mercurial