summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2023-04-16 16:01:23 -0400
committerAndreas Kling <kling@serenityos.org>2023-04-18 10:05:21 +0200
commit7304556ff2a6cff6f606a83f3f85061ba2f0a5ad (patch)
tree4d69a29fc8f08cb9bff536e618dba8ee4c6d1e01
parentb7cac829ae7b5af9ae34d21530c132569a0876ae (diff)
downloadserenity-7304556ff2a6cff6f606a83f3f85061ba2f0a5ad.zip
LibGUI: Add Window::on_font_change() hook
-rw-r--r--Userland/Libraries/LibGUI/Window.cpp3
-rw-r--r--Userland/Libraries/LibGUI/Window.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp
index f5706a361c..043115666c 100644
--- a/Userland/Libraries/LibGUI/Window.cpp
+++ b/Userland/Libraries/LibGUI/Window.cpp
@@ -618,6 +618,9 @@ void Window::handle_fonts_change_event(FontsChangeEvent& event)
if (is_auto_shrinking())
schedule_relayout();
+
+ if (on_font_change)
+ on_font_change();
}
void Window::handle_screen_rects_change_event(ScreenRectsChangeEvent& event)
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h
index e3f055bd68..676427fc53 100644
--- a/Userland/Libraries/LibGUI/Window.h
+++ b/Userland/Libraries/LibGUI/Window.h
@@ -99,6 +99,7 @@ public:
Close,
};
+ Function<void()> on_font_change;
Function<void()> on_close;
Function<CloseRequestDecision()> on_close_request;
Function<void(bool is_preempted)> on_input_preemption_change;