mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
FileManager: Replace Label with Image component to show icons
This commit is contained in:
parent
900aaf68d4
commit
02eb268c3e
2 changed files with 5 additions and 3 deletions
|
@ -69,7 +69,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
|||
file_container.layout()->set_spacing(20);
|
||||
file_container.set_preferred_size(0, 34);
|
||||
|
||||
m_icon = file_container.add<GUI::Label>();
|
||||
m_icon = file_container.add<GUI::Image>();
|
||||
m_icon->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
||||
m_icon->set_preferred_size(32, 32);
|
||||
|
||||
|
@ -168,7 +168,8 @@ PropertiesDialog::~PropertiesDialog() {}
|
|||
|
||||
void PropertiesDialog::update()
|
||||
{
|
||||
m_icon->set_icon(const_cast<Gfx::Bitmap*>(m_model.icon_for_file(m_mode, m_name).bitmap_for_size(32)));
|
||||
auto bitmap = m_model.icon_for_file(m_mode, m_name).bitmap_for_size(32);
|
||||
m_icon->set_bitmap(bitmap);
|
||||
set_title(String::format("%s - Properties", m_name.characters()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue