mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:35:06 +00:00
LibGUI: Keep the (1, 1) text offset on GButton after it becomes checked
This makes the text offset "stick" after you click to select a window in the taskbar, for example.
This commit is contained in:
parent
dd72608aed
commit
ea52fe528a
1 changed files with 2 additions and 2 deletions
|
@ -32,11 +32,11 @@ void GButton::paint_event(GPaintEvent& event)
|
|||
if (text().is_empty() && !m_icon)
|
||||
return;
|
||||
|
||||
auto content_rect = rect().shrunken(10, 2);
|
||||
auto content_rect = rect().shrunken(8, 2);
|
||||
auto icon_location = m_icon ? content_rect.center().translated(-(m_icon->width() / 2), -(m_icon->height() / 2)) : Point();
|
||||
if (m_icon && !text().is_empty())
|
||||
icon_location.set_x(content_rect.x());
|
||||
if (is_being_pressed())
|
||||
if (is_being_pressed() || is_checked())
|
||||
painter.translate(1, 1);
|
||||
if (m_icon) {
|
||||
if (is_enabled())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue