mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
add removeSplitAct to context menu of VEditWindow
Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
parent
915c25e1a5
commit
d8aa464653
@ -14,11 +14,14 @@ VEditWindow::VEditWindow(VNote *vnote, QWidget *parent)
|
|||||||
|
|
||||||
setTabsClosable(true);
|
setTabsClosable(true);
|
||||||
setMovable(true);
|
setMovable(true);
|
||||||
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
connect(this, &VEditWindow::tabCloseRequested,
|
connect(this, &VEditWindow::tabCloseRequested,
|
||||||
this, &VEditWindow::handleTabCloseRequest);
|
this, &VEditWindow::handleTabCloseRequest);
|
||||||
connect(this, &VEditWindow::tabBarClicked,
|
connect(this, &VEditWindow::tabBarClicked,
|
||||||
this, &VEditWindow::handleTabbarClicked);
|
this, &VEditWindow::handleTabbarClicked);
|
||||||
|
connect(this, &VEditWindow::customContextMenuRequested,
|
||||||
|
this, &VEditWindow::contextMenuRequested);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VEditWindow::setupCornerWidget()
|
void VEditWindow::setupCornerWidget()
|
||||||
@ -294,3 +297,11 @@ void VEditWindow::mousePressEvent(QMouseEvent *event)
|
|||||||
emit getFocused();
|
emit getFocused();
|
||||||
QTabWidget::mousePressEvent(event);
|
QTabWidget::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VEditWindow::contextMenuRequested(QPoint pos)
|
||||||
|
{
|
||||||
|
QMenu menu(this);
|
||||||
|
|
||||||
|
menu.addAction(removeSplitAct);
|
||||||
|
menu.exec(this->mapToGlobal(pos));
|
||||||
|
}
|
||||||
|
@ -51,6 +51,7 @@ private slots:
|
|||||||
void splitWindow();
|
void splitWindow();
|
||||||
void removeSplit();
|
void removeSplit();
|
||||||
void handleTabbarClicked(int index);
|
void handleTabbarClicked(int index);
|
||||||
|
void contextMenuRequested(QPoint pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupCornerWidget();
|
void setupCornerWidget();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user