aboutsummaryrefslogtreecommitdiff
path: root/src/ui/UiHost.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-28 18:06:56 +0800
committercrupest <crupest@outlook.com>2020-10-28 18:06:56 +0800
commitc1c5a185e4f4c4706e8a641f25add3885203f202 (patch)
treefd7588d2892d050707732c866aa49feb55eb2b3a /src/ui/UiHost.cpp
parentd3e49fa3b505cce12a60cb1a2711fd6b4427303b (diff)
downloadcru-c1c5a185e4f4c4706e8a641f25add3885203f202.tar.gz
cru-c1c5a185e4f4c4706e8a641f25add3885203f202.tar.bz2
cru-c1c5a185e4f4c4706e8a641f25add3885203f202.zip
...
Diffstat (limited to 'src/ui/UiHost.cpp')
-rw-r--r--src/ui/UiHost.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/UiHost.cpp b/src/ui/UiHost.cpp
index ccc5fea0..a881c16d 100644
--- a/src/ui/UiHost.cpp
+++ b/src/ui/UiHost.cpp
@@ -6,6 +6,7 @@
#include "cru/platform/native/InputMethod.hpp"
#include "cru/platform/native/UiApplication.hpp"
#include "cru/platform/native/Window.hpp"
+#include "cru/ui/DebugFlags.hpp"
#include "cru/ui/Window.hpp"
#include "cru/ui/render/MeasureRequirement.hpp"
#include "cru/ui/render/WindowRenderObject.hpp"
@@ -156,7 +157,8 @@ void UiHost::InvalidatePaint() {
}
void UiHost::InvalidateLayout() {
- log::TagDebug(log_tag, u"A relayout is requested.");
+ if constexpr (debug_flags::layout)
+ log::TagDebug(log_tag, u"A relayout is requested.");
if (!need_layout_) {
platform::native::IUiApplication::GetInstance()->SetImmediate(
[resolver = this->CreateResolver()] {
@@ -196,7 +198,8 @@ void UiHost::Relayout() {
for (auto& action : after_layout_stable_action_) action();
after_layout_stable_action_.clear();
after_layout_event_.Raise(AfterLayoutEventArgs{});
- log::TagDebug(log_tag, u"A relayout is finished.");
+ if constexpr (debug_flags::layout)
+ log::TagDebug(log_tag, u"A relayout is finished.");
}
bool UiHost::RequestFocusFor(Control* control) {