mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +00:00
LibCore+LibGUI: Add is<T>(CObject&) and to<T>(CObject&) helpers.
This commit is contained in:
parent
723ba91f74
commit
0c85d3dba9
Notes:
sideshowbarker
2024-07-19 13:55:24 +09:00
Author: https://github.com/awesomekling
Commit: 0c85d3dba9
5 changed files with 53 additions and 30 deletions
|
@ -50,9 +50,9 @@ Rect GTabWidget::child_rect_for_size(const Size& size) const
|
|||
|
||||
void GTabWidget::child_event(CChildEvent& event)
|
||||
{
|
||||
if (!event.child() || !event.child()->is_widget())
|
||||
if (!event.child() || !is<GWidget>(*event.child()))
|
||||
return GWidget::child_event(event);
|
||||
auto& child = static_cast<GWidget&>(*event.child());
|
||||
auto& child = to<GWidget>(*event.child());
|
||||
if (event.type() == GEvent::ChildAdded) {
|
||||
if (!m_active_widget)
|
||||
set_active_widget(&child);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue