aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/cru/ui/controls/Button.hpp4
-rw-r--r--include/cru/ui/controls/Container.hpp4
-rw-r--r--include/cru/ui/controls/Control.hpp2
-rw-r--r--include/cru/ui/controls/FlexLayout.hpp4
-rw-r--r--include/cru/ui/controls/ScrollView.hpp4
-rw-r--r--include/cru/ui/controls/StackLayout.hpp4
-rw-r--r--include/cru/ui/controls/TextBlock.hpp4
-rw-r--r--include/cru/ui/controls/TextBox.hpp4
-rw-r--r--include/cru/ui/controls/Window.hpp4
-rw-r--r--src/ui/CMakeLists.txt1
-rw-r--r--src/ui/controls/TextHostControlService.cpp10
-rw-r--r--src/ui/helper/BorderStyle.cpp0
12 files changed, 25 insertions, 20 deletions
diff --git a/include/cru/ui/controls/Button.hpp b/include/cru/ui/controls/Button.hpp
index 1c9b1216..9e324c62 100644
--- a/include/cru/ui/controls/Button.hpp
+++ b/include/cru/ui/controls/Button.hpp
@@ -12,7 +12,7 @@ class Button : public ContentControl,
public virtual IClickableControl,
public virtual IBorderControl {
public:
- static constexpr std::u16string_view control_type = u"Button";
+ static constexpr StringView control_type = u"Button";
static Button* Create() { return new Button(); }
@@ -26,7 +26,7 @@ class Button : public ContentControl,
Button& operator=(Button&& other) = delete;
~Button() override;
- std::u16string_view GetControlType() const final { return control_type; }
+ String GetControlType() const final { return control_type.ToString(); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/Container.hpp b/include/cru/ui/controls/Container.hpp
index 18958837..f992c152 100644
--- a/include/cru/ui/controls/Container.hpp
+++ b/include/cru/ui/controls/Container.hpp
@@ -3,7 +3,7 @@
namespace cru::ui::controls {
class Container : public ContentControl {
- static constexpr std::u16string_view control_type = u"Container";
+ static constexpr StringView control_type = u"Container";
protected:
Container();
@@ -15,7 +15,7 @@ class Container : public ContentControl {
~Container() override;
public:
- std::u16string_view GetControlType() const final { return control_type; }
+ String GetControlType() const final { return control_type.ToString(); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/Control.hpp b/include/cru/ui/controls/Control.hpp
index 341b6ef2..c6101370 100644
--- a/include/cru/ui/controls/Control.hpp
+++ b/include/cru/ui/controls/Control.hpp
@@ -22,7 +22,7 @@ class Control : public Object {
~Control() override;
public:
- virtual std::u16string_view GetControlType() const = 0;
+ virtual String GetControlType() const = 0;
//*************** region: tree ***************
public:
diff --git a/include/cru/ui/controls/FlexLayout.hpp b/include/cru/ui/controls/FlexLayout.hpp
index 4f6abfdb..f4e186db 100644
--- a/include/cru/ui/controls/FlexLayout.hpp
+++ b/include/cru/ui/controls/FlexLayout.hpp
@@ -4,7 +4,7 @@
namespace cru::ui::controls {
class FlexLayout : public LayoutControl {
public:
- static constexpr std::u16string_view control_type = u"FlexLayout";
+ static constexpr StringView control_type = u"FlexLayout";
static FlexLayout* Create() { return new FlexLayout(); }
@@ -18,7 +18,7 @@ class FlexLayout : public LayoutControl {
FlexLayout& operator=(FlexLayout&& other) = delete;
~FlexLayout() override;
- std::u16string_view GetControlType() const final { return control_type; }
+ String GetControlType() const final { return control_type.ToString(); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/ScrollView.hpp b/include/cru/ui/controls/ScrollView.hpp
index 93fd1712..4edf1706 100644
--- a/include/cru/ui/controls/ScrollView.hpp
+++ b/include/cru/ui/controls/ScrollView.hpp
@@ -12,7 +12,7 @@ class ScrollView : public ContentControl {
public:
static ScrollView* Create() { return new ScrollView(); }
- static constexpr std::u16string_view control_type = u"ScrollView";
+ static constexpr StringView control_type = u"ScrollView";
ScrollView();
@@ -22,7 +22,7 @@ class ScrollView : public ContentControl {
~ScrollView() override = default;
public:
- std::u16string_view GetControlType() const override { return control_type; }
+ String GetControlType() const override { return control_type.ToString(); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/StackLayout.hpp b/include/cru/ui/controls/StackLayout.hpp
index aa9440c2..6128f4ef 100644
--- a/include/cru/ui/controls/StackLayout.hpp
+++ b/include/cru/ui/controls/StackLayout.hpp
@@ -4,7 +4,7 @@
namespace cru::ui::controls {
class StackLayout : public LayoutControl {
public:
- static constexpr std::u16string_view control_type = u"StackLayout";
+ static constexpr StringView control_type = u"StackLayout";
static StackLayout* Create() { return new StackLayout(); }
@@ -17,7 +17,7 @@ class StackLayout : public LayoutControl {
~StackLayout() override;
- std::u16string_view GetControlType() const final { return control_type; }
+ String GetControlType() const final { return control_type.ToString(); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/TextBlock.hpp b/include/cru/ui/controls/TextBlock.hpp
index b3ce21c5..710a39d8 100644
--- a/include/cru/ui/controls/TextBlock.hpp
+++ b/include/cru/ui/controls/TextBlock.hpp
@@ -6,7 +6,7 @@
namespace cru::ui::controls {
class TextBlock : public NoChildControl, public virtual ITextHostControl {
public:
- static constexpr std::u16string_view control_type = u"TextBlock";
+ static constexpr StringView control_type = u"TextBlock";
static TextBlock* Create();
static TextBlock* Create(String text, bool selectable = false);
@@ -21,7 +21,7 @@ class TextBlock : public NoChildControl, public virtual ITextHostControl {
TextBlock& operator=(TextBlock&& other) = delete;
~TextBlock() override;
- std::u16string_view GetControlType() const final { return control_type; }
+ String GetControlType() const final { return control_type.ToString(); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/TextBox.hpp b/include/cru/ui/controls/TextBox.hpp
index 5693b315..f3925c88 100644
--- a/include/cru/ui/controls/TextBox.hpp
+++ b/include/cru/ui/controls/TextBox.hpp
@@ -14,7 +14,7 @@ class TextBox : public NoChildControl,
public virtual IBorderControl,
public virtual ITextHostControl {
public:
- static constexpr std::u16string_view control_type = u"TextBox";
+ static constexpr StringView control_type = u"TextBox";
static TextBox* Create() { return new TextBox(); }
@@ -27,7 +27,7 @@ class TextBox : public NoChildControl,
~TextBox() override;
- std::u16string_view GetControlType() const final { return control_type; }
+ String GetControlType() const final { return control_type.ToString(); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/Window.hpp b/include/cru/ui/controls/Window.hpp
index cca56b64..63b4d1e3 100644
--- a/include/cru/ui/controls/Window.hpp
+++ b/include/cru/ui/controls/Window.hpp
@@ -7,7 +7,7 @@
namespace cru::ui::controls {
class Window final : public RootControl {
public:
- static constexpr std::u16string_view control_type = u"Window";
+ static constexpr StringView control_type = u"Window";
public:
static Window* Create(Control* attached_control = nullptr);
@@ -22,7 +22,7 @@ class Window final : public RootControl {
~Window() override;
public:
- std::u16string_view GetControlType() const final { return control_type; }
+ String GetControlType() const final { return control_type.ToString(); }
protected:
gsl::not_null<platform::gui::INativeWindow*> CreateNativeWindow(
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index 5d813911..35c3581f 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -25,7 +25,6 @@ add_library(cru_ui STATIC
controls/TextHostControlService.cpp
controls/Window.cpp
events/UiEvent.cpp
- helper/BorderStyle.cpp
helper/ClickDetector.cpp
helper/ShortcutHub.cpp
host/LayoutPaintCycler.cpp
diff --git a/src/ui/controls/TextHostControlService.cpp b/src/ui/controls/TextHostControlService.cpp
index 740fa447..42153ffd 100644
--- a/src/ui/controls/TextHostControlService.cpp
+++ b/src/ui/controls/TextHostControlService.cpp
@@ -95,11 +95,17 @@ TextControlMovePattern TextControlMovePattern::kCtrlEnd(
TextControlMovePattern TextControlMovePattern::kPageUp(
helper::ShortcutKeyBind(platform::gui::KeyCode::PageUp),
[](TextHostControlService* service, StringView text,
- gsl::index current_position) { return current_position; });
+ gsl::index current_position) {
+ // TODO: Implement this.
+ return current_position;
+ });
TextControlMovePattern TextControlMovePattern::kPageDown(
helper::ShortcutKeyBind(platform::gui::KeyCode::PageDown),
[](TextHostControlService* service, StringView text,
- gsl::index current_position) { return current_position; });
+ gsl::index current_position) {
+ // TODO: Implement this.
+ return current_position;
+ });
std::vector<TextControlMovePattern> TextControlMovePattern::kDefaultPatterns = {
TextControlMovePattern::kLeft, TextControlMovePattern::kRight,
diff --git a/src/ui/helper/BorderStyle.cpp b/src/ui/helper/BorderStyle.cpp
deleted file mode 100644
index e69de29b..00000000
--- a/src/ui/helper/BorderStyle.cpp
+++ /dev/null