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