AudioApplet: Fix applet positioning bug
Currently when clicking the percentage toggle, there is a delay in moving the applet window position. This is because after the applet is resized, the applet area is repositioned asynchronously. This takes advantage of the new AppletAreaRectChange event to reposition the slider window when necessary.
This commit is contained in:
parent
9df79a77da
commit
c2f62a03ff
Notes:
sideshowbarker
2024-07-18 05:00:16 +09:00
Author: https://github.com/joebentley Commit: https://github.com/SerenityOS/serenity/commit/c2f62a03ff2 Pull-request: https://github.com/SerenityOS/serenity/pull/9591 Reviewed-by: https://github.com/kleinesfilmroellchen ✅
1 changed files with 5 additions and 1 deletions
|
@ -81,7 +81,6 @@ public:
|
|||
window()->resize(44, 16);
|
||||
m_percent_box->set_tooltip("Hide percent");
|
||||
}
|
||||
reposition_slider_window();
|
||||
GUI::Application::the()->hide_tooltip();
|
||||
|
||||
Config::write_bool("AudioApplet", "Applet", "ShowPercent", m_show_percent);
|
||||
|
@ -152,6 +151,11 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void applet_area_rect_change_event(GUI::AppletAreaRectChangeEvent&) override
|
||||
{
|
||||
reposition_slider_window();
|
||||
}
|
||||
|
||||
void open()
|
||||
{
|
||||
reposition_slider_window();
|
||||
|
|
Loading…
Add table
Reference in a new issue