refactor: add explicit this-> where possible
I have knowingly skipped some files/portions of files where this would create merge conflicts for other open PRs.
This commit is contained in:
@@ -751,7 +751,7 @@ bool BaseWindow::applyLastBoundsCheck()
|
||||
void BaseWindow::resizeEvent(QResizeEvent *)
|
||||
{
|
||||
// Queue up save because: Window resized
|
||||
if (!flags_.has(DisableLayoutSave))
|
||||
if (!this->flags_.has(DisableLayoutSave))
|
||||
{
|
||||
getApp()->getWindows()->queueSave();
|
||||
}
|
||||
@@ -766,7 +766,7 @@ void BaseWindow::moveEvent(QMoveEvent *event)
|
||||
{
|
||||
// Queue up save because: Window position changed
|
||||
#ifdef CHATTERINO
|
||||
if (!flags_.has(DisableLayoutSave))
|
||||
if (!this->flags_.has(DisableLayoutSave))
|
||||
{
|
||||
getApp()->getWindows()->queueSave();
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ void DraggablePopup::mouseMoveEvent(QMouseEvent *event)
|
||||
|
||||
void DraggablePopup::togglePinned()
|
||||
{
|
||||
this->isPinned_ = !isPinned_;
|
||||
if (isPinned_)
|
||||
this->isPinned_ = !this->isPinned_;
|
||||
if (this->isPinned_)
|
||||
{
|
||||
this->windowDeactivateAction = WindowDeactivateAction::Nothing;
|
||||
this->pinButton_->setSource(this->pinEnabledSource_);
|
||||
@@ -111,7 +111,7 @@ void DraggablePopup::togglePinned()
|
||||
}
|
||||
Button *DraggablePopup::createPinButton()
|
||||
{
|
||||
this->pinButton_ = new SvgButton(pinDisabledSource_, this, {3, 3});
|
||||
this->pinButton_ = new SvgButton(this->pinDisabledSource_, this, {3, 3});
|
||||
this->pinButton_->setScaleIndependentSize(18, 18);
|
||||
this->pinButton_->setToolTip("Pin Window");
|
||||
|
||||
|
||||
@@ -356,7 +356,7 @@ void Notebook::select(QWidget *page, bool focusPage)
|
||||
// Hide the previously selected page
|
||||
this->selectedPage_->hide();
|
||||
|
||||
auto *item = this->findItem(selectedPage_);
|
||||
auto *item = this->findItem(this->selectedPage_);
|
||||
if (!item)
|
||||
{
|
||||
return;
|
||||
@@ -830,7 +830,7 @@ void Notebook::performHorizontalLayout(const LayoutContext &ctx, bool animated)
|
||||
auto isLast = &item == &ctx.items.back();
|
||||
|
||||
auto fitsInLine = ((isLast ? ctx.addButtonWidth : 0) + x +
|
||||
item.tab->width()) <= width();
|
||||
item.tab->width()) <= this->width();
|
||||
|
||||
if (!isFirst && !fitsInLine)
|
||||
{
|
||||
@@ -884,7 +884,7 @@ void Notebook::performHorizontalLayout(const LayoutContext &ctx, bool animated)
|
||||
if (this->selectedPage_ != nullptr)
|
||||
{
|
||||
this->selectedPage_->move(0, 0);
|
||||
this->selectedPage_->resize(width(), tabsStart);
|
||||
this->selectedPage_->resize(this->width(), tabsStart);
|
||||
this->selectedPage_->raise();
|
||||
}
|
||||
}
|
||||
@@ -905,7 +905,7 @@ void Notebook::performHorizontalLayout(const LayoutContext &ctx, bool animated)
|
||||
if (this->selectedPage_ != nullptr)
|
||||
{
|
||||
this->selectedPage_->move(0, y);
|
||||
this->selectedPage_->resize(width(), height() - y);
|
||||
this->selectedPage_->resize(this->width(), this->height() - y);
|
||||
this->selectedPage_->raise();
|
||||
}
|
||||
}
|
||||
@@ -1010,7 +1010,7 @@ void Notebook::performVerticalLayout(const LayoutContext &ctx, bool animated)
|
||||
{
|
||||
if (isRight)
|
||||
{
|
||||
int distanceFromRight = width() - x;
|
||||
int distanceFromRight = this->width() - x;
|
||||
largestWidth = std::max(
|
||||
largestWidth, consumedButtonWidths - distanceFromRight);
|
||||
}
|
||||
@@ -1069,7 +1069,7 @@ void Notebook::performVerticalLayout(const LayoutContext &ctx, bool animated)
|
||||
if (this->selectedPage_ != nullptr)
|
||||
{
|
||||
this->selectedPage_->move(0, 0);
|
||||
this->selectedPage_->resize(tabsStart, height());
|
||||
this->selectedPage_->resize(tabsStart, this->height());
|
||||
this->selectedPage_->raise();
|
||||
}
|
||||
}
|
||||
@@ -1087,7 +1087,7 @@ void Notebook::performVerticalLayout(const LayoutContext &ctx, bool animated)
|
||||
if (this->selectedPage_ != nullptr)
|
||||
{
|
||||
this->selectedPage_->move(x, 0);
|
||||
this->selectedPage_->resize(width() - x, height());
|
||||
this->selectedPage_->resize(this->width() - x, this->height());
|
||||
this->selectedPage_->raise();
|
||||
}
|
||||
}
|
||||
@@ -1158,8 +1158,8 @@ void Notebook::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
painter.fillRect(this->lineOffset_,
|
||||
int(NOTEBOOK_TAB_HEIGHT * scale),
|
||||
width() - this->lineOffset_, int(2 * scale),
|
||||
this->theme->tabs.dividerLine);
|
||||
this->width() - this->lineOffset_,
|
||||
int(2 * scale), this->theme->tabs.dividerLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ protected:
|
||||
|
||||
const QList<Item> items()
|
||||
{
|
||||
return items_;
|
||||
return this->items_;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -229,7 +229,7 @@ void Window::addCustomTitlebarButtons()
|
||||
this->userLabel_->mapToGlobal(
|
||||
this->userLabel_->rect().bottomLeft()));
|
||||
});
|
||||
this->userLabel_->setMinimumWidth(20 * scale());
|
||||
this->userLabel_->setMinimumWidth(20 * this->scale());
|
||||
|
||||
// streamer mode
|
||||
this->streamerModeTitlebarIcon_ =
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace chatterino {
|
||||
Button::Button(BaseWidget *parent)
|
||||
: BaseWidget(parent)
|
||||
{
|
||||
connect(&effectTimer_, &QTimer::timeout, this,
|
||||
connect(&this->effectTimer_, &QTimer::timeout, this,
|
||||
&Button::onMouseEffectTimeout);
|
||||
|
||||
this->effectTimer_.setInterval(20);
|
||||
@@ -269,10 +269,10 @@ void Button::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
leftClicked();
|
||||
this->leftClicked();
|
||||
}
|
||||
|
||||
clicked(event->button());
|
||||
this->clicked(event->button());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ void Button::onMouseEffectTimeout()
|
||||
{
|
||||
bool performUpdate = false;
|
||||
|
||||
if (mouseOver_)
|
||||
if (this->mouseOver_)
|
||||
{
|
||||
if (this->hoverMultiplier_ != 1)
|
||||
{
|
||||
@@ -336,7 +336,7 @@ void Button::onMouseEffectTimeout()
|
||||
|
||||
if (performUpdate)
|
||||
{
|
||||
update();
|
||||
this->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ void Button::fancyPaint(QPainter &painter)
|
||||
|
||||
if (this->hoverMultiplier_ > 0)
|
||||
{
|
||||
QRadialGradient gradient(QPointF(mousePos_),
|
||||
QRadialGradient gradient(QPointF(this->mousePos_),
|
||||
static_cast<qreal>(this->width()) / 2.0);
|
||||
|
||||
gradient.setColorAt(0, QColor(c.red(), c.green(), c.blue(),
|
||||
@@ -454,8 +454,8 @@ void Button::fancyPaint(QPainter &painter)
|
||||
painter.setBrush(QColor(c.red(), c.green(), c.blue(),
|
||||
int((1 - effect.progress) * 95)));
|
||||
painter.drawEllipse(QPointF(effect.position),
|
||||
effect.progress * qreal(width()) * 2,
|
||||
effect.progress * qreal(width()) * 2);
|
||||
effect.progress * qreal(this->width()) * 2,
|
||||
effect.progress * qreal(this->width()) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ void DrawnButton::paintContent(QPainter &painter)
|
||||
|
||||
QRect centerBox;
|
||||
centerBox.setSize({thickness, thickness});
|
||||
centerBox.moveCenter(rect().center());
|
||||
centerBox.moveCenter(this->rect().center());
|
||||
|
||||
painter.fillRect(centerBox, fg);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ void SignalLabel::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
leftMouseDown();
|
||||
this->leftMouseDown();
|
||||
}
|
||||
|
||||
event->ignore();
|
||||
@@ -26,7 +26,7 @@ void SignalLabel::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
leftMouseUp();
|
||||
this->leftMouseUp();
|
||||
}
|
||||
|
||||
event->ignore();
|
||||
|
||||
@@ -626,7 +626,7 @@ void UserInfoPopup::themeChangedEvent()
|
||||
|
||||
void UserInfoPopup::scaleChangedEvent(float /*scale*/)
|
||||
{
|
||||
themeChangedEvent();
|
||||
this->themeChangedEvent();
|
||||
|
||||
QTimer::singleShot(20, this, [this] {
|
||||
auto geo = this->geometry();
|
||||
@@ -815,7 +815,7 @@ void UserInfoPopup::setData(const QString &name,
|
||||
if (isId)
|
||||
{
|
||||
this->userId_ = name.mid(idPrefix.size());
|
||||
updateNotes();
|
||||
this->updateNotes();
|
||||
this->userName_ = "";
|
||||
}
|
||||
else
|
||||
|
||||
@@ -461,7 +461,7 @@ Scrollbar *ChannelView::scrollbar()
|
||||
|
||||
bool ChannelView::pausable() const
|
||||
{
|
||||
return pausable_;
|
||||
return this->pausable_;
|
||||
}
|
||||
|
||||
void ChannelView::setPausable(bool value)
|
||||
@@ -867,7 +867,7 @@ bool ChannelView::hasSelection()
|
||||
void ChannelView::clearSelection()
|
||||
{
|
||||
this->selection_ = Selection();
|
||||
queueLayout();
|
||||
this->queueLayout();
|
||||
}
|
||||
|
||||
void ChannelView::copySelectedText()
|
||||
@@ -1543,7 +1543,7 @@ void ChannelView::paintEvent(QPaintEvent *event)
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||
painter.fillRect(rect(), this->messageColors_.channelBackground);
|
||||
painter.fillRect(this->rect(), this->messageColors_.channelBackground);
|
||||
|
||||
// draw messages
|
||||
this->drawMessages(painter, event->rect());
|
||||
@@ -1961,7 +1961,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||
int messageIndex;
|
||||
|
||||
// no message under cursor
|
||||
if (!tryGetMessageAt(event->pos(), layout, relativePos, messageIndex))
|
||||
if (!this->tryGetMessageAt(event->pos(), layout, relativePos, messageIndex))
|
||||
{
|
||||
this->setCursor(Qt::ArrowCursor);
|
||||
this->tooltipWidget_->hide();
|
||||
@@ -2164,9 +2164,9 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
|
||||
QPointF relativePos;
|
||||
int messageIndex;
|
||||
|
||||
if (!tryGetMessageAt(event->pos(), layout, relativePos, messageIndex))
|
||||
if (!this->tryGetMessageAt(event->pos(), layout, relativePos, messageIndex))
|
||||
{
|
||||
setCursor(Qt::ArrowCursor);
|
||||
this->setCursor(Qt::ArrowCursor);
|
||||
auto &messagesSnapshot = this->getMessagesSnapshot();
|
||||
if (messagesSnapshot.size() == 0)
|
||||
{
|
||||
@@ -2271,7 +2271,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
|
||||
int messageIndex;
|
||||
|
||||
bool foundElement =
|
||||
tryGetMessageAt(event->pos(), layout, relativePos, messageIndex);
|
||||
this->tryGetMessageAt(event->pos(), layout, relativePos, messageIndex);
|
||||
|
||||
// check if mouse was pressed
|
||||
if (event->button() == Qt::LeftButton)
|
||||
@@ -2915,7 +2915,7 @@ void ChannelView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
QPointF relativePos;
|
||||
int messageIndex;
|
||||
|
||||
if (!tryGetMessageAt(event->pos(), layout, relativePos, messageIndex))
|
||||
if (!this->tryGetMessageAt(event->pos(), layout, relativePos, messageIndex))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
|
||||
, model_(model)
|
||||
{
|
||||
this->model_->setParent(this);
|
||||
this->tableView_->setModel(model_);
|
||||
this->tableView_->setModel(this->model_);
|
||||
// disabling word-wrap somehow prevent '/'-prefixed commands from being elided
|
||||
this->tableView_->setWordWrap(false);
|
||||
this->tableView_->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
@@ -66,7 +66,7 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
|
||||
|
||||
for (auto &&row : rows)
|
||||
{
|
||||
model_->removeRow(row);
|
||||
this->model_->removeRow(row);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -171,8 +171,8 @@ bool EditableModelView::filterSearchResults(const QString &query,
|
||||
|
||||
for (int j : columnSelect)
|
||||
{
|
||||
QModelIndex idx = model_->index(i, j);
|
||||
QVariant a = model_->data(idx);
|
||||
QModelIndex idx = this->model_->index(i, j);
|
||||
QVariant a = this->model_->data(idx);
|
||||
if (a.toString().contains(query, Qt::CaseInsensitive))
|
||||
{
|
||||
foundMatch = true;
|
||||
@@ -181,7 +181,7 @@ bool EditableModelView::filterSearchResults(const QString &query,
|
||||
}
|
||||
}
|
||||
|
||||
tableView_->setRowHidden(i, !foundMatch);
|
||||
this->tableView_->setRowHidden(i, !foundMatch);
|
||||
}
|
||||
|
||||
return searchFoundSomething;
|
||||
@@ -194,19 +194,19 @@ void EditableModelView::filterSearchResultsHotkey(
|
||||
|
||||
for (int i = 0; i < rowAmount; i++)
|
||||
{
|
||||
QModelIndex idx = model_->index(i, 1);
|
||||
QVariant a = model_->data(idx);
|
||||
QModelIndex idx = this->model_->index(i, 1);
|
||||
QVariant a = this->model_->data(idx);
|
||||
auto seq = qvariant_cast<QKeySequence>(a);
|
||||
|
||||
// todo: Make this fuzzy match, right now only exact matches happen
|
||||
// so ctrl+f won't match ctrl+shift+f shortcuts
|
||||
if (keySequenceQuery.matches(seq) != QKeySequence::NoMatch)
|
||||
{
|
||||
tableView_->showRow(i);
|
||||
this->tableView_->showRow(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
tableView_->hideRow(i);
|
||||
this->tableView_->hideRow(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,8 +224,8 @@ void EditableModelView::moveRow(int dir)
|
||||
return;
|
||||
}
|
||||
|
||||
model_->moveRows(model_->index(row, 0), row, selected.size(),
|
||||
model_->index(row + dir, 0), row + dir);
|
||||
this->model_->moveRows(this->model_->index(row, 0), row, selected.size(),
|
||||
this->model_->index(row + dir, 0), row + dir);
|
||||
this->tableView_->selectRow(row + dir);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ NotebookTab::NotebookTab(Notebook *notebook)
|
||||
this->closeMultipleTabsMenu_ = new QMenu("Close Multiple Tabs", this);
|
||||
|
||||
const auto tabDirection = getSettings()->tabDirection.getEnum();
|
||||
this->menu_.addMenu(closeMultipleTabsMenu_);
|
||||
this->menu_.addMenu(this->closeMultipleTabsMenu_);
|
||||
getSettings()->tabDirection.connect(
|
||||
[this](int val) {
|
||||
this->recreateCloseMultipleTabsMenu(
|
||||
@@ -150,15 +150,15 @@ NotebookTab::NotebookTab(Notebook *notebook)
|
||||
this->notebook_->duplicatePage(this->page);
|
||||
});
|
||||
|
||||
highlightNewMessagesAction_ =
|
||||
this->highlightNewMessagesAction_ =
|
||||
new QAction("Mark Tab as Unread on New Messages", &this->menu_);
|
||||
highlightNewMessagesAction_->setCheckable(true);
|
||||
highlightNewMessagesAction_->setChecked(highlightEnabled_);
|
||||
QObject::connect(highlightNewMessagesAction_, &QAction::triggered,
|
||||
this->highlightNewMessagesAction_->setCheckable(true);
|
||||
this->highlightNewMessagesAction_->setChecked(this->highlightEnabled_);
|
||||
QObject::connect(this->highlightNewMessagesAction_, &QAction::triggered,
|
||||
[this](bool checked) {
|
||||
this->highlightEnabled_ = checked;
|
||||
});
|
||||
this->menu_.addAction(highlightNewMessagesAction_);
|
||||
this->menu_.addAction(this->highlightNewMessagesAction_);
|
||||
|
||||
this->menu_.addSeparator();
|
||||
|
||||
@@ -824,7 +824,7 @@ bool NotebookTab::hasHighlightsEnabled() const
|
||||
|
||||
QRect NotebookTab::getDesiredRect() const
|
||||
{
|
||||
return QRect(this->positionAnimationDesiredPoint_, size());
|
||||
return QRect(this->positionAnimationDesiredPoint_, this->size());
|
||||
}
|
||||
|
||||
void NotebookTab::tabSizeChanged()
|
||||
@@ -1081,7 +1081,7 @@ void NotebookTab::mousePressEvent(QMouseEvent *event)
|
||||
this->mouseDown_ = true;
|
||||
this->mouseDownX_ = this->getXRect().contains(event->pos());
|
||||
|
||||
this->notebook_->select(page);
|
||||
this->notebook_->select(this->page);
|
||||
}
|
||||
|
||||
this->update();
|
||||
|
||||
@@ -66,7 +66,8 @@ int ResizingTextEdit::heightForWidth(int) const
|
||||
{
|
||||
auto margins = this->contentsMargins();
|
||||
|
||||
return margins.top() + document()->size().height() + margins.bottom() + 5;
|
||||
return margins.top() + this->document()->size().height() +
|
||||
margins.bottom() + 5;
|
||||
}
|
||||
|
||||
QString ResizingTextEdit::textUnderCursor(bool *hadSpace) const
|
||||
@@ -256,7 +257,7 @@ void ResizingTextEdit::setCompleter(QCompleter *c)
|
||||
this->completer_->setCompletionMode(QCompleter::InlineCompletion);
|
||||
this->completer_->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
QObject::connect(completer_,
|
||||
QObject::connect(this->completer_,
|
||||
static_cast<void (QCompleter::*)(const QString &)>(
|
||||
&QCompleter::highlighted),
|
||||
this, &ResizingTextEdit::insertCompletion);
|
||||
|
||||
@@ -36,7 +36,7 @@ void SettingsDialogTab::setSelected(bool _selected)
|
||||
// height: <checkbox-size>px;
|
||||
|
||||
this->selected_ = _selected;
|
||||
selectedChanged(selected_);
|
||||
this->selectedChanged(this->selected_);
|
||||
}
|
||||
|
||||
SettingsPage *SettingsDialogTab::page()
|
||||
@@ -69,10 +69,10 @@ void SettingsDialogTab::paintEvent(QPaintEvent *)
|
||||
|
||||
pad = (3 * pad) + iconSize;
|
||||
|
||||
this->style()->drawItemText(&painter,
|
||||
QRect(pad, 0, width() - pad, height()),
|
||||
Qt::AlignLeft | Qt::AlignVCenter,
|
||||
this->palette(), false, this->ui_.labelText);
|
||||
this->style()->drawItemText(
|
||||
&painter, QRect(pad, 0, this->width() - pad, this->height()),
|
||||
Qt::AlignLeft | Qt::AlignVCenter, this->palette(), false,
|
||||
this->ui_.labelText);
|
||||
}
|
||||
|
||||
void SettingsDialogTab::mousePressEvent(QMouseEvent *event)
|
||||
@@ -89,12 +89,12 @@ void SettingsDialogTab::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
const QString &SettingsDialogTab::name() const
|
||||
{
|
||||
return name_;
|
||||
return this->name_;
|
||||
}
|
||||
|
||||
SettingsTabId SettingsDialogTab::id() const
|
||||
{
|
||||
return id_;
|
||||
return this->id_;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -155,7 +155,7 @@ QSize FlowLayout::minimumSize() const
|
||||
size = size.expandedTo(item->minimumSize());
|
||||
}
|
||||
|
||||
const QMargins margins = contentsMargins();
|
||||
const QMargins margins = this->contentsMargins();
|
||||
size += QSize(margins.left() + margins.right(),
|
||||
margins.top() + margins.bottom());
|
||||
return size;
|
||||
|
||||
@@ -90,7 +90,7 @@ ExternalToolsPage::ExternalToolsPage()
|
||||
y->addWidget(z);
|
||||
this->setLayout(y);
|
||||
|
||||
this->initLayout(*view);
|
||||
this->initLayout(*this->view);
|
||||
}
|
||||
|
||||
bool ExternalToolsPage::filterElements(const QString &query)
|
||||
|
||||
@@ -77,7 +77,7 @@ KeyboardSettingsPage::KeyboardSettingsPage()
|
||||
}
|
||||
});
|
||||
|
||||
QObject::connect(view_->getTableView(), &QTableView::doubleClicked,
|
||||
QObject::connect(this->view_->getTableView(), &QTableView::doubleClicked,
|
||||
[view, model](const QModelIndex &clicked) {
|
||||
tableCellClicked(clicked, view, model);
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@ SettingWidget::SettingWidget(const QString &mainKeyword)
|
||||
this->vLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
this->hLayout->setContentsMargins(0, 0, 0, 0);
|
||||
this->vLayout->addLayout(hLayout);
|
||||
this->vLayout->addLayout(this->hLayout);
|
||||
|
||||
this->keywords.append(mainKeyword);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ Split::Split(QWidget *parent)
|
||||
getApp()->getAccounts()->twitch.currentUserChanged.connect([this] {
|
||||
this->updateInputPlaceholder();
|
||||
}));
|
||||
this->signalHolder_.managedConnect(channelChanged, [this] {
|
||||
this->signalHolder_.managedConnect(this->channelChanged, [this] {
|
||||
this->updateInputPlaceholder();
|
||||
});
|
||||
this->updateInputPlaceholder();
|
||||
|
||||
@@ -340,7 +340,7 @@ SplitContainer::Position SplitContainer::releaseSplit(Split *split)
|
||||
split->setParent(nullptr);
|
||||
Position position = node->releaseSplit();
|
||||
this->layout();
|
||||
if (splits_.empty())
|
||||
if (this->splits_.empty())
|
||||
{
|
||||
this->setSelected(nullptr);
|
||||
this->setCursor(Qt::PointingHandCursor);
|
||||
@@ -366,7 +366,7 @@ SplitContainer::Position SplitContainer::deleteSplit(Split *split)
|
||||
assert(split != nullptr);
|
||||
|
||||
split->deleteLater();
|
||||
return releaseSplit(split);
|
||||
return this->releaseSplit(split);
|
||||
}
|
||||
|
||||
void SplitContainer::selectNextSplit(SplitDirection direction)
|
||||
@@ -468,13 +468,13 @@ Split *SplitContainer::getTopRightSplit(Node &node)
|
||||
case Node::Type::VerticalContainer:
|
||||
if (!node.getChildren().empty())
|
||||
{
|
||||
return getTopRightSplit(*node.getChildren().front());
|
||||
return this->getTopRightSplit(*node.getChildren().front());
|
||||
}
|
||||
break;
|
||||
case Node::Type::HorizontalContainer:
|
||||
if (!node.getChildren().empty())
|
||||
{
|
||||
return getTopRightSplit(*node.getChildren().back());
|
||||
return this->getTopRightSplit(*node.getChildren().back());
|
||||
}
|
||||
break;
|
||||
default:;
|
||||
@@ -635,7 +635,7 @@ void SplitContainer::paintSplitBorder(Node *node, QPainter *painter)
|
||||
case Node::Type::HorizontalContainer: {
|
||||
for (const auto &child : node->children_)
|
||||
{
|
||||
paintSplitBorder(child.get(), painter);
|
||||
this->paintSplitBorder(child.get(), painter);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -650,7 +650,7 @@ void SplitContainer::paintEvent(QPaintEvent * /*event*/)
|
||||
|
||||
if (this->splits_.empty())
|
||||
{
|
||||
painter.fillRect(rect(), this->theme->splits.background);
|
||||
painter.fillRect(this->rect(), this->theme->splits.background);
|
||||
|
||||
painter.setPen(this->theme->splits.header.text);
|
||||
|
||||
@@ -670,7 +670,7 @@ void SplitContainer::paintEvent(QPaintEvent * /*event*/)
|
||||
}
|
||||
}
|
||||
|
||||
painter.drawText(rect(), text, QTextOption(Qt::AlignCenter));
|
||||
painter.drawText(this->rect(), text, QTextOption(Qt::AlignCenter));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -725,7 +725,7 @@ void SplitContainer::paintEvent(QPaintEvent * /*event*/)
|
||||
? this->theme->tabs.selected.backgrounds.regular
|
||||
: this->theme->tabs.selected.backgrounds.unfocused);
|
||||
|
||||
painter.fillRect(0, 0, width(), 1, accentColor);
|
||||
painter.fillRect(0, 0, this->width(), 1, accentColor);
|
||||
}
|
||||
|
||||
void SplitContainer::dragEnterEvent(QDragEnterEvent *event)
|
||||
@@ -1152,7 +1152,7 @@ void SplitContainer::Node::insertSplitRelative(Split *_split,
|
||||
}
|
||||
|
||||
// parent != nullptr
|
||||
if (parent_->type_ == toContainerType(_direction))
|
||||
if (this->parent_->type_ == toContainerType(_direction))
|
||||
{
|
||||
// hell yeah we'll just insert it next to outselves
|
||||
this->insertNextToThis(_split, _direction);
|
||||
@@ -1238,7 +1238,7 @@ SplitContainer::Position SplitContainer::Node::releaseSplit()
|
||||
{
|
||||
assert(this->type_ == Type::Split);
|
||||
|
||||
if (parent_ == nullptr)
|
||||
if (this->parent_ == nullptr)
|
||||
{
|
||||
this->type_ = Type::EmptyRoot;
|
||||
this->split_ = nullptr;
|
||||
@@ -1667,7 +1667,7 @@ void SplitContainer::ResizeHandle::mouseMoveEvent(QMouseEvent *event)
|
||||
assert(node != nullptr);
|
||||
assert(node->parent_ != nullptr);
|
||||
|
||||
const auto &siblings = node->parent_->getChildren();
|
||||
const auto &siblings = this->node->parent_->getChildren();
|
||||
auto it = std::ranges::find_if(siblings, [this](const auto &n) {
|
||||
return n.get() == this->node;
|
||||
});
|
||||
|
||||
@@ -979,10 +979,10 @@ void SplitHeader::paintEvent(QPaintEvent * /*event*/)
|
||||
border = this->theme->splits.header.focusedBorder;
|
||||
}
|
||||
|
||||
painter.fillRect(rect(), background);
|
||||
painter.fillRect(this->rect(), background);
|
||||
painter.setPen(border);
|
||||
painter.drawRect(0, 0, width() - 1, height() - 2);
|
||||
painter.fillRect(0, height() - 1, width(), 1, background);
|
||||
painter.drawRect(0, 0, this->width() - 1, this->height() - 2);
|
||||
painter.fillRect(0, this->height() - 1, this->width(), 1, background);
|
||||
}
|
||||
|
||||
void SplitHeader::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
@@ -374,7 +374,7 @@ QString SplitInput::handleSendMessage(const std::vector<QString> &arguments)
|
||||
if (!c->isTwitchChannel() || this->replyTarget_ == nullptr)
|
||||
{
|
||||
// standard message send behavior
|
||||
QString message = ui_.textEdit->toPlainText();
|
||||
QString message = this->ui_.textEdit->toPlainText();
|
||||
|
||||
message = message.replace('\n', ' ');
|
||||
QString sendMessage =
|
||||
@@ -544,7 +544,7 @@ void SplitInput::addShortcuts()
|
||||
|
||||
if (this->prevIndex_ == (this->prevMsg_.size()))
|
||||
{
|
||||
this->currMsg_ = ui_.textEdit->toPlainText();
|
||||
this->currMsg_ = this->ui_.textEdit->toPlainText();
|
||||
}
|
||||
|
||||
this->prevIndex_--;
|
||||
@@ -568,7 +568,7 @@ void SplitInput::addShortcuts()
|
||||
return "";
|
||||
}
|
||||
bool cursorToEnd = true;
|
||||
QString message = ui_.textEdit->toPlainText();
|
||||
QString message = this->ui_.textEdit->toPlainText();
|
||||
|
||||
if (this->prevIndex_ != (this->prevMsg_.size() - 1) &&
|
||||
this->prevIndex_ != this->prevMsg_.size())
|
||||
|
||||
Reference in New Issue
Block a user