mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
Browser+LibGUI+WindowServer: Open Button menus uniformly
Instead of letting buttons determine the relative position of their menus, a workaround only used by Statusbar segments, open them all uniformly for a nice, consistent UI. Passing a rect to popup() now routes to open_button_menu(), an analog to open_menubar_menu(), which adjusts the menu's popup position in the same way. Fixes button menus obscuring the buttons which spawn them and jutting out at odd corners depending on screen position.
This commit is contained in:
parent
0fc1925cd7
commit
35e557c657
12 changed files with 34 additions and 31 deletions
|
@ -66,9 +66,6 @@ public:
|
|||
void set_mimic_pressed(bool mimic_pressed);
|
||||
bool is_mimic_pressed() const { return m_mimic_pressed; };
|
||||
|
||||
MenuPosition menu_position() const { return m_menu_position; }
|
||||
void set_menu_position(MenuPosition position) { m_menu_position = position; }
|
||||
|
||||
virtual Optional<UISize> calculated_min_size() const override;
|
||||
|
||||
protected:
|
||||
|
@ -88,7 +85,6 @@ private:
|
|||
int m_icon_spacing { 4 };
|
||||
bool m_another_button_has_focus { false };
|
||||
bool m_mimic_pressed { false };
|
||||
MenuPosition m_menu_position { MenuPosition::TopLeft };
|
||||
};
|
||||
|
||||
class DialogButton final : public Button {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue