ui: moved contentbased sizing to QtWindow
This commit is contained in:
@@ -125,7 +125,7 @@ void QtWindow::setup()
|
||||
setPreviousVisible(false);
|
||||
}
|
||||
|
||||
windowReady();
|
||||
setupDone();
|
||||
}
|
||||
|
||||
void QtWindow::setCancelAble(bool cancelable)
|
||||
@@ -318,6 +318,24 @@ void QtWindow::handleClose()
|
||||
emit canceled();
|
||||
}
|
||||
|
||||
void QtWindow::setupDone()
|
||||
{
|
||||
windowReady();
|
||||
|
||||
QSize actualSize = m_window->sizeHint() + QSize(50, 50);
|
||||
QSize preferredSize = sizeHint();
|
||||
|
||||
if (actualSize.height() > preferredSize.height())
|
||||
{
|
||||
resize(actualSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
resize(preferredSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void QtWindow::addLogo()
|
||||
{
|
||||
QtDeviceScaledPixmap coatiLogo((ResourcePaths::getGuiPath() + "window/logo.png").c_str());
|
||||
|
||||
@@ -67,6 +67,7 @@ protected:
|
||||
virtual void handlePrevious();
|
||||
virtual void handleClose();
|
||||
|
||||
void setupDone();
|
||||
void addLogo();
|
||||
|
||||
QWidget* m_window;
|
||||
|
||||
@@ -15,6 +15,15 @@ QtProjectWizzardWindow::QtProjectWizzardWindow(QWidget *parent)
|
||||
{
|
||||
}
|
||||
|
||||
QSize QtProjectWizzardWindow::sizeHint() const
|
||||
{
|
||||
if (content())
|
||||
{
|
||||
return content()->preferredWindowSize();
|
||||
}
|
||||
return QSize();
|
||||
}
|
||||
|
||||
QtProjectWizzardContent* QtProjectWizzardWindow::content() const
|
||||
{
|
||||
return m_content;
|
||||
@@ -65,18 +74,6 @@ void QtProjectWizzardWindow::windowReady()
|
||||
updateTitle("NEW PROJECT");
|
||||
|
||||
m_content->windowReady();
|
||||
|
||||
QSize actualSize = m_window->sizeHint() + QSize(50, 50);
|
||||
QSize preferredSize = content()->preferredWindowSize();
|
||||
|
||||
if (actualSize.height() > preferredSize.height())
|
||||
{
|
||||
resize(actualSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
resize(preferredSize);
|
||||
}
|
||||
}
|
||||
|
||||
void QtProjectWizzardWindow::handleNext()
|
||||
|
||||
@@ -13,6 +13,7 @@ class QtProjectWizzardWindow
|
||||
|
||||
public:
|
||||
QtProjectWizzardWindow(QWidget *parent);
|
||||
virtual QSize sizeHint() const override;
|
||||
|
||||
QtProjectWizzardContent* content() const;
|
||||
void setContent(QtProjectWizzardContent* content);
|
||||
|
||||
Reference in New Issue
Block a user