Fix text alignment of storage page error message

This commit is contained in:
Noisyfox 2025-05-26 17:54:10 +08:00
parent 5335357f4c
commit 6b9ce834e1

View file

@ -520,7 +520,7 @@ void ImageGrid::render(wxDC& dc)
dc.DrawRectangle({ 0, 0, size.x, size.y });
if (!m_status_msg.IsEmpty()) {
auto si = m_status_icon.GetBmpSize();
auto st = dc.GetTextExtent(m_status_msg);
auto st = dc.GetMultiLineTextExtent(m_status_msg);
auto rect = wxRect{0, 0, max(st.x, si.x), si.y + 26 + st.y}.CenterIn(wxRect({0, 0}, size));
dc.DrawBitmap(m_status_icon.bmp(), rect.x + (rect.width - si.x) / 2, rect.y);
dc.SetTextForeground(wxColor(0x909090));