mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:55:08 +00:00
GSpinBox: Move increment/decrement button within the widget frame.
This commit is contained in:
parent
9311164439
commit
5ab043a687
1 changed files with 5 additions and 4 deletions
|
@ -63,9 +63,10 @@ void GSpinBox::set_range(int min, int max)
|
|||
|
||||
void GSpinBox::resize_event(GResizeEvent& event)
|
||||
{
|
||||
int button_height = event.size().height() / 2;
|
||||
int frame_thickness = m_editor->frame_thickness();
|
||||
int button_height = (event.size().height() / 2) - frame_thickness;
|
||||
int button_width = 15;
|
||||
m_increment_button->set_relative_rect(width() - button_width, 0, button_width, button_height);
|
||||
m_decrement_button->set_relative_rect(width() - button_width, button_height, button_width, button_height);
|
||||
m_editor->set_relative_rect(0, 0, width() - button_width, height());
|
||||
m_increment_button->set_relative_rect(width() - button_width - frame_thickness, frame_thickness, button_width, button_height);
|
||||
m_decrement_button->set_relative_rect(width() - button_width - frame_thickness, frame_thickness + button_height, button_width, button_height);
|
||||
m_editor->set_relative_rect(0, 0, width(), height());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue