Commit 59ba48a3 authored by Andreas Traczyk's avatar Andreas Traczyk

ui: font size and button margin fixes

Change-Id: I604a0f2422808a1476027f01e3c8d92b3b485a18
parent 421509c7
......@@ -261,7 +261,8 @@ CallWidget::navigated(bool to)
}
}
void CallWidget::updateCustomUI()
void
CallWidget::updateCustomUI()
{
auto scalingRatio = MainWindow::instance().getCurrentScalingRatio();
if (scalingRatio > 1.0) {
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1350</width>
<height>657</height>
<height>664</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -1645,10 +1645,16 @@ Copy and share it with your friends!
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
<height>60</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
......@@ -1656,13 +1662,13 @@ Copy and share it with your friends!
<number>6</number>
</property>
<property name="leftMargin">
<number>10</number>
<number>14</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>10</number>
<number>14</number>
</property>
<property name="bottomMargin">
<number>6</number>
......@@ -1735,9 +1741,9 @@ Copy and share it with your friends!
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
<pointsize>11</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
......
......@@ -174,6 +174,7 @@ ConversationItemDelegate::paintRingConversationItem(QPainter* painter,
infoText2HeightModifier = 2;
} else {
font.setPointSize(fontSize_);
infoTextWidthModifier = 10;
}
auto leftMargin = dx_ + sizeImage_ + dx_;
......
......@@ -153,10 +153,12 @@ void CurrentAccountComboBox::resizeEvent(QResizeEvent* event)
void
CurrentAccountComboBox::setupSettingsButton()
{
gearPoint_.setX(this->width() - gearSize_ - 4 * gearBorder_ + 2);
gearPoint_.setX(this->width() - gearSize_ - 5 * gearBorder_ - 1);
gearPoint_.setY(this->height() / 2 - gearLabel_.height() / 2 - 2 * gearBorder_ + 4.5);
gearLabel_.setGeometry(gearPoint_.x() - 3, gearPoint_.y(),
gearSize_ + 2 * gearBorder_, gearSize_ + 2 * gearBorder_);
gearLabel_.setGeometry(
gearPoint_.x(), gearPoint_.y(),
gearSize_ + 2 * gearBorder_,
gearSize_ + 2 * gearBorder_);
gearLabel_.setMargin(gearBorder_);
}
......
......@@ -281,7 +281,6 @@ MainWindow::closeEvent(QCloseEvent* event)
settings.setValue(SettingsKey::geometry, saveGeometry());
settings.setValue(SettingsKey::windowState, saveState());
}
this->disconnect(activeChangedConnection_);
this->disconnect(screenChangedConnection_);
QMainWindow::closeEvent(event);
}
......@@ -342,17 +341,7 @@ MainWindow::show()
disconnect(screenChangedConnection_);
screenChangedConnection_ = connect(windowHandle(), &QWindow::screenChanged,
this, &MainWindow::slotScreenChanged);
disconnect(activeChangedConnection_);
activeChangedConnection_ = connect(windowHandle(), &QWindow::activeChanged,
[this]() {
auto screenNumber = qApp->desktop()->screenNumber();
windowHandle()->setScreen(nullptr);
QScreen* screen = qApp->screens().at(screenNumber);
windowHandle()->setScreen(screen);
});
auto screenNumber = qApp->desktop()->screenNumber();
QScreen* screen = qApp->screens().at(screenNumber);
currentScalingRatio_ = screen->logicalDotsPerInchX() / 96;
currentScalingRatio_ = 1.0;
qobject_cast<NavWidget*>(ui->navStack->currentWidget())->updateCustomUI();
}
......
......@@ -80,12 +80,11 @@ private:
ScreenEnum lastScr_;
int lastAccountCount_;
Qt::WindowFlags flags_;
float currentScalingRatio_ = 1.0;
float currentScalingRatio_;
void readSettingsFromRegistry();
Ui::MainWindow* ui;
QNetworkConfigurationManager netManager_;
QMetaObject::Connection screenChangedConnection_;
QMetaObject::Connection activeChangedConnection_;
};
......@@ -117,7 +117,7 @@
<number>0</number>
</property>
<property name="rightMargin">
<number>9</number>
<number>14</number>
</property>
<item>
<spacer name="horizontalSpacer_8">
......@@ -1087,7 +1087,7 @@ QPushButton:pressed {background: rgb(230,230, 230); border: 0px; border-radius:
<rect>
<x>0</x>
<y>0</y>
<width>696</width>
<width>691</width>
<height>647</height>
</rect>
</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment