mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:47:44 +00:00
Redraw both incoming and outgoing widget when changing focus.
This commit is contained in:
parent
07873332e7
commit
b7d83e3265
3 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,7 @@ public:
|
||||||
private:
|
private:
|
||||||
virtual void paintEvent(PaintEvent&) override;
|
virtual void paintEvent(PaintEvent&) override;
|
||||||
virtual void mouseDownEvent(MouseEvent&) override;
|
virtual void mouseDownEvent(MouseEvent&) override;
|
||||||
|
virtual const char* class_name() const override { return "ListBox"; }
|
||||||
|
|
||||||
unsigned itemHeight() const;
|
unsigned itemHeight() const;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ public:
|
||||||
Function<void(TextBox&)> onReturnPressed;
|
Function<void(TextBox&)> onReturnPressed;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
virtual const char* class_name() const override { return "TextBox"; }
|
||||||
virtual void paintEvent(PaintEvent&) override;
|
virtual void paintEvent(PaintEvent&) override;
|
||||||
virtual void mouseDownEvent(MouseEvent&) override;
|
virtual void mouseDownEvent(MouseEvent&) override;
|
||||||
virtual void keyDownEvent(KeyEvent&) override;
|
virtual void keyDownEvent(KeyEvent&) override;
|
||||||
|
|
|
@ -128,10 +128,13 @@ void Window::setFocusedWidget(Widget* widget)
|
||||||
m_focusedWidget = nullptr;
|
m_focusedWidget = nullptr;
|
||||||
else {
|
else {
|
||||||
m_focusedWidget = widget->makeWeakPtr();
|
m_focusedWidget = widget->makeWeakPtr();
|
||||||
|
m_focusedWidget->update();
|
||||||
EventLoop::main().postEvent(m_focusedWidget.ptr(), make<Event>(Event::FocusIn));
|
EventLoop::main().postEvent(m_focusedWidget.ptr(), make<Event>(Event::FocusIn));
|
||||||
}
|
}
|
||||||
if (previously_focused_widget)
|
if (previously_focused_widget) {
|
||||||
|
previously_focused_widget->update();
|
||||||
EventLoop::main().postEvent(previously_focused_widget, make<Event>(Event::FocusOut));
|
EventLoop::main().postEvent(previously_focused_widget, make<Event>(Event::FocusOut));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::close()
|
void Window::close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue