refactor: simplify updateSize
This commit is contained in:
parent
dd0812c201
commit
8533348c88
2 changed files with 10 additions and 10 deletions
|
|
@ -316,8 +316,8 @@ void MainWindow::toggleLogVisible(bool visible)
|
||||||
ui->textLog->setVisible(false);
|
ui->textLog->setVisible(false);
|
||||||
m_AppConfig.setLogExpanded(false);
|
m_AppConfig.setLogExpanded(false);
|
||||||
}
|
}
|
||||||
// 10 ms is long enough to process events and quick enough to not see the visual change.
|
// 1 ms delay is to make sure we have left the function before calling updateSize
|
||||||
QTimer::singleShot(10, this, &MainWindow::updateSize);
|
QTimer::singleShot(1, this, &MainWindow::updateSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onShown()
|
void MainWindow::onShown()
|
||||||
|
|
@ -469,16 +469,10 @@ void MainWindow::resetCore()
|
||||||
|
|
||||||
void MainWindow::updateSize()
|
void MainWindow::updateSize()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
// On mac os the titlebar is part of the height so we need to adjust our Y coord to avoid moving the window up
|
|
||||||
const auto kTitleBarOffset = 28;
|
|
||||||
#else
|
|
||||||
const auto kTitleBarOffset = 0;
|
|
||||||
#endif
|
|
||||||
if (ui->textLog->isVisible()) {
|
if (ui->textLog->isVisible()) {
|
||||||
setMaximumHeight(16777215);
|
setMaximumHeight(16777215);
|
||||||
setMaximumWidth(16777215);
|
setMaximumWidth(16777215);
|
||||||
setGeometry(x(), y() + kTitleBarOffset, m_expandedSize.width(), m_expandedSize.height());
|
resize(m_expandedSize);
|
||||||
} else {
|
} else {
|
||||||
adjustSize();
|
adjustSize();
|
||||||
// Prevent Resize with log collapsed
|
// Prevent Resize with log collapsed
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
|
@ -91,6 +91,12 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="lblMyFingerprint">
|
<widget class="QLabel" name="lblMyFingerprint">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p>TLS enabled (<a href="#"><span style=" text-decoration: underline; color:#4285f4;">fingerprint</span></a>)</p></body></html></string>
|
<string><html><head/><body><p>TLS enabled (<a href="#"><span style=" text-decoration: underline; color:#4285f4;">fingerprint</span></a>)</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue