1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +00:00

FileManager: Add a "Location:" label.

This commit is contained in:
Andreas Kling 2019-03-20 22:01:02 +01:00
parent 86e2348b74
commit 1030e6b848
3 changed files with 14 additions and 0 deletions

View file

@ -43,3 +43,9 @@ void GLabel::paint_event(GPaintEvent& event)
if (!text().is_empty())
painter.draw_text({ 0, 0, width(), height() }, text(), m_text_alignment, foreground_color());
}
void GLabel::size_to_fit()
{
set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
set_preferred_size({ font().width(m_text), 0 });
}