Chore: Proper Lambda Formatting (#2167)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -46,23 +46,30 @@ NotebookTab::NotebookTab(Notebook *notebook)
|
||||
getSettings()->showTabCloseButton.connectSimple(
|
||||
boost::bind(&NotebookTab::hideTabXChanged, this),
|
||||
this->managedConnections_);
|
||||
getSettings()->showTabLive.connect([this](auto, auto) { this->update(); },
|
||||
this->managedConnections_);
|
||||
getSettings()->showTabLive.connect(
|
||||
[this](auto, auto) {
|
||||
this->update();
|
||||
},
|
||||
this->managedConnections_);
|
||||
|
||||
this->setMouseTracking(true);
|
||||
|
||||
this->menu_.addAction("Rename", [this]() { this->showRenameDialog(); });
|
||||
this->menu_.addAction("Rename", [this]() {
|
||||
this->showRenameDialog();
|
||||
});
|
||||
|
||||
this->menu_.addAction("Close",
|
||||
[=]() { this->notebook_->removePage(this->page); });
|
||||
this->menu_.addAction("Close", [=]() {
|
||||
this->notebook_->removePage(this->page);
|
||||
});
|
||||
|
||||
highlightNewMessagesAction_ =
|
||||
new QAction("Enable highlights on new messages", &this->menu_);
|
||||
highlightNewMessagesAction_->setCheckable(true);
|
||||
highlightNewMessagesAction_->setChecked(highlightEnabled_);
|
||||
QObject::connect(
|
||||
highlightNewMessagesAction_, &QAction::triggered,
|
||||
[this](bool checked) { this->highlightEnabled_ = checked; });
|
||||
QObject::connect(highlightNewMessagesAction_, &QAction::triggered,
|
||||
[this](bool checked) {
|
||||
this->highlightEnabled_ = checked;
|
||||
});
|
||||
this->menu_.addAction(highlightNewMessagesAction_);
|
||||
}
|
||||
|
||||
@@ -559,7 +566,7 @@ void NotebookTab::dragEnterEvent(QDragEnterEvent *event)
|
||||
void NotebookTab::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
if (getSettings()->showTabCloseButton &&
|
||||
this->notebook_->getAllowUserTabManagement()) //
|
||||
this->notebook_->getAllowUserTabManagement())
|
||||
{
|
||||
bool overX = this->getXRect().contains(event->pos());
|
||||
|
||||
@@ -575,7 +582,7 @@ void NotebookTab::mouseMoveEvent(QMouseEvent *event)
|
||||
QPoint relPoint = this->mapToParent(event->pos());
|
||||
|
||||
if (this->mouseDown_ && !this->getDesiredRect().contains(relPoint) &&
|
||||
this->notebook_->getAllowUserTabManagement()) //
|
||||
this->notebook_->getAllowUserTabManagement())
|
||||
{
|
||||
int index;
|
||||
QWidget *clickedPage =
|
||||
|
||||
Reference in New Issue
Block a user