SPE-2199 - Add .jpg in ScalableBitmap

+ TopBar: Set correct size for "user" icon
This commit is contained in:
YuSanka 2024-04-15 16:43:42 +02:00 committed by Lukas Matena
parent cd76008e81
commit b4c6ec1068
2 changed files with 7 additions and 2 deletions

View File

@ -301,10 +301,10 @@ void TopBarItemsCtrl::UpdateAccountMenu(bool avatar/* = false*/)
if (new_logo.IsOk()) if (new_logo.IsOk())
m_account_btn->SetBitmapBundle(new_logo.bmp()); m_account_btn->SetBitmapBundle(new_logo.bmp());
else else
m_account_btn->SetBitmapBundle(*get_bmp_bundle("user")); m_account_btn->SetBitmapBundle(*get_bmp_bundle("user", 24));
} }
else { else {
m_account_btn->SetBitmapBundle(*get_bmp_bundle("user")); m_account_btn->SetBitmapBundle(*get_bmp_bundle("user", 24));
} }
} }
#endif #endif

View File

@ -860,6 +860,11 @@ ScalableBitmap::ScalableBitmap(wxWindow* parent, boost::filesystem::path& icon_p
wxBitmap::Rescale(bitmap, icon_size); wxBitmap::Rescale(bitmap, icon_size);
m_bmp = wxBitmapBundle(bitmap); m_bmp = wxBitmapBundle(bitmap);
} }
else if (ext == ".jpg") {
bitmap.LoadFile(path, wxBITMAP_TYPE_JPEG);
wxBitmap::Rescale(bitmap, icon_size);
m_bmp = wxBitmapBundle(bitmap);
}
else if (ext == ".svg") { else if (ext == ".svg") {
m_bmp = wxBitmapBundle::FromSVGFile(path, icon_size); m_bmp = wxBitmapBundle::FromSVGFile(path, icon_size);
} }