1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:45:07 +00:00

LibGUI: Simplify ComboBox/TextEditor relationship a bit

Instead of TextEditor knowing about the ComboBox button on the right
hand side, we now make ComboBox inherit from GUI::Frame, and make the
inner text editor widget frameless.

This allows us to place the button ourselves inside ComboBox without
any frame artifacts, and TextEditor no longer needs to keep track of
the geometry of that button.
This commit is contained in:
Andreas Kling 2020-12-12 23:17:41 +01:00
parent a01d11ac19
commit 3ee5694e97
4 changed files with 12 additions and 20 deletions

View file

@ -386,7 +386,7 @@ void TextEditor::paint_event(PaintEvent& event)
Gfx::IntRect display_rect {
widget_inner_rect().x() + 1,
widget_inner_rect().y() + 1,
widget_inner_rect().width() - button_padding(),
widget_inner_rect().width() - 2,
widget_inner_rect().height() - 2
};
painter.add_clip_rect(display_rect);
@ -1437,13 +1437,6 @@ void TextEditor::set_mode(const Mode mode)
set_override_cursor(Gfx::StandardCursor::None);
}
void TextEditor::set_has_open_button(bool has_button)
{
if (m_has_open_button == has_button)
return;
m_has_open_button = has_button;
}
void TextEditor::set_has_visible_list(bool visible)
{
if (m_has_visible_list == visible)