Merge branch 'dk_wizard'

This commit is contained in:
David Kocik 2021-02-24 09:22:30 +01:00
commit 19f849a6d9
2 changed files with 11 additions and 3 deletions

View File

@ -1501,6 +1501,7 @@ ConfigWizardIndex::ConfigWizardIndex(wxWindow *parent)
sizer->AddStretchSpacer();
sizer->Add(logo);
SetSizer(sizer);
logo_height = logo->GetBitmap().GetHeight();
Bind(wxEVT_PAINT, &ConfigWizardIndex::on_paint, this);
Bind(wxEVT_MOTION, &ConfigWizardIndex::on_mouse_move, this);
@ -1617,15 +1618,15 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt)
{
const auto size = GetClientSize();
if (size.GetHeight() == 0 || size.GetWidth() == 0) { return; }
wxPaintDC dc(this);
const auto bullet_w = bullet_black.bmp().GetSize().GetWidth();
const auto bullet_h = bullet_black.bmp().GetSize().GetHeight();
const int yoff_icon = bullet_h < em_h ? (em_h - bullet_h) / 2 : 0;
const int yoff_text = bullet_h > em_h ? (bullet_h - em_h) / 2 : 0;
const int yinc = item_height();
int index_width = 0;
unsigned y = 0;
@ -1653,6 +1654,11 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt)
Refresh();
});
}
if ((int)y + logo_height > size.GetHeight())
logo->Hide();
else
logo->Show();
}
void ConfigWizardIndex::on_mouse_move(wxMouseEvent &evt)

View File

@ -518,6 +518,8 @@ private:
ssize_t item_hover;
size_t last_page;
int logo_height;
int item_height() const { return std::max(bullet_black.bmp().GetSize().GetHeight(), em_w) + em_w; }
void on_paint(wxPaintEvent &evt);