LazyWidget.cpp 422 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include <LibGUI/LazyWidget.h>
  8. REGISTER_WIDGET(GUI, LazyWidget)
  9. namespace GUI {
  10. void LazyWidget::show_event(ShowEvent&)
  11. {
  12. if (m_has_been_shown)
  13. return;
  14. m_has_been_shown = true;
  15. VERIFY(on_first_show);
  16. on_first_show(*this);
  17. }
  18. }