initial appbase integration

This commit is contained in:
fourtf
2018-11-21 21:37:41 +01:00
parent 9472283d76
commit cf26f10b80
26 changed files with 63 additions and 412 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ void Button::paintEvent(QPaintEvent *)
}
QRect rect = this->rect();
int s = this->enableMargin_ ? int(6 * this->getScale()) : 0;
int s = this->enableMargin_ ? int(6 * this->scale()) : 0;
rect.moveLeft(s);
rect.setRight(rect.right() - s - s);
+7 -7
View File
@@ -336,7 +336,7 @@ void ChannelView::layoutVisibleMessages(
auto message = messages[i];
redrawRequired |=
message->layout(layoutWidth, this->getScale(), flags);
message->layout(layoutWidth, this->scale(), flags);
y += message->getHeight();
}
@@ -366,7 +366,7 @@ void ChannelView::updateScrollbar(
{
auto *message = messages[i].get();
message->layout(layoutWidth, this->getScale(), flags);
message->layout(layoutWidth, this->scale(), flags);
h -= message->getHeight();
@@ -784,7 +784,7 @@ void ChannelView::paintEvent(QPaintEvent * /*event*/)
// draw paused sign
if (this->paused())
{
auto a = this->getScale() * 16;
auto a = this->scale() * 16;
auto brush = QBrush(QColor(127, 127, 127, 63));
painter.fillRect(QRectF(this->width() - a, a / 4, a / 4, a), brush);
painter.fillRect(QRectF(this->width() - a / 2, a / 4, a / 4, a), brush);
@@ -918,7 +918,7 @@ void ChannelView::wheelEvent(QWheelEvent *event)
else
{
snapshot[i - 1]->layout(this->getLayoutWidth(),
this->getScale(), this->getFlags());
this->scale(), this->getFlags());
scrollFactor = 1;
currentScrollLeft = snapshot[i - 1]->getHeight();
}
@@ -952,7 +952,7 @@ void ChannelView::wheelEvent(QWheelEvent *event)
else
{
snapshot[i + 1]->layout(this->getLayoutWidth(),
this->getScale(), this->getFlags());
this->scale(), this->getFlags());
scrollFactor = 1;
currentScrollLeft = snapshot[i + 1]->getHeight();
@@ -1605,7 +1605,7 @@ void ChannelView::showUserInfoPopup(const QString &userName)
auto *userPopup = new UserInfoPopup;
userPopup->setData(userName, this->channel_);
userPopup->setActionOnFocusLoss(BaseWindow::Delete);
QPoint offset(int(150 * this->getScale()), int(70 * this->getScale()));
QPoint offset(int(150 * this->scale()), int(70 * this->scale()));
userPopup->move(QCursor::pos() - offset);
userPopup->show();
}
@@ -1684,7 +1684,7 @@ bool ChannelView::tryGetMessageAt(QPoint p,
int ChannelView::getLayoutWidth() const
{
if (this->scrollBar_->isVisible())
return int(this->width() - 8 * this->getScale());
return int(this->width() - 8 * this->scale());
return this->width();
}
+4 -4
View File
@@ -84,12 +84,12 @@ void NotebookTab::themeChangedEvent()
void NotebookTab::updateSize()
{
float scale = getScale();
float scale = this->scale();
int width;
QFontMetrics metrics = getApp()->fonts->getFontMetrics(
FontStyle::UiTabs,
float(qreal(this->getScale()) * this->devicePixelRatioF()));
float(qreal(this->scale()) * this->devicePixelRatioF()));
if (this->hasXButton())
{
@@ -267,7 +267,7 @@ void NotebookTab::paintEvent(QPaintEvent *)
{
auto app = getApp();
QPainter painter(this);
float scale = this->getScale();
float scale = this->scale();
painter.setFont(getApp()->fonts->getFont(
FontStyle::UiTabs,
@@ -572,7 +572,7 @@ QRect NotebookTab::getXRect()
// return QRect();
// }
float s = this->getScale();
float s = this->scale();
return QRect(this->width() - static_cast<int>(20 * s),
static_cast<int>(9 * s), static_cast<int>(16 * s),
static_cast<int>(16 * s));
+1 -1
View File
@@ -48,7 +48,7 @@ void SettingsDialogTab::paintEvent(QPaintEvent *)
this->style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
int a = (this->height() - (20 * this->getScale())) / 2;
int a = (this->height() - (20 * this->scale())) / 2;
QPixmap pixmap = this->ui_.icon.pixmap(
QSize(this->height() - a * 2, this->height() - a * 2));