mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
change statusTip to toolTip
This commit is contained in:
parent
ed84e66bae
commit
5486929a8d
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
const QString VConfigManager::orgName = QString("tamlok");
|
const QString VConfigManager::orgName = QString("tamlok");
|
||||||
const QString VConfigManager::appName = QString("vnote");
|
const QString VConfigManager::appName = QString("vnote");
|
||||||
const QString VConfigManager::c_version = QString("1.1");
|
const QString VConfigManager::c_version = QString("1.2");
|
||||||
const QString VConfigManager::dirConfigFileName = QString(".vnote.json");
|
const QString VConfigManager::dirConfigFileName = QString(".vnote.json");
|
||||||
const QString VConfigManager::defaultConfigFilePath = QString(":/resources/vnote.ini");
|
const QString VConfigManager::defaultConfigFilePath = QString(":/resources/vnote.ini");
|
||||||
|
|
||||||
|
@ -33,42 +33,42 @@ void VDirectoryTree::initActions()
|
|||||||
{
|
{
|
||||||
newRootDirAct = new QAction(QIcon(":/resources/icons/create_rootdir.svg"),
|
newRootDirAct = new QAction(QIcon(":/resources/icons/create_rootdir.svg"),
|
||||||
tr("New &Root Directory"), this);
|
tr("New &Root Directory"), this);
|
||||||
newRootDirAct->setStatusTip(tr("Create a new root directory in current notebook"));
|
newRootDirAct->setToolTip(tr("Create a new root directory in current notebook"));
|
||||||
connect(newRootDirAct, &QAction::triggered,
|
connect(newRootDirAct, &QAction::triggered,
|
||||||
this, &VDirectoryTree::newRootDirectory);
|
this, &VDirectoryTree::newRootDirectory);
|
||||||
|
|
||||||
newSubDirAct = new QAction(tr("&New Sub-Directory"), this);
|
newSubDirAct = new QAction(tr("&New Sub-Directory"), this);
|
||||||
newSubDirAct->setStatusTip(tr("Create a new sub-directory"));
|
newSubDirAct->setToolTip(tr("Create a new sub-directory"));
|
||||||
connect(newSubDirAct, &QAction::triggered,
|
connect(newSubDirAct, &QAction::triggered,
|
||||||
this, &VDirectoryTree::newSubDirectory);
|
this, &VDirectoryTree::newSubDirectory);
|
||||||
|
|
||||||
deleteDirAct = new QAction(QIcon(":/resources/icons/delete_dir.svg"),
|
deleteDirAct = new QAction(QIcon(":/resources/icons/delete_dir.svg"),
|
||||||
tr("&Delete"), this);
|
tr("&Delete"), this);
|
||||||
deleteDirAct->setStatusTip(tr("Delete selected directory"));
|
deleteDirAct->setToolTip(tr("Delete selected directory"));
|
||||||
connect(deleteDirAct, &QAction::triggered,
|
connect(deleteDirAct, &QAction::triggered,
|
||||||
this, &VDirectoryTree::deleteDirectory);
|
this, &VDirectoryTree::deleteDirectory);
|
||||||
|
|
||||||
dirInfoAct = new QAction(QIcon(":/resources/icons/dir_info.svg"),
|
dirInfoAct = new QAction(QIcon(":/resources/icons/dir_info.svg"),
|
||||||
tr("&Info"), this);
|
tr("&Info"), this);
|
||||||
dirInfoAct->setStatusTip(tr("View and edit current directory's information"));
|
dirInfoAct->setToolTip(tr("View and edit current directory's information"));
|
||||||
connect(dirInfoAct, &QAction::triggered,
|
connect(dirInfoAct, &QAction::triggered,
|
||||||
this, &VDirectoryTree::editDirectoryInfo);
|
this, &VDirectoryTree::editDirectoryInfo);
|
||||||
|
|
||||||
copyAct = new QAction(QIcon(":/resources/icons/copy.svg"),
|
copyAct = new QAction(QIcon(":/resources/icons/copy.svg"),
|
||||||
tr("&Copy"), this);
|
tr("&Copy"), this);
|
||||||
copyAct->setStatusTip(tr("Copy selected directories"));
|
copyAct->setToolTip(tr("Copy selected directories"));
|
||||||
connect(copyAct, &QAction::triggered,
|
connect(copyAct, &QAction::triggered,
|
||||||
this, &VDirectoryTree::copySelectedDirectories);
|
this, &VDirectoryTree::copySelectedDirectories);
|
||||||
|
|
||||||
cutAct = new QAction(QIcon(":/resources/icons/cut.svg"),
|
cutAct = new QAction(QIcon(":/resources/icons/cut.svg"),
|
||||||
tr("C&ut"), this);
|
tr("C&ut"), this);
|
||||||
cutAct->setStatusTip(tr("Cut selected directories"));
|
cutAct->setToolTip(tr("Cut selected directories"));
|
||||||
connect(cutAct, &QAction::triggered,
|
connect(cutAct, &QAction::triggered,
|
||||||
this, &VDirectoryTree::cutSelectedDirectories);
|
this, &VDirectoryTree::cutSelectedDirectories);
|
||||||
|
|
||||||
pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"),
|
pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"),
|
||||||
tr("&Paste"), this);
|
tr("&Paste"), this);
|
||||||
pasteAct->setStatusTip(tr("Paste directories under this directory"));
|
pasteAct->setToolTip(tr("Paste directories under this directory"));
|
||||||
connect(pasteAct, &QAction::triggered,
|
connect(pasteAct, &QAction::triggered,
|
||||||
this, &VDirectoryTree::pasteDirectoriesInCurDir);
|
this, &VDirectoryTree::pasteDirectoriesInCurDir);
|
||||||
}
|
}
|
||||||
@ -252,6 +252,7 @@ void VDirectoryTree::contextMenuRequested(QPoint pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
menu.setToolTipsVisible(true);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
// Context menu on the free space of the QTreeWidget
|
// Context menu on the free space of the QTreeWidget
|
||||||
|
@ -44,19 +44,19 @@ void VEditWindow::initTabActions()
|
|||||||
{
|
{
|
||||||
m_locateAct = new QAction(QIcon(":/resources/icons/locate_note.svg"),
|
m_locateAct = new QAction(QIcon(":/resources/icons/locate_note.svg"),
|
||||||
tr("Locate To Directory"), this);
|
tr("Locate To Directory"), this);
|
||||||
m_locateAct->setStatusTip(tr("Locate the directory of current note"));
|
m_locateAct->setToolTip(tr("Locate the directory of current note"));
|
||||||
connect(m_locateAct, &QAction::triggered,
|
connect(m_locateAct, &QAction::triggered,
|
||||||
this, &VEditWindow::handleLocateAct);
|
this, &VEditWindow::handleLocateAct);
|
||||||
|
|
||||||
m_moveLeftAct = new QAction(QIcon(":/resources/icons/move_tab_left.svg"),
|
m_moveLeftAct = new QAction(QIcon(":/resources/icons/move_tab_left.svg"),
|
||||||
tr("Move One Split Left"), this);
|
tr("Move One Split Left"), this);
|
||||||
m_moveLeftAct->setStatusTip(tr("Move current tab to the split on the left"));
|
m_moveLeftAct->setToolTip(tr("Move current tab to the split on the left"));
|
||||||
connect(m_moveLeftAct, &QAction::triggered,
|
connect(m_moveLeftAct, &QAction::triggered,
|
||||||
this, &VEditWindow::handleMoveLeftAct);
|
this, &VEditWindow::handleMoveLeftAct);
|
||||||
|
|
||||||
m_moveRightAct = new QAction(QIcon(":/resources/icons/move_tab_right.svg"),
|
m_moveRightAct = new QAction(QIcon(":/resources/icons/move_tab_right.svg"),
|
||||||
tr("Move One Split Right"), this);
|
tr("Move One Split Right"), this);
|
||||||
m_moveRightAct->setStatusTip(tr("Move current tab to the split on the right"));
|
m_moveRightAct->setToolTip(tr("Move current tab to the split on the right"));
|
||||||
connect(m_moveRightAct, &QAction::triggered,
|
connect(m_moveRightAct, &QAction::triggered,
|
||||||
this, &VEditWindow::handleMoveRightAct);
|
this, &VEditWindow::handleMoveRightAct);
|
||||||
}
|
}
|
||||||
@ -68,6 +68,7 @@ void VEditWindow::setupCornerWidget()
|
|||||||
"", this);
|
"", this);
|
||||||
leftBtn->setProperty("CornerBtn", true);
|
leftBtn->setProperty("CornerBtn", true);
|
||||||
VOpenedListMenu *leftMenu = new VOpenedListMenu(this);
|
VOpenedListMenu *leftMenu = new VOpenedListMenu(this);
|
||||||
|
leftMenu->setToolTipsVisible(true);
|
||||||
connect(leftMenu, &VOpenedListMenu::fileTriggered,
|
connect(leftMenu, &VOpenedListMenu::fileTriggered,
|
||||||
this, &VEditWindow::tabListJump);
|
this, &VEditWindow::tabListJump);
|
||||||
leftBtn->setMenu(leftMenu);
|
leftBtn->setMenu(leftMenu);
|
||||||
@ -77,13 +78,13 @@ void VEditWindow::setupCornerWidget()
|
|||||||
// Actions
|
// Actions
|
||||||
splitAct = new QAction(QIcon(":/resources/icons/split_window.svg"),
|
splitAct = new QAction(QIcon(":/resources/icons/split_window.svg"),
|
||||||
tr("Split"), this);
|
tr("Split"), this);
|
||||||
splitAct->setStatusTip(tr("Split current window vertically"));
|
splitAct->setToolTip(tr("Split current window vertically"));
|
||||||
connect(splitAct, &QAction::triggered,
|
connect(splitAct, &QAction::triggered,
|
||||||
this, &VEditWindow::splitWindow);
|
this, &VEditWindow::splitWindow);
|
||||||
|
|
||||||
removeSplitAct = new QAction(QIcon(":/resources/icons/remove_split.svg"),
|
removeSplitAct = new QAction(QIcon(":/resources/icons/remove_split.svg"),
|
||||||
tr("Remove split"), this);
|
tr("Remove split"), this);
|
||||||
removeSplitAct->setStatusTip(tr("Remove current split window"));
|
removeSplitAct->setToolTip(tr("Remove current split window"));
|
||||||
connect(removeSplitAct, &QAction::triggered,
|
connect(removeSplitAct, &QAction::triggered,
|
||||||
this, &VEditWindow::removeSplit);
|
this, &VEditWindow::removeSplit);
|
||||||
|
|
||||||
@ -91,6 +92,7 @@ void VEditWindow::setupCornerWidget()
|
|||||||
"", this);
|
"", this);
|
||||||
rightBtn->setProperty("CornerBtn", true);
|
rightBtn->setProperty("CornerBtn", true);
|
||||||
QMenu *rightMenu = new QMenu(this);
|
QMenu *rightMenu = new QMenu(this);
|
||||||
|
rightMenu->setToolTipsVisible(true);
|
||||||
rightMenu->addAction(splitAct);
|
rightMenu->addAction(splitAct);
|
||||||
rightMenu->addAction(removeSplitAct);
|
rightMenu->addAction(removeSplitAct);
|
||||||
rightBtn->setMenu(rightMenu);
|
rightBtn->setMenu(rightMenu);
|
||||||
@ -421,6 +423,7 @@ void VEditWindow::mousePressEvent(QMouseEvent *event)
|
|||||||
void VEditWindow::contextMenuRequested(QPoint pos)
|
void VEditWindow::contextMenuRequested(QPoint pos)
|
||||||
{
|
{
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
menu.setToolTipsVisible(true);
|
||||||
|
|
||||||
if (canRemoveSplit()) {
|
if (canRemoveSplit()) {
|
||||||
menu.addAction(removeSplitAct);
|
menu.addAction(removeSplitAct);
|
||||||
@ -431,6 +434,7 @@ void VEditWindow::contextMenuRequested(QPoint pos)
|
|||||||
void VEditWindow::tabbarContextMenuRequested(QPoint p_pos)
|
void VEditWindow::tabbarContextMenuRequested(QPoint p_pos)
|
||||||
{
|
{
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
menu.setToolTipsVisible(true);
|
||||||
|
|
||||||
QTabBar *bar = tabBar();
|
QTabBar *bar = tabBar();
|
||||||
int tab = bar->tabAt(p_pos);
|
int tab = bar->tabAt(p_pos);
|
||||||
|
@ -44,37 +44,37 @@ void VFileList::initActions()
|
|||||||
{
|
{
|
||||||
newFileAct = new QAction(QIcon(":/resources/icons/create_note.svg"),
|
newFileAct = new QAction(QIcon(":/resources/icons/create_note.svg"),
|
||||||
tr("&New Note"), this);
|
tr("&New Note"), this);
|
||||||
newFileAct->setStatusTip(tr("Create a note in current directory"));
|
newFileAct->setToolTip(tr("Create a note in current directory"));
|
||||||
connect(newFileAct, SIGNAL(triggered(bool)),
|
connect(newFileAct, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(newFile()));
|
this, SLOT(newFile()));
|
||||||
|
|
||||||
deleteFileAct = new QAction(QIcon(":/resources/icons/delete_note.svg"),
|
deleteFileAct = new QAction(QIcon(":/resources/icons/delete_note.svg"),
|
||||||
tr("&Delete"), this);
|
tr("&Delete"), this);
|
||||||
deleteFileAct->setStatusTip(tr("Delete selected note"));
|
deleteFileAct->setToolTip(tr("Delete selected note"));
|
||||||
connect(deleteFileAct, SIGNAL(triggered(bool)),
|
connect(deleteFileAct, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(deleteFile()));
|
this, SLOT(deleteFile()));
|
||||||
|
|
||||||
fileInfoAct = new QAction(QIcon(":/resources/icons/note_info.svg"),
|
fileInfoAct = new QAction(QIcon(":/resources/icons/note_info.svg"),
|
||||||
tr("&Info"), this);
|
tr("&Info"), this);
|
||||||
fileInfoAct->setStatusTip(tr("View and edit current note's information"));
|
fileInfoAct->setToolTip(tr("View and edit current note's information"));
|
||||||
connect(fileInfoAct, SIGNAL(triggered(bool)),
|
connect(fileInfoAct, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(fileInfo()));
|
this, SLOT(fileInfo()));
|
||||||
|
|
||||||
copyAct = new QAction(QIcon(":/resources/icons/copy.svg"),
|
copyAct = new QAction(QIcon(":/resources/icons/copy.svg"),
|
||||||
tr("&Copy"), this);
|
tr("&Copy"), this);
|
||||||
copyAct->setStatusTip(tr("Copy selected notes"));
|
copyAct->setToolTip(tr("Copy selected notes"));
|
||||||
connect(copyAct, &QAction::triggered,
|
connect(copyAct, &QAction::triggered,
|
||||||
this, &VFileList::copySelectedFiles);
|
this, &VFileList::copySelectedFiles);
|
||||||
|
|
||||||
cutAct = new QAction(QIcon(":/resources/icons/cut.svg"),
|
cutAct = new QAction(QIcon(":/resources/icons/cut.svg"),
|
||||||
tr("C&ut"), this);
|
tr("C&ut"), this);
|
||||||
cutAct->setStatusTip(tr("Cut selected notes"));
|
cutAct->setToolTip(tr("Cut selected notes"));
|
||||||
connect(cutAct, &QAction::triggered,
|
connect(cutAct, &QAction::triggered,
|
||||||
this, &VFileList::cutSelectedFiles);
|
this, &VFileList::cutSelectedFiles);
|
||||||
|
|
||||||
pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"),
|
pasteAct = new QAction(QIcon(":/resources/icons/paste.svg"),
|
||||||
tr("&Paste"), this);
|
tr("&Paste"), this);
|
||||||
pasteAct->setStatusTip(tr("Paste notes in current directory"));
|
pasteAct->setToolTip(tr("Paste notes in current directory"));
|
||||||
connect(pasteAct, &QAction::triggered,
|
connect(pasteAct, &QAction::triggered,
|
||||||
this, &VFileList::pasteFilesInCurDir);
|
this, &VFileList::pasteFilesInCurDir);
|
||||||
}
|
}
|
||||||
@ -269,6 +269,7 @@ void VFileList::contextMenuRequested(QPoint pos)
|
|||||||
{
|
{
|
||||||
QListWidgetItem *item = fileList->itemAt(pos);
|
QListWidgetItem *item = fileList->itemAt(pos);
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
menu.setToolTipsVisible(true);
|
||||||
|
|
||||||
if (!m_directory) {
|
if (!m_directory) {
|
||||||
return;
|
return;
|
||||||
|
@ -304,21 +304,23 @@ void VMainWindow::initHelpMenu()
|
|||||||
void VMainWindow::initMarkdownMenu()
|
void VMainWindow::initMarkdownMenu()
|
||||||
{
|
{
|
||||||
QMenu *markdownMenu = menuBar()->addMenu(tr("&Markdown"));
|
QMenu *markdownMenu = menuBar()->addMenu(tr("&Markdown"));
|
||||||
|
markdownMenu->setToolTipsVisible(true);
|
||||||
QMenu *converterMenu = markdownMenu->addMenu(tr("&Converter"));
|
QMenu *converterMenu = markdownMenu->addMenu(tr("&Converter"));
|
||||||
|
converterMenu->setToolTipsVisible(true);
|
||||||
|
|
||||||
QActionGroup *converterAct = new QActionGroup(this);
|
QActionGroup *converterAct = new QActionGroup(this);
|
||||||
QAction *markedAct = new QAction(tr("Marked"), converterAct);
|
QAction *markedAct = new QAction(tr("Marked"), converterAct);
|
||||||
markedAct->setStatusTip(tr("Use Marked to convert Markdown to HTML (re-open current tabs to make it work)"));
|
markedAct->setToolTip(tr("Use Marked to convert Markdown to HTML (re-open current tabs to make it work)"));
|
||||||
markedAct->setCheckable(true);
|
markedAct->setCheckable(true);
|
||||||
markedAct->setData(int(MarkdownConverterType::Marked));
|
markedAct->setData(int(MarkdownConverterType::Marked));
|
||||||
|
|
||||||
QAction *hoedownAct = new QAction(tr("Hoedown"), converterAct);
|
QAction *hoedownAct = new QAction(tr("Hoedown"), converterAct);
|
||||||
hoedownAct->setStatusTip(tr("Use Hoedown to convert Markdown to HTML (re-open current tabs to make it work)"));
|
hoedownAct->setToolTip(tr("Use Hoedown to convert Markdown to HTML (re-open current tabs to make it work)"));
|
||||||
hoedownAct->setCheckable(true);
|
hoedownAct->setCheckable(true);
|
||||||
hoedownAct->setData(int(MarkdownConverterType::Hoedown));
|
hoedownAct->setData(int(MarkdownConverterType::Hoedown));
|
||||||
|
|
||||||
QAction *markdownitAct = new QAction(tr("Markdown-it"), converterAct);
|
QAction *markdownitAct = new QAction(tr("Markdown-it"), converterAct);
|
||||||
markdownitAct->setStatusTip(tr("Use Markdown-it to convert Markdown to HTML (re-open current tabs to make it work)"));
|
markdownitAct->setToolTip(tr("Use Markdown-it to convert Markdown to HTML (re-open current tabs to make it work)"));
|
||||||
markdownitAct->setCheckable(true);
|
markdownitAct->setCheckable(true);
|
||||||
markdownitAct->setData(int(MarkdownConverterType::MarkdownIt));
|
markdownitAct->setData(int(MarkdownConverterType::MarkdownIt));
|
||||||
|
|
||||||
@ -349,7 +351,7 @@ void VMainWindow::initMarkdownMenu()
|
|||||||
initRenderBackgroundMenu(markdownMenu);
|
initRenderBackgroundMenu(markdownMenu);
|
||||||
|
|
||||||
QAction *mermaidAct = new QAction(tr("&Mermaid Diagram"), this);
|
QAction *mermaidAct = new QAction(tr("&Mermaid Diagram"), this);
|
||||||
mermaidAct->setStatusTip(tr("Enable Mermaid for graph and diagram"));
|
mermaidAct->setToolTip(tr("Enable Mermaid for graph and diagram"));
|
||||||
mermaidAct->setCheckable(true);
|
mermaidAct->setCheckable(true);
|
||||||
connect(mermaidAct, &QAction::triggered,
|
connect(mermaidAct, &QAction::triggered,
|
||||||
this, &VMainWindow::enableMermaid);
|
this, &VMainWindow::enableMermaid);
|
||||||
@ -358,7 +360,7 @@ void VMainWindow::initMarkdownMenu()
|
|||||||
mermaidAct->setChecked(vconfig.getEnableMermaid());
|
mermaidAct->setChecked(vconfig.getEnableMermaid());
|
||||||
|
|
||||||
QAction *mathjaxAct = new QAction(tr("Math&jax"), this);
|
QAction *mathjaxAct = new QAction(tr("Math&jax"), this);
|
||||||
mathjaxAct->setStatusTip(tr("Enable Mathjax for math support in Markdown"));
|
mathjaxAct->setToolTip(tr("Enable Mathjax for math support in Markdown"));
|
||||||
mathjaxAct->setCheckable(true);
|
mathjaxAct->setCheckable(true);
|
||||||
connect(mathjaxAct, &QAction::triggered,
|
connect(mathjaxAct, &QAction::triggered,
|
||||||
this, &VMainWindow::enableMathjax);
|
this, &VMainWindow::enableMathjax);
|
||||||
@ -375,11 +377,12 @@ void VMainWindow::initViewMenu()
|
|||||||
void VMainWindow::initFileMenu()
|
void VMainWindow::initFileMenu()
|
||||||
{
|
{
|
||||||
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
|
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
|
||||||
|
fileMenu->setToolTipsVisible(true);
|
||||||
|
|
||||||
// Import notes from files.
|
// Import notes from files.
|
||||||
m_importNoteAct = new QAction(QIcon(":/resources/icons/import_note.svg"),
|
m_importNoteAct = new QAction(QIcon(":/resources/icons/import_note.svg"),
|
||||||
tr("&Import Notes From Files"), this);
|
tr("&Import Notes From Files"), this);
|
||||||
m_importNoteAct->setStatusTip(tr("Import notes from files into current directory"));
|
m_importNoteAct->setToolTip(tr("Import notes from files into current directory"));
|
||||||
connect(m_importNoteAct, &QAction::triggered,
|
connect(m_importNoteAct, &QAction::triggered,
|
||||||
this, &VMainWindow::importNoteFromFile);
|
this, &VMainWindow::importNoteFromFile);
|
||||||
m_importNoteAct->setEnabled(false);
|
m_importNoteAct->setEnabled(false);
|
||||||
@ -387,13 +390,13 @@ void VMainWindow::initFileMenu()
|
|||||||
// Settings.
|
// Settings.
|
||||||
QAction *settingsAct = new QAction(QIcon(":/resources/icons/settings.svg"),
|
QAction *settingsAct = new QAction(QIcon(":/resources/icons/settings.svg"),
|
||||||
tr("Settings"), this);
|
tr("Settings"), this);
|
||||||
settingsAct->setStatusTip(tr("View and change settings for VNote"));
|
settingsAct->setToolTip(tr("View and change settings for VNote"));
|
||||||
connect(settingsAct, &QAction::triggered,
|
connect(settingsAct, &QAction::triggered,
|
||||||
this, &VMainWindow::viewSettings);
|
this, &VMainWindow::viewSettings);
|
||||||
|
|
||||||
// Exit.
|
// Exit.
|
||||||
QAction *exitAct = new QAction(tr("Exit"), this);
|
QAction *exitAct = new QAction(tr("Exit"), this);
|
||||||
exitAct->setStatusTip(tr("Exit VNote"));
|
exitAct->setToolTip(tr("Exit VNote"));
|
||||||
exitAct->setShortcut(QKeySequence("Ctrl+Q"));
|
exitAct->setShortcut(QKeySequence("Ctrl+Q"));
|
||||||
connect(exitAct, &QAction::triggered,
|
connect(exitAct, &QAction::triggered,
|
||||||
this, &VMainWindow::close);
|
this, &VMainWindow::close);
|
||||||
@ -408,59 +411,60 @@ void VMainWindow::initFileMenu()
|
|||||||
void VMainWindow::initEditMenu()
|
void VMainWindow::initEditMenu()
|
||||||
{
|
{
|
||||||
QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
|
QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
|
||||||
|
editMenu->setToolTipsVisible(true);
|
||||||
|
|
||||||
// Insert image.
|
// Insert image.
|
||||||
m_insertImageAct = new QAction(QIcon(":/resources/icons/insert_image.svg"),
|
m_insertImageAct = new QAction(QIcon(":/resources/icons/insert_image.svg"),
|
||||||
tr("Insert &Image"), this);
|
tr("Insert &Image"), this);
|
||||||
m_insertImageAct->setStatusTip(tr("Insert an image from file into current note"));
|
m_insertImageAct->setToolTip(tr("Insert an image from file into current note"));
|
||||||
connect(m_insertImageAct, &QAction::triggered,
|
connect(m_insertImageAct, &QAction::triggered,
|
||||||
this, &VMainWindow::insertImage);
|
this, &VMainWindow::insertImage);
|
||||||
|
|
||||||
// Find/Replace.
|
// Find/Replace.
|
||||||
m_findReplaceAct = new QAction(QIcon(":/resources/icons/find_replace.svg"),
|
m_findReplaceAct = new QAction(QIcon(":/resources/icons/find_replace.svg"),
|
||||||
tr("Find/Replace"), this);
|
tr("Find/Replace"), this);
|
||||||
m_findReplaceAct->setStatusTip(tr("Open Find/Replace dialog to search in current note"));
|
m_findReplaceAct->setToolTip(tr("Open Find/Replace dialog to search in current note"));
|
||||||
m_findReplaceAct->setShortcut(QKeySequence::Find);
|
m_findReplaceAct->setShortcut(QKeySequence::Find);
|
||||||
connect(m_findReplaceAct, &QAction::triggered,
|
connect(m_findReplaceAct, &QAction::triggered,
|
||||||
this, &VMainWindow::openFindDialog);
|
this, &VMainWindow::openFindDialog);
|
||||||
|
|
||||||
m_findNextAct = new QAction(tr("Find Next"), this);
|
m_findNextAct = new QAction(tr("Find Next"), this);
|
||||||
m_findNextAct->setStatusTip(tr("Find next occurence"));
|
m_findNextAct->setToolTip(tr("Find next occurence"));
|
||||||
m_findNextAct->setShortcut(QKeySequence::FindNext);
|
m_findNextAct->setShortcut(QKeySequence::FindNext);
|
||||||
connect(m_findNextAct, SIGNAL(triggered(bool)),
|
connect(m_findNextAct, SIGNAL(triggered(bool)),
|
||||||
m_findReplaceDialog, SLOT(findNext()));
|
m_findReplaceDialog, SLOT(findNext()));
|
||||||
|
|
||||||
m_findPreviousAct = new QAction(tr("Find Previous"), this);
|
m_findPreviousAct = new QAction(tr("Find Previous"), this);
|
||||||
m_findPreviousAct->setStatusTip(tr("Find previous occurence"));
|
m_findPreviousAct->setToolTip(tr("Find previous occurence"));
|
||||||
m_findPreviousAct->setShortcut(QKeySequence::FindPrevious);
|
m_findPreviousAct->setShortcut(QKeySequence::FindPrevious);
|
||||||
connect(m_findPreviousAct, SIGNAL(triggered(bool)),
|
connect(m_findPreviousAct, SIGNAL(triggered(bool)),
|
||||||
m_findReplaceDialog, SLOT(findPrevious()));
|
m_findReplaceDialog, SLOT(findPrevious()));
|
||||||
|
|
||||||
m_replaceAct = new QAction(tr("Replace"), this);
|
m_replaceAct = new QAction(tr("Replace"), this);
|
||||||
m_replaceAct->setStatusTip(tr("Replace current occurence"));
|
m_replaceAct->setToolTip(tr("Replace current occurence"));
|
||||||
m_replaceAct->setShortcut(QKeySequence::Replace);
|
m_replaceAct->setShortcut(QKeySequence::Replace);
|
||||||
connect(m_replaceAct, SIGNAL(triggered(bool)),
|
connect(m_replaceAct, SIGNAL(triggered(bool)),
|
||||||
m_findReplaceDialog, SLOT(replace()));
|
m_findReplaceDialog, SLOT(replace()));
|
||||||
|
|
||||||
m_replaceFindAct = new QAction(tr("Replace && Find"), this);
|
m_replaceFindAct = new QAction(tr("Replace && Find"), this);
|
||||||
m_replaceFindAct->setStatusTip(tr("Replace current occurence and find the next one"));
|
m_replaceFindAct->setToolTip(tr("Replace current occurence and find the next one"));
|
||||||
connect(m_replaceFindAct, SIGNAL(triggered(bool)),
|
connect(m_replaceFindAct, SIGNAL(triggered(bool)),
|
||||||
m_findReplaceDialog, SLOT(replaceFind()));
|
m_findReplaceDialog, SLOT(replaceFind()));
|
||||||
|
|
||||||
m_replaceAllAct = new QAction(tr("Replace All"), this);
|
m_replaceAllAct = new QAction(tr("Replace All"), this);
|
||||||
m_replaceAllAct->setStatusTip(tr("Replace all occurences in current note"));
|
m_replaceAllAct->setToolTip(tr("Replace all occurences in current note"));
|
||||||
connect(m_replaceAllAct, SIGNAL(triggered(bool)),
|
connect(m_replaceAllAct, SIGNAL(triggered(bool)),
|
||||||
m_findReplaceDialog, SLOT(replaceAll()));
|
m_findReplaceDialog, SLOT(replaceAll()));
|
||||||
|
|
||||||
QAction *searchedWordAct = new QAction(tr("Highlight Searched Pattern"), this);
|
QAction *searchedWordAct = new QAction(tr("Highlight Searched Pattern"), this);
|
||||||
searchedWordAct->setStatusTip(tr("Highlight all occurences of searched pattern"));
|
searchedWordAct->setToolTip(tr("Highlight all occurences of searched pattern"));
|
||||||
searchedWordAct->setCheckable(true);
|
searchedWordAct->setCheckable(true);
|
||||||
connect(searchedWordAct, &QAction::triggered,
|
connect(searchedWordAct, &QAction::triggered,
|
||||||
this, &VMainWindow::changeHighlightSearchedWord);
|
this, &VMainWindow::changeHighlightSearchedWord);
|
||||||
|
|
||||||
// Expand Tab into spaces.
|
// Expand Tab into spaces.
|
||||||
QAction *expandTabAct = new QAction(tr("&Expand Tab"), this);
|
QAction *expandTabAct = new QAction(tr("&Expand Tab"), this);
|
||||||
expandTabAct->setStatusTip(tr("Expand entered Tab to spaces"));
|
expandTabAct->setToolTip(tr("Expand entered Tab to spaces"));
|
||||||
expandTabAct->setCheckable(true);
|
expandTabAct->setCheckable(true);
|
||||||
connect(expandTabAct, &QAction::triggered,
|
connect(expandTabAct, &QAction::triggered,
|
||||||
this, &VMainWindow::changeExpandTab);
|
this, &VMainWindow::changeExpandTab);
|
||||||
@ -468,15 +472,15 @@ void VMainWindow::initEditMenu()
|
|||||||
// Tab stop width.
|
// Tab stop width.
|
||||||
QActionGroup *tabStopWidthAct = new QActionGroup(this);
|
QActionGroup *tabStopWidthAct = new QActionGroup(this);
|
||||||
QAction *twoSpaceTabAct = new QAction(tr("2 Spaces"), tabStopWidthAct);
|
QAction *twoSpaceTabAct = new QAction(tr("2 Spaces"), tabStopWidthAct);
|
||||||
twoSpaceTabAct->setStatusTip(tr("Expand Tab to 2 spaces"));
|
twoSpaceTabAct->setToolTip(tr("Expand Tab to 2 spaces"));
|
||||||
twoSpaceTabAct->setCheckable(true);
|
twoSpaceTabAct->setCheckable(true);
|
||||||
twoSpaceTabAct->setData(2);
|
twoSpaceTabAct->setData(2);
|
||||||
QAction *fourSpaceTabAct = new QAction(tr("4 Spaces"), tabStopWidthAct);
|
QAction *fourSpaceTabAct = new QAction(tr("4 Spaces"), tabStopWidthAct);
|
||||||
fourSpaceTabAct->setStatusTip(tr("Expand Tab to 4 spaces"));
|
fourSpaceTabAct->setToolTip(tr("Expand Tab to 4 spaces"));
|
||||||
fourSpaceTabAct->setCheckable(true);
|
fourSpaceTabAct->setCheckable(true);
|
||||||
fourSpaceTabAct->setData(4);
|
fourSpaceTabAct->setData(4);
|
||||||
QAction *eightSpaceTabAct = new QAction(tr("8 Spaces"), tabStopWidthAct);
|
QAction *eightSpaceTabAct = new QAction(tr("8 Spaces"), tabStopWidthAct);
|
||||||
eightSpaceTabAct->setStatusTip(tr("Expand Tab to 8 spaces"));
|
eightSpaceTabAct->setToolTip(tr("Expand Tab to 8 spaces"));
|
||||||
eightSpaceTabAct->setCheckable(true);
|
eightSpaceTabAct->setCheckable(true);
|
||||||
eightSpaceTabAct->setData(8);
|
eightSpaceTabAct->setData(8);
|
||||||
connect(tabStopWidthAct, &QActionGroup::triggered,
|
connect(tabStopWidthAct, &QActionGroup::triggered,
|
||||||
@ -484,28 +488,28 @@ void VMainWindow::initEditMenu()
|
|||||||
|
|
||||||
// Auto Indent.
|
// Auto Indent.
|
||||||
m_autoIndentAct = new QAction(tr("Auto Indent"), this);
|
m_autoIndentAct = new QAction(tr("Auto Indent"), this);
|
||||||
m_autoIndentAct->setStatusTip(tr("Indent automatically when inserting a new line"));
|
m_autoIndentAct->setToolTip(tr("Indent automatically when inserting a new line"));
|
||||||
m_autoIndentAct->setCheckable(true);
|
m_autoIndentAct->setCheckable(true);
|
||||||
connect(m_autoIndentAct, &QAction::triggered,
|
connect(m_autoIndentAct, &QAction::triggered,
|
||||||
this, &VMainWindow::changeAutoIndent);
|
this, &VMainWindow::changeAutoIndent);
|
||||||
|
|
||||||
// Auto List.
|
// Auto List.
|
||||||
QAction *autoListAct = new QAction(tr("Auto List"), this);
|
QAction *autoListAct = new QAction(tr("Auto List"), this);
|
||||||
autoListAct->setStatusTip(tr("Continue the list automatically when inserting a new line"));
|
autoListAct->setToolTip(tr("Continue the list automatically when inserting a new line"));
|
||||||
autoListAct->setCheckable(true);
|
autoListAct->setCheckable(true);
|
||||||
connect(autoListAct, &QAction::triggered,
|
connect(autoListAct, &QAction::triggered,
|
||||||
this, &VMainWindow::changeAutoList);
|
this, &VMainWindow::changeAutoList);
|
||||||
|
|
||||||
// Highlight current cursor line.
|
// Highlight current cursor line.
|
||||||
QAction *cursorLineAct = new QAction(tr("Highlight Cursor Line"), this);
|
QAction *cursorLineAct = new QAction(tr("Highlight Cursor Line"), this);
|
||||||
cursorLineAct->setStatusTip(tr("Highlight current cursor line"));
|
cursorLineAct->setToolTip(tr("Highlight current cursor line"));
|
||||||
cursorLineAct->setCheckable(true);
|
cursorLineAct->setCheckable(true);
|
||||||
connect(cursorLineAct, &QAction::triggered,
|
connect(cursorLineAct, &QAction::triggered,
|
||||||
this, &VMainWindow::changeHighlightCursorLine);
|
this, &VMainWindow::changeHighlightCursorLine);
|
||||||
|
|
||||||
// Highlight selected word.
|
// Highlight selected word.
|
||||||
QAction *selectedWordAct = new QAction(tr("Highlight Selected Words"), this);
|
QAction *selectedWordAct = new QAction(tr("Highlight Selected Words"), this);
|
||||||
selectedWordAct->setStatusTip(tr("Highlight all occurences of selected words"));
|
selectedWordAct->setToolTip(tr("Highlight all occurences of selected words"));
|
||||||
selectedWordAct->setCheckable(true);
|
selectedWordAct->setCheckable(true);
|
||||||
connect(selectedWordAct, &QAction::triggered,
|
connect(selectedWordAct, &QAction::triggered,
|
||||||
this, &VMainWindow::changeHighlightSelectedWord);
|
this, &VMainWindow::changeHighlightSelectedWord);
|
||||||
@ -515,6 +519,7 @@ void VMainWindow::initEditMenu()
|
|||||||
m_insertImageAct->setEnabled(false);
|
m_insertImageAct->setEnabled(false);
|
||||||
|
|
||||||
QMenu *findReplaceMenu = editMenu->addMenu(tr("Find/Replace"));
|
QMenu *findReplaceMenu = editMenu->addMenu(tr("Find/Replace"));
|
||||||
|
findReplaceMenu->setToolTipsVisible(true);
|
||||||
findReplaceMenu->addAction(m_findReplaceAct);
|
findReplaceMenu->addAction(m_findReplaceAct);
|
||||||
findReplaceMenu->addAction(m_findNextAct);
|
findReplaceMenu->addAction(m_findNextAct);
|
||||||
findReplaceMenu->addAction(m_findPreviousAct);
|
findReplaceMenu->addAction(m_findPreviousAct);
|
||||||
@ -525,7 +530,6 @@ void VMainWindow::initEditMenu()
|
|||||||
findReplaceMenu->addAction(searchedWordAct);
|
findReplaceMenu->addAction(searchedWordAct);
|
||||||
searchedWordAct->setChecked(vconfig.getHighlightSearchedWord());
|
searchedWordAct->setChecked(vconfig.getHighlightSearchedWord());
|
||||||
|
|
||||||
editMenu->addSeparator();
|
|
||||||
m_findReplaceAct->setEnabled(false);
|
m_findReplaceAct->setEnabled(false);
|
||||||
m_findNextAct->setEnabled(false);
|
m_findNextAct->setEnabled(false);
|
||||||
m_findPreviousAct->setEnabled(false);
|
m_findPreviousAct->setEnabled(false);
|
||||||
@ -533,13 +537,16 @@ void VMainWindow::initEditMenu()
|
|||||||
m_replaceFindAct->setEnabled(false);
|
m_replaceFindAct->setEnabled(false);
|
||||||
m_replaceAllAct->setEnabled(false);
|
m_replaceAllAct->setEnabled(false);
|
||||||
|
|
||||||
|
editMenu->addSeparator();
|
||||||
editMenu->addAction(expandTabAct);
|
editMenu->addAction(expandTabAct);
|
||||||
if (vconfig.getIsExpandTab()) {
|
if (vconfig.getIsExpandTab()) {
|
||||||
expandTabAct->setChecked(true);
|
expandTabAct->setChecked(true);
|
||||||
} else {
|
} else {
|
||||||
expandTabAct->setChecked(false);
|
expandTabAct->setChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMenu *tabStopWidthMenu = editMenu->addMenu(tr("Tab Stop Width"));
|
QMenu *tabStopWidthMenu = editMenu->addMenu(tr("Tab Stop Width"));
|
||||||
|
tabStopWidthMenu->setToolTipsVisible(true);
|
||||||
tabStopWidthMenu->addAction(twoSpaceTabAct);
|
tabStopWidthMenu->addAction(twoSpaceTabAct);
|
||||||
tabStopWidthMenu->addAction(fourSpaceTabAct);
|
tabStopWidthMenu->addAction(fourSpaceTabAct);
|
||||||
tabStopWidthMenu->addAction(eightSpaceTabAct);
|
tabStopWidthMenu->addAction(eightSpaceTabAct);
|
||||||
@ -724,9 +731,10 @@ void VMainWindow::initRenderBackgroundMenu(QMenu *menu)
|
|||||||
this, &VMainWindow::setRenderBackgroundColor);
|
this, &VMainWindow::setRenderBackgroundColor);
|
||||||
|
|
||||||
QMenu *renderBgMenu = menu->addMenu(tr("&Rendering Background"));
|
QMenu *renderBgMenu = menu->addMenu(tr("&Rendering Background"));
|
||||||
|
renderBgMenu->setToolTipsVisible(true);
|
||||||
const QString &curBgColor = vconfig.getCurRenderBackgroundColor();
|
const QString &curBgColor = vconfig.getCurRenderBackgroundColor();
|
||||||
QAction *tmpAct = new QAction(tr("System"), renderBackgroundAct);
|
QAction *tmpAct = new QAction(tr("System"), renderBackgroundAct);
|
||||||
tmpAct->setStatusTip(tr("Use system's background color configuration for Markdown rendering"));
|
tmpAct->setToolTip(tr("Use system's background color configuration for Markdown rendering"));
|
||||||
tmpAct->setCheckable(true);
|
tmpAct->setCheckable(true);
|
||||||
tmpAct->setData("System");
|
tmpAct->setData("System");
|
||||||
if (curBgColor == "System") {
|
if (curBgColor == "System") {
|
||||||
@ -737,7 +745,7 @@ void VMainWindow::initRenderBackgroundMenu(QMenu *menu)
|
|||||||
const QVector<VColor> &bgColors = vconfig.getPredefinedColors();
|
const QVector<VColor> &bgColors = vconfig.getPredefinedColors();
|
||||||
for (int i = 0; i < bgColors.size(); ++i) {
|
for (int i = 0; i < bgColors.size(); ++i) {
|
||||||
tmpAct = new QAction(bgColors[i].name, renderBackgroundAct);
|
tmpAct = new QAction(bgColors[i].name, renderBackgroundAct);
|
||||||
tmpAct->setStatusTip(tr("Set as the background color for Markdown rendering"));
|
tmpAct->setToolTip(tr("Set as the background color for Markdown rendering"));
|
||||||
tmpAct->setCheckable(true);
|
tmpAct->setCheckable(true);
|
||||||
tmpAct->setData(bgColors[i].name);
|
tmpAct->setData(bgColors[i].name);
|
||||||
tmpAct->setIcon(QIcon(predefinedColorPixmaps[i]));
|
tmpAct->setIcon(QIcon(predefinedColorPixmaps[i]));
|
||||||
@ -753,6 +761,7 @@ void VMainWindow::initEditorBackgroundMenu(QMenu *menu)
|
|||||||
{
|
{
|
||||||
QMenu *backgroundColorMenu = menu->addMenu(tr("&Background Color"));
|
QMenu *backgroundColorMenu = menu->addMenu(tr("&Background Color"));
|
||||||
|
|
||||||
|
backgroundColorMenu->setToolTipsVisible(true);
|
||||||
QActionGroup *backgroundColorAct = new QActionGroup(this);
|
QActionGroup *backgroundColorAct = new QActionGroup(this);
|
||||||
connect(backgroundColorAct, &QActionGroup::triggered,
|
connect(backgroundColorAct, &QActionGroup::triggered,
|
||||||
this, &VMainWindow::setEditorBackgroundColor);
|
this, &VMainWindow::setEditorBackgroundColor);
|
||||||
@ -760,7 +769,7 @@ void VMainWindow::initEditorBackgroundMenu(QMenu *menu)
|
|||||||
// System background color
|
// System background color
|
||||||
const QString &curBgColor = vconfig.getCurBackgroundColor();
|
const QString &curBgColor = vconfig.getCurBackgroundColor();
|
||||||
QAction *tmpAct = new QAction(tr("System"), backgroundColorAct);
|
QAction *tmpAct = new QAction(tr("System"), backgroundColorAct);
|
||||||
tmpAct->setStatusTip(tr("Use system's background color configuration for editor"));
|
tmpAct->setToolTip(tr("Use system's background color configuration for editor"));
|
||||||
tmpAct->setCheckable(true);
|
tmpAct->setCheckable(true);
|
||||||
tmpAct->setData("System");
|
tmpAct->setData("System");
|
||||||
if (curBgColor == "System") {
|
if (curBgColor == "System") {
|
||||||
@ -770,7 +779,7 @@ void VMainWindow::initEditorBackgroundMenu(QMenu *menu)
|
|||||||
const QVector<VColor> &bgColors = vconfig.getPredefinedColors();
|
const QVector<VColor> &bgColors = vconfig.getPredefinedColors();
|
||||||
for (int i = 0; i < bgColors.size(); ++i) {
|
for (int i = 0; i < bgColors.size(); ++i) {
|
||||||
tmpAct = new QAction(bgColors[i].name, backgroundColorAct);
|
tmpAct = new QAction(bgColors[i].name, backgroundColorAct);
|
||||||
tmpAct->setStatusTip(tr("Set as the background color for editor"));
|
tmpAct->setToolTip(tr("Set as the background color for editor"));
|
||||||
tmpAct->setCheckable(true);
|
tmpAct->setCheckable(true);
|
||||||
tmpAct->setData(bgColors[i].name);
|
tmpAct->setData(bgColors[i].name);
|
||||||
tmpAct->setIcon(QIcon(predefinedColorPixmaps[i]));
|
tmpAct->setIcon(QIcon(predefinedColorPixmaps[i]));
|
||||||
|
@ -53,13 +53,13 @@ void VNotebookSelector::initActions()
|
|||||||
{
|
{
|
||||||
m_deleteNotebookAct = new QAction(QIcon(":/resources/icons/delete_notebook.svg"),
|
m_deleteNotebookAct = new QAction(QIcon(":/resources/icons/delete_notebook.svg"),
|
||||||
tr("&Delete"), this);
|
tr("&Delete"), this);
|
||||||
m_deleteNotebookAct->setStatusTip(tr("Delete current notebook"));
|
m_deleteNotebookAct->setToolTip(tr("Delete current notebook"));
|
||||||
connect(m_deleteNotebookAct, SIGNAL(triggered(bool)),
|
connect(m_deleteNotebookAct, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(deleteNotebook()));
|
this, SLOT(deleteNotebook()));
|
||||||
|
|
||||||
m_notebookInfoAct = new QAction(QIcon(":/resources/icons/notebook_info.svg"),
|
m_notebookInfoAct = new QAction(QIcon(":/resources/icons/notebook_info.svg"),
|
||||||
tr("&Info"), this);
|
tr("&Info"), this);
|
||||||
m_notebookInfoAct->setStatusTip(tr("View and edit current notebook's information"));
|
m_notebookInfoAct->setToolTip(tr("View and edit current notebook's information"));
|
||||||
connect(m_notebookInfoAct, SIGNAL(triggered(bool)),
|
connect(m_notebookInfoAct, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(editNotebookInfo()));
|
this, SLOT(editNotebookInfo()));
|
||||||
}
|
}
|
||||||
@ -320,6 +320,7 @@ void VNotebookSelector::requestPopupListContextMenu(QPoint p_pos)
|
|||||||
item->setSelected(true);
|
item->setSelected(true);
|
||||||
|
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
menu.setToolTipsVisible(true);
|
||||||
menu.addAction(m_deleteNotebookAct);
|
menu.addAction(m_deleteNotebookAct);
|
||||||
menu.addAction(m_notebookInfoAct);
|
menu.addAction(m_notebookInfoAct);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user