diff options
author | crupest <crupest@outlook.com> | 2022-01-12 22:36:09 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-12 22:36:09 +0800 |
commit | c409caa8873e25699fc10ae435e8d123685f28f3 (patch) | |
tree | 16a0c0696f0e6d4c6856db0b7864652e2779b2b8 /src/ui | |
parent | 7a42d92c10a4bc686244668dd0e3f903f30f2fae (diff) | |
download | cru-c409caa8873e25699fc10ae435e8d123685f28f3.tar.gz cru-c409caa8873e25699fc10ae435e8d123685f28f3.tar.bz2 cru-c409caa8873e25699fc10ae435e8d123685f28f3.zip |
...
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/components/Menu.cpp | 2 | ||||
-rw-r--r-- | src/ui/controls/TextHostControlService.cpp | 4 | ||||
-rw-r--r-- | src/ui/render/TextRenderObject.cpp | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/ui/components/Menu.cpp b/src/ui/components/Menu.cpp index 681b44b7..05324865 100644 --- a/src/ui/components/Menu.cpp +++ b/src/ui/components/Menu.cpp @@ -92,7 +92,7 @@ PopupMenu::PopupMenu(controls::Control* attached_control) menu_ = new Menu(); - menu_->SetOnItemClick([this](Index _) { this->Close(); }); + menu_->SetOnItemClick([this](Index) { this->Close(); }); popup_->AddChild(menu_->GetRootControl(), 0); } diff --git a/src/ui/controls/TextHostControlService.cpp b/src/ui/controls/TextHostControlService.cpp index 7fcf70e9..0f136034 100644 --- a/src/ui/controls/TextHostControlService.cpp +++ b/src/ui/controls/TextHostControlService.cpp @@ -87,7 +87,7 @@ TextControlMovePattern TextControlMovePattern::kHome( gsl::index current_position) { CRU_UNUSED(service) return Utf16BackwardUntil(text, current_position, - [](char16_t c) { return c == u'\n'; }); + [](CodePoint c) { return c == u'\n'; }); }); TextControlMovePattern TextControlMovePattern::kEnd( u"End(Line End)", helper::ShortcutKeyBind(platform::gui::KeyCode::End), @@ -95,7 +95,7 @@ TextControlMovePattern TextControlMovePattern::kEnd( gsl::index current_position) { CRU_UNUSED(service) return Utf16ForwardUntil(text, current_position, - [](char16_t c) { return c == u'\n'; }); + [](CodePoint c) { return c == u'\n'; }); }); TextControlMovePattern TextControlMovePattern::kCtrlHome( u"Ctrl+Home(Document Begin)", diff --git a/src/ui/render/TextRenderObject.cpp b/src/ui/render/TextRenderObject.cpp index 0e65da92..f7665beb 100644 --- a/src/ui/render/TextRenderObject.cpp +++ b/src/ui/render/TextRenderObject.cpp @@ -147,7 +147,6 @@ Rect TextRenderObject::GetCaretRectInContent() { const auto caret_top_center = this->text_layout_->TextSinglePoint(caret_pos, false); - const auto font_height = this->font_->GetFontSize(); const auto caret_width = this->caret_width_; auto rect = Rect{caret_top_center.left - caret_width / 2.0f, |