aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-16 14:09:50 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-16 14:09:50 +0800
commit07d662aafc25b145eb20e4123ebc82b5736cdeb7 (patch)
tree0b94baddd3235623beac4997ac09a503a00645e7 /include/cru/ui
parentfaf73c4af74bdae1abf394a33b573149b98ec2b1 (diff)
downloadcru-07d662aafc25b145eb20e4123ebc82b5736cdeb7.tar.gz
cru-07d662aafc25b145eb20e4123ebc82b5736cdeb7.tar.bz2
cru-07d662aafc25b145eb20e4123ebc82b5736cdeb7.zip
New timer impl on Windows. Add Event test. Fix delete later.
Diffstat (limited to 'include/cru/ui')
-rw-r--r--include/cru/ui/DeleteLater.h3
-rw-r--r--include/cru/ui/controls/TextHostControlService.h5
-rw-r--r--include/cru/ui/events/UiEvents.h16
-rw-r--r--include/cru/ui/host/WindowHost.h1
4 files changed, 12 insertions, 13 deletions
diff --git a/include/cru/ui/DeleteLater.h b/include/cru/ui/DeleteLater.h
index d04d1814..ddbf2ce1 100644
--- a/include/cru/ui/DeleteLater.h
+++ b/include/cru/ui/DeleteLater.h
@@ -7,6 +7,7 @@
namespace cru::ui {
class CRU_UI_API DeleteLaterImpl {
+ CRU_DEFINE_CLASS_LOG_TAG("cru::ui::DeleteLaterImpl")
public:
DeleteLaterImpl();
virtual ~DeleteLaterImpl();
@@ -36,7 +37,7 @@ DeleteLaterPtr<T> ToDeleteLaterPtr(std::unique_ptr<T>&& p) {
template <typename T, typename... Args>
DeleteLaterPtr<T> MakeDeleteLater(Args&&... args) {
- return DeleteLaterPtr<T>(std::forward<Args>(args)...);
+ return DeleteLaterPtr<T>(new T(std::forward<Args>(args)...));
}
} // namespace cru::ui
diff --git a/include/cru/ui/controls/TextHostControlService.h b/include/cru/ui/controls/TextHostControlService.h
index d4a1218f..e1586e66 100644
--- a/include/cru/ui/controls/TextHostControlService.h
+++ b/include/cru/ui/controls/TextHostControlService.h
@@ -2,7 +2,6 @@
#include "../render/TextRenderObject.h"
#include "cru/platform/gui/InputMethod.h"
#include "cru/platform/gui/UiApplication.h"
-#include "cru/ui/DeleteLater.h"
#include "cru/ui/controls/Control.h"
#include "cru/ui/helper/ShortcutHub.h"
@@ -71,7 +70,7 @@ class TextControlMovePattern {
};
class CRU_UI_API TextHostControlService : public Object {
- CRU_DEFINE_CLASS_LOG_TAG("TextControlService")
+ CRU_DEFINE_CLASS_LOG_TAG("cru::ui::controls::TextControlService")
public:
TextHostControlService(Control* control);
@@ -207,6 +206,6 @@ class CRU_UI_API TextHostControlService : public Object {
bool mouse_move_selecting_ = false;
bool context_menu_dirty_ = true;
- DeleteLaterPtr<components::PopupMenu> context_menu_;
+ std::unique_ptr<components::PopupMenu> context_menu_;
};
} // namespace cru::ui::controls
diff --git a/include/cru/ui/events/UiEvents.h b/include/cru/ui/events/UiEvents.h
index 301ec694..a74c9d7d 100644
--- a/include/cru/ui/events/UiEvents.h
+++ b/include/cru/ui/events/UiEvents.h
@@ -1,10 +1,10 @@
#pragma once
-#include "FocusChangeEventArgs.h"
-#include "KeyEventArgs.h"
-#include "MouseButtonEventArgs.h"
-#include "MouseEventArgs.h"
-#include "MouseWheelEventArgs.h"
-#include "PaintEventArgs.h"
-#include "RoutedEvent.h"
-#include "UiEventArgs.h"
+#include "FocusChangeEventArgs.h" // IWYU pragma: export
+#include "KeyEventArgs.h" // IWYU pragma: export
+#include "MouseButtonEventArgs.h" // IWYU pragma: export
+#include "MouseEventArgs.h" // IWYU pragma: export
+#include "MouseWheelEventArgs.h" // IWYU pragma: export
+#include "PaintEventArgs.h" // IWYU pragma: export
+#include "RoutedEvent.h" // IWYU pragma: export
+#include "UiEventArgs.h" // IWYU pragma: export
diff --git a/include/cru/ui/host/WindowHost.h b/include/cru/ui/host/WindowHost.h
index 889665d5..58fd120d 100644
--- a/include/cru/ui/host/WindowHost.h
+++ b/include/cru/ui/host/WindowHost.h
@@ -9,7 +9,6 @@
#include <functional>
#include <memory>
-#include <optional>
namespace cru::ui::host {
class LayoutPaintCycler;