aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CruUI/ui/control.h4
-rw-r--r--CruUI/ui/controls/text_block.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/CruUI/ui/control.h b/CruUI/ui/control.h
index 2ec4019b..d87bed27 100644
--- a/CruUI/ui/control.h
+++ b/CruUI/ui/control.h
@@ -29,9 +29,11 @@ namespace cru
friend class Window;
friend class WindowLayoutManager;
protected:
- struct WindowConstructorTag {};
+ struct WindowConstructorTag {}; //Used for constructor for class Window.
explicit Control(bool container = false);
+
+ // Used only for creating Window. It will set window_ as window.
Control(WindowConstructorTag, Window* window);
public:
diff --git a/CruUI/ui/controls/text_block.cpp b/CruUI/ui/controls/text_block.cpp
index 3d53da7c..2a3017fe 100644
--- a/CruUI/ui/controls/text_block.cpp
+++ b/CruUI/ui/controls/text_block.cpp
@@ -127,7 +127,6 @@ namespace cru
void TextBlock::OnMouseMoveCore(events::MouseEventArgs& args)
{
- OutputDebugStringW(L"Mouse move!");
if (is_selecting_)
{
const auto hit_test_result = TextLayoutHitTest(text_layout_.Get(), args.GetPoint(this), false).value();
@@ -162,7 +161,7 @@ namespace cru
is_selecting_ = false;
GetWindow()->ReleaseCurrentMouseCapture();
}
- if (!args.IsWindow())
+ if (!args.IsWindow()) // If the focus lose is triggered window-wide, then save the selection state. Otherwise, clear selection.
{
selected_range_ = std::nullopt;
Repaint();