mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +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);
|
||||
setMovable(true);
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
connect(this, &VEditWindow::tabCloseRequested,
|
||||
this, &VEditWindow::handleTabCloseRequest);
|
||||
connect(this, &VEditWindow::tabBarClicked,
|
||||
this, &VEditWindow::handleTabbarClicked);
|
||||
connect(this, &VEditWindow::customContextMenuRequested,
|
||||
this, &VEditWindow::contextMenuRequested);
|
||||
}
|
||||
|
||||
void VEditWindow::setupCornerWidget()
|
||||
@ -294,3 +297,11 @@ void VEditWindow::mousePressEvent(QMouseEvent *event)
|
||||
emit getFocused();
|
||||
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 removeSplit();
|
||||
void handleTabbarClicked(int index);
|
||||
void contextMenuRequested(QPoint pos);
|
||||
|
||||
private:
|
||||
void setupCornerWidget();
|
||||
|
Loading…
x
Reference in New Issue
Block a user