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
@@ -406,7 +406,7 @@ void SplitContainer::layout()
std::vector<ResizeRect> _resizeRects;
this->baseNode_.layout(
Split::modifierStatus == showAddSplitRegions || this->isDragging_,
this->getScale(), _dropRects, _resizeRects);
this->scale(), _dropRects, _resizeRects);
this->dropRects_ = _dropRects;
+1 -1
View File
@@ -560,7 +560,7 @@ void SplitHeader::mouseMoveEvent(QMouseEvent *event)
{
if (this->dragging_)
{
if (distance(this->dragStart_, event->pos()) > 15 * this->getScale())
if (distance(this->dragStart_, event->pos()) > 15 * this->scale())
{
this->split_->drag();
this->dragging_ = false;
+12 -12
View File
@@ -40,7 +40,7 @@ SplitInput::SplitInput(Split *_chatWidget)
// misc
this->installKeyPressedEvent();
this->scaleChangedEvent(this->getScale());
this->scaleChangedEvent(this->scale());
}
void SplitInput::initLayout()
@@ -76,11 +76,11 @@ void SplitInput::initLayout()
// set edit font
this->ui_.textEdit->setFont(
app->fonts->getFont(FontStyle::ChatMedium, this->getScale()));
app->fonts->getFont(FontStyle::ChatMedium, this->scale()));
this->managedConnections_.push_back(app->fonts->fontChanged.connect([=]() {
this->ui_.textEdit->setFont(
app->fonts->getFont(FontStyle::ChatMedium, this->getScale()));
app->fonts->getFont(FontStyle::ChatMedium, this->scale()));
}));
// open emote popup
@@ -111,9 +111,9 @@ void SplitInput::scaleChangedEvent(float scale)
this->updateEmoteButton();
// set maximum height
this->setMaximumHeight(int(150 * this->getScale()));
this->setMaximumHeight(int(150 * this->scale()));
this->ui_.textEdit->setFont(
getApp()->fonts->getFont(FontStyle::ChatMedium, this->getScale()));
getApp()->fonts->getFont(FontStyle::ChatMedium, this->scale()));
}
void SplitInput::themeChangedEvent()
@@ -128,14 +128,14 @@ void SplitInput::themeChangedEvent()
this->ui_.textEdit->setStyleSheet(this->theme->splits.input.styleSheet);
this->ui_.hbox->setMargin(
int((this->theme->isLightTheme() ? 4 : 2) * this->getScale()));
int((this->theme->isLightTheme() ? 4 : 2) * this->scale()));
this->ui_.emoteButton->getLabel().setStyleSheet("color: #000");
}
void SplitInput::updateEmoteButton()
{
float scale = this->getScale();
float scale = this->scale();
QString text = "<img src=':/buttons/emote.svg' width='xD' height='xD' />";
text.replace("xD", QString::number(int(12 * scale)));
@@ -172,8 +172,8 @@ void SplitInput::openEmotePopup()
});
}
this->emotePopup_->resize(int(300 * this->emotePopup_->getScale()),
int(500 * this->emotePopup_->getScale()));
this->emotePopup_->resize(int(300 * this->emotePopup_->scale()),
int(500 * this->emotePopup_->scale()));
this->emotePopup_->loadChannel(this->split_->getChannel());
this->emotePopup_->show();
this->emotePopup_->activateWindow();
@@ -428,7 +428,7 @@ void SplitInput::editTextChanged()
if (text.length() > 0 && getSettings()->showMessageLength)
{
labelText = QString::number(text.length());
labelText = QString::number(text.length());
}
else
{
@@ -444,7 +444,7 @@ void SplitInput::paintEvent(QPaintEvent *)
if (this->theme->isLightTheme())
{
int s = int(3 * this->getScale());
int s = int(3 * this->scale());
QRect rect = this->rect().marginsRemoved(QMargins(s - 1, s - 1, s, s));
painter.fillRect(rect, this->theme->splits.input.background);
@@ -454,7 +454,7 @@ void SplitInput::paintEvent(QPaintEvent *)
}
else
{
int s = int(1 * this->getScale());
int s = int(1 * this->scale());
QRect rect = this->rect().marginsRemoved(QMargins(s - 1, s - 1, s, s));
painter.fillRect(rect, this->theme->splits.input.background);
+1 -1
View File
@@ -149,7 +149,7 @@ void SplitOverlay::paintEvent(QPaintEvent *)
void SplitOverlay::resizeEvent(QResizeEvent *event)
{
float _scale = this->getScale();
float _scale = this->scale();
bool wideEnough = event->size().width() > 150 * _scale;
bool highEnough = event->size().height() > 150 * _scale;