mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 00:33:01 +00:00
memory viewer: Fix resizing down
This commit is contained in:
parent
eec11bfba9
commit
c74b2cb085
@ -204,6 +204,7 @@ memory_viewer_panel::memory_viewer_panel(QWidget* parent, u32 addr)
|
||||
vbox_panel->addSpacing(10);
|
||||
vbox_panel->addLayout(hbox_mem_panel, 1);
|
||||
vbox_panel->addSpacing(10);
|
||||
vbox_panel->setSizeConstraint(QLayout::SetNoConstraint);
|
||||
setLayout(vbox_panel);
|
||||
|
||||
// Events
|
||||
@ -274,8 +275,7 @@ void memory_viewer_panel::resizeEvent(QResizeEvent *event)
|
||||
const QMargins margins = layout()->contentsMargins();
|
||||
|
||||
int free_height = event->size().height()
|
||||
- (layout()->count() * (margins.top() + margins.bottom()))
|
||||
- font_height; // bottom margin to allow shrinking
|
||||
- (layout()->count() * (margins.top() + margins.bottom()));
|
||||
|
||||
for (int i = 0; i < layout()->count(); i++)
|
||||
{
|
||||
@ -283,6 +283,7 @@ void memory_viewer_panel::resizeEvent(QResizeEvent *event)
|
||||
free_height -= layout()->itemAt(i)->sizeHint().height();
|
||||
}
|
||||
|
||||
setMinimumHeight(event->size().height() - free_height + font_height);
|
||||
const u32 new_row_count = std::max(0, free_height) / font_height;
|
||||
|
||||
if (m_rowcount != new_row_count)
|
||||
|
Loading…
x
Reference in New Issue
Block a user