aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls')
-rw-r--r--src/ui/controls/button.cpp4
-rw-r--r--src/ui/controls/list_item.cpp2
-rw-r--r--src/ui/controls/text_box.cpp6
-rw-r--r--src/ui/controls/text_control.cpp18
-rw-r--r--src/ui/controls/toggle_button.cpp4
5 files changed, 17 insertions, 17 deletions
diff --git a/src/ui/controls/button.cpp b/src/ui/controls/button.cpp
index 0bd6a70d..a9f101f8 100644
--- a/src/ui/controls/button.cpp
+++ b/src/ui/controls/button.cpp
@@ -23,12 +23,12 @@ namespace cru::ui::controls
void Button::OnMouseClickBegin(MouseButton button)
{
GetBorderProperty() = pressed_border_;
- InvalidateBorder();
+ UpdateBorder();
}
void Button::OnMouseClickEnd(MouseButton button)
{
GetBorderProperty() = normal_border_;
- InvalidateBorder();
+ UpdateBorder();
}
}
diff --git a/src/ui/controls/list_item.cpp b/src/ui/controls/list_item.cpp
index bdd44273..bf61010d 100644
--- a/src/ui/controls/list_item.cpp
+++ b/src/ui/controls/list_item.cpp
@@ -25,7 +25,7 @@ namespace cru::ui::controls
void ListItem::SetState(const State state)
{
state_ = state;
- Repaint();
+ InvalidateDraw();
}
void ListItem::OnDrawForeground(ID2D1DeviceContext* device_context)
diff --git a/src/ui/controls/text_box.cpp b/src/ui/controls/text_box.cpp
index 6eeb7abb..83311548 100644
--- a/src/ui/controls/text_box.cpp
+++ b/src/ui/controls/text_box.cpp
@@ -50,7 +50,7 @@ namespace cru::ui::controls
caret_timer_ = SetInterval(UiManager::GetInstance()->GetCaretInfo().caret_blink_duration, [this]
{
is_caret_show_ = !is_caret_show_;
- Repaint();
+ InvalidateDraw();
});
}
@@ -86,7 +86,7 @@ namespace cru::ui::controls
else
caret_position_--;
}
- Repaint();
+ InvalidateDraw();
}
if (args.GetVirtualCode() == VK_RIGHT && caret_position_ < GetText().size())
@@ -168,7 +168,7 @@ namespace cru::ui::controls
void TextBox::RequestChangeCaretPosition(const unsigned position)
{
caret_position_ = position;
- Repaint();
+ InvalidateDraw();
}
bool TextBox::GetCaretSelectionSide() const
diff --git a/src/ui/controls/text_control.cpp b/src/ui/controls/text_control.cpp
index ff8346ee..f7f88d4e 100644
--- a/src/ui/controls/text_control.cpp
+++ b/src/ui/controls/text_control.cpp
@@ -35,14 +35,14 @@ namespace cru::ui::controls
void TextControl::SetBrush(const Microsoft::WRL::ComPtr<ID2D1Brush>& brush)
{
brush_ = brush;
- Repaint();
+ InvalidateDraw();
}
void TextControl::SetTextFormat(const Microsoft::WRL::ComPtr<IDWriteTextFormat>& text_format)
{
text_format_ = text_format;
RecreateTextLayout();
- Repaint();
+ InvalidateDraw();
}
void TextControl::SetSelectable(const bool is_selectable)
@@ -57,7 +57,7 @@ namespace cru::ui::controls
GetWindow()->ReleaseCurrentMouseCapture();
}
selected_range_ = std::nullopt;
- Repaint();
+ InvalidateDraw();
}
is_selectable_ = is_selectable;
UpdateCursor(std::nullopt);
@@ -69,7 +69,7 @@ namespace cru::ui::controls
if (is_selectable_)
{
selected_range_ = text_range;
- Repaint();
+ InvalidateDraw();
}
}
@@ -79,7 +79,7 @@ namespace cru::ui::controls
const auto content = GetRect(RectRange::Content);
ThrowIfFailed(text_layout_->SetMaxWidth(content.width));
ThrowIfFailed(text_layout_->SetMaxHeight(content.height));
- Repaint();
+ InvalidateDraw();
}
namespace
@@ -133,7 +133,7 @@ namespace cru::ui::controls
mouse_down_position_ = hit_test_result;
is_selecting_ = true;
GetWindow()->CaptureMouseFor(this);
- Repaint();
+ InvalidateDraw();
}
}
@@ -145,7 +145,7 @@ namespace cru::ui::controls
const auto hit_test_result = TextLayoutHitTest(text_layout_.Get(), args.GetPoint(this));
RequestChangeCaretPosition(hit_test_result);
selected_range_ = TextRange::FromTwoSides(hit_test_result, mouse_down_position_);
- Repaint();
+ InvalidateDraw();
}
UpdateCursor(args.GetPoint(this, RectRange::Margin));
}
@@ -174,7 +174,7 @@ namespace cru::ui::controls
if (!args.IsWindow()) // If the focus lose is triggered window-wide, then save the selection state. Otherwise, clear selection.
{
selected_range_ = std::nullopt;
- Repaint();
+ InvalidateDraw();
}
}
@@ -202,7 +202,7 @@ namespace cru::ui::controls
{
RecreateTextLayout();
InvalidateLayout();
- Repaint();
+ InvalidateDraw();
}
void TextControl::RecreateTextLayout()
diff --git a/src/ui/controls/toggle_button.cpp b/src/ui/controls/toggle_button.cpp
index b16eca23..e3d8662a 100644
--- a/src/ui/controls/toggle_button.cpp
+++ b/src/ui/controls/toggle_button.cpp
@@ -68,12 +68,12 @@ namespace cru::ui::controls
.AddStepHandler([=](auto, const double percentage)
{
current_circle_position_ = static_cast<float>(previous_position + delta * percentage);
- Repaint();
+ InvalidateDraw();
})
.Start();
RaiseToggleEvent(state);
- Repaint();
+ InvalidateDraw();
}
}