mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 05:25:13 +00:00
LibGUI: Hide ResizeCorner in StatusBar when window is maximized
Fully expands status bars when maximized and prevents maximized windows from being erroneously resized.
This commit is contained in:
parent
72deaa3423
commit
199c1da31c
Notes:
sideshowbarker
2024-07-19 02:58:38 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/199c1da31cf Pull-request: https://github.com/SerenityOS/serenity/pull/3358 Reviewed-by: https://github.com/awesomekling ✅
2 changed files with 10 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ResizeCorner.h>
|
||||
#include <LibGUI/StatusBar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/StylePainter.h>
|
||||
|
||||
|
@ -92,4 +93,12 @@ void StatusBar::paint_event(PaintEvent& event)
|
|||
painter.fill_rect(rect(), palette().button());
|
||||
}
|
||||
|
||||
void StatusBar::resize_event(ResizeEvent& event)
|
||||
{
|
||||
if (window())
|
||||
m_corner->set_visible(window()->is_maximized() ? false : true);
|
||||
|
||||
Widget::resize_event(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
protected:
|
||||
explicit StatusBar(int label_count = 1);
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
virtual void resize_event(ResizeEvent&) override;
|
||||
|
||||
private:
|
||||
NonnullRefPtr<Label> create_label();
|
||||
|
|
Loading…
Add table
Reference in a new issue