aboutsummaryrefslogtreecommitdiff
path: root/src/ui/helper
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/helper')
-rw-r--r--src/ui/helper/ClickDetector.cpp4
-rw-r--r--src/ui/helper/ShortcutHub.cpp24
2 files changed, 15 insertions, 13 deletions
diff --git a/src/ui/helper/ClickDetector.cpp b/src/ui/helper/ClickDetector.cpp
index b7e800a8..2e3dc1a0 100644
--- a/src/ui/helper/ClickDetector.cpp
+++ b/src/ui/helper/ClickDetector.cpp
@@ -58,7 +58,7 @@ ClickDetector::ClickDetector(controls::Control* control) {
this->state_ == ClickState::Hover) {
if (!this->control_->CaptureMouse()) {
if constexpr (debug_flags::click_detector) {
- CRU_LOG_TAG_DEBUG(u"Failed to capture mouse when begin click.");
+ CRU_LOG_TAG_DEBUG("Failed to capture mouse when begin click.");
}
return;
}
@@ -137,7 +137,7 @@ void ClickDetector::SetState(ClickState state) {
UnreachableCode();
}
};
- CRU_LOG_TAG_DEBUG(u"Click state changed, new state: {}.", to_string(state));
+ CRU_LOG_TAG_DEBUG("Click state changed, new state: {}.", to_string(state));
}
state_ = state;
diff --git a/src/ui/helper/ShortcutHub.cpp b/src/ui/helper/ShortcutHub.cpp
index c413ab2a..e3a06e8c 100644
--- a/src/ui/helper/ShortcutHub.cpp
+++ b/src/ui/helper/ShortcutHub.cpp
@@ -64,7 +64,7 @@ const std::vector<ShortcutInfo>& ShortcutHub::GetShortcutByKeyBind(
void ShortcutHub::Install(controls::Control* control) {
if (!event_guard_.IsEmpty()) {
- CRU_LOG_TAG_ERROR(u"Shortcut hub is already installed. Failed to install.");
+ CRU_LOG_TAG_ERROR("Shortcut hub is already installed. Failed to install.");
return;
}
@@ -74,7 +74,7 @@ void ShortcutHub::Install(controls::Control* control) {
void ShortcutHub::Uninstall() {
if (event_guard_.IsEmpty()) {
- CRU_LOG_TAG_WARN(u"Shortcut hub is not installed. Failed to uninstall.");
+ CRU_LOG_TAG_WARN("Shortcut hub is not installed. Failed to uninstall.");
return;
}
@@ -89,17 +89,18 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
if constexpr (debug_flags::shortcut) {
if (shortcut_list.empty()) {
- CRU_LOG_TAG_DEBUG(u"No shortcut for key bind {}.", key_bind.ToString());
+ CRU_LOG_TAG_DEBUG("No shortcut for key bind {}.",
+ key_bind.ToString().ToUtf8());
}
- CRU_LOG_TAG_DEBUG(u"Begin to handle shortcut for key bind {}.",
- key_bind.ToString());
+ CRU_LOG_TAG_DEBUG("Begin to handle shortcut for key bind {}.",
+ key_bind.ToString());
}
for (const auto& shortcut : shortcut_list) {
auto is_handled = shortcut.handler();
if (is_handled) {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_TAG_DEBUG(u"Handle {} handled it.", shortcut.name);
+ CRU_LOG_TAG_DEBUG("Handle {} handled it.", shortcut.name.ToUtf8());
}
handled = true;
@@ -108,23 +109,24 @@ void ShortcutHub::OnKeyDown(events::KeyEventArgs& event) {
break;
} else {
if constexpr (debug_flags::shortcut) {
- CRU_LOG_TAG_DEBUG(u"Handle {} didn't handle it.", shortcut.name);
+ CRU_LOG_TAG_DEBUG("Handle {} didn't handle it.",
+ shortcut.name.ToUtf8());
}
}
}
if constexpr (debug_flags::shortcut) {
if (!shortcut_list.empty()) {
- CRU_LOG_TAG_DEBUG(u"End handling shortcut for key bind {}.",
- key_bind.ToString());
+ CRU_LOG_TAG_DEBUG("End handling shortcut for key bind {}.",
+ key_bind.ToString().ToUtf8());
}
}
if (!handled) {
if constexpr (debug_flags::shortcut) {
CRU_LOG_TAG_DEBUG(
- u"Raise fallback event for unhandled shortcut of key bind {}.",
- key_bind.ToString());
+ "Raise fallback event for unhandled shortcut of key bind {}.",
+ key_bind.ToString().ToUtf8());
}
fallback_event_.Raise(event);
}