Preserve catalog widget size when DiskTools are hidden

This commit is contained in:
Mark Long 2016-10-30 17:19:29 -05:00
parent 9e7b408263
commit 315cc2a4af
3 changed files with 13 additions and 2 deletions

View File

@ -17,6 +17,7 @@ DiskExplorer::DiskExplorer(QWidget *parent) : QMainWindow(parent)
m_action_Unload_Disk_Image = 0;
m_disk = 0;
m_horizSizePref = -1;
m_toolsHidden = true;
resize(300,800);
initUi();
@ -190,6 +191,7 @@ void DiskExplorer::handleDiskItemSelectedDefaultOpen(DiskFile *disk, FileDescrip
void DiskExplorer::setDiskToolsVisible(bool visible)
{
m_toolsHidden = !visible;
if (visible)
{
m_gridLayout->setColumnStretch(0,4);
@ -233,7 +235,6 @@ void DiskExplorer::showEvent(QShowEvent *event)
if (m_horizSizePref == -1)
{
m_horizSizePref = this->width();
qDebug() << "New Horiz Size Pref = " << m_horizSizePref;
}
}
@ -248,5 +249,11 @@ void DiskExplorer::closeEvent(QCloseEvent *)
}
}
void DiskExplorer::resizeEvent(QResizeEvent *)
{
if (m_toolsHidden)
{
m_horizSizePref = this->width();
}
}

View File

@ -46,6 +46,7 @@ protected:
void showEvent(QShowEvent *event);
void closeEvent(QCloseEvent *);
void resizeEvent(QResizeEvent *);
protected slots:
void doResize();
@ -72,6 +73,8 @@ private:
int m_horizSizePref;
QList<ViewerBase*> m_viewerList;
bool m_toolsHidden;
};
#endif // DISKEXPLORER_H

View File

@ -29,6 +29,7 @@ public:
QString getPotentialLabel(quint16 address);
virtual bool optionsMenuItems(QMenu *);
bool canPrint() const;
bool canExport() const;