Merge remote-tracking branch 'main_repo/master' into git_is_pepega

check if works with new changes from master
This commit is contained in:
Mm2PL
2020-04-29 00:42:12 +02:00
17 changed files with 108 additions and 56 deletions
+10 -7
View File
@@ -319,7 +319,9 @@ void ChannelView::scaleChangedEvent(float scale)
{
auto factor = this->qtFontScale();
#ifdef Q_OS_MACOS
factor = scale * 80.f / this->logicalDpiX() * this->devicePixelRatioF();
factor = scale * 80.f /
std::max<float>(
0.01, this->logicalDpiX() * this->devicePixelRatioF());
#endif
this->goToBottom_->getLabel().setFont(
getFonts()->getFont(FontStyle::UiMedium, factor));
@@ -426,8 +428,9 @@ void ChannelView::updateScrollbar(
if (h < 0) // break condition
{
this->scrollBar_->setLargeChange((messages.size() - i) +
qreal(h) / message->getHeight());
this->scrollBar_->setLargeChange(
(messages.size() - i) +
qreal(h) / std::max<int>(1, message->getHeight()));
showScrollbar = true;
break;
@@ -964,8 +967,8 @@ void ChannelView::wheelEvent(QWheelEvent *event)
if (delta > 0)
{
qreal scrollFactor = fmod(desired, 1);
qreal currentScrollLeft =
int(scrollFactor * snapshot[i]->getHeight());
qreal currentScrollLeft = std::max<qreal>(
0.01, int(scrollFactor * snapshot[i]->getHeight()));
for (; i >= 0; i--)
{
@@ -997,8 +1000,8 @@ void ChannelView::wheelEvent(QWheelEvent *event)
{
delta = -delta;
qreal scrollFactor = 1 - fmod(desired, 1);
qreal currentScrollLeft =
int(scrollFactor * snapshot[i]->getHeight());
qreal currentScrollLeft = std::max<qreal>(
0.01, int(scrollFactor * snapshot[i]->getHeight()));
for (; i < snapshotLength; i++)
{
+5 -6
View File
@@ -282,12 +282,11 @@ void NotebookTab::paintEvent(QPaintEvent *)
QPainter painter(this);
float scale = this->scale();
painter.setFont(getApp()->fonts->getFont(
FontStyle::UiTabs,
scale * 96.f / this->logicalDpiX() * deviceDpi(this)));
QFontMetrics metrics = app->fonts->getFontMetrics(
FontStyle::UiTabs,
scale * 96.f / this->logicalDpiX() * deviceDpi(this));
auto div = std::max<float>(0.01f, this->logicalDpiX() * deviceDpi(this));
painter.setFont(
getApp()->fonts->getFont(FontStyle::UiTabs, scale * 96.f / div));
QFontMetrics metrics =
app->fonts->getFontMetrics(FontStyle::UiTabs, scale * 96.f / div);
int height = int(scale * NOTEBOOK_TAB_HEIGHT);