mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
refine toolbar
This commit is contained in:
parent
db3139e97d
commit
f68c3c2722
26
README.md
26
README.md
@ -1,7 +1,7 @@
|
||||
# vnote
|
||||
A pleasant note-taking platform.
|
||||
  
|
||||
|
||||
 
|
||||
A pleasant note-taking platform.
|
||||
|
||||
> At early 2019, I decided to refactor VNote as VNoteX. Now a fresh VNote is ready!
|
||||
> VNoteX is closed source and is intended to keep several premium features compared to VNote. Most of VNoteX's code base will be open source as VNote 3.0, so VNote will share most of the code base with VNoteX and continue to be open source from 3.0.
|
||||
@ -28,22 +28,24 @@ Utilizing Qt, VNote could run on **Linux**, **Windows**, and **macOS**.
|
||||
## Downloads
|
||||
Continuous builds on `master` branch could be found at the [Continuous Build](https://github.com/vnotex/vnote/releases/tag/continuous-build) release.
|
||||
|
||||
Latest stable builds could be found at the [latest release](https://github.com/vnotex/vnote/releases/latest).
|
||||
Latest stable builds could be found at the [latest release](https://github.com/vnotex/vnote/releases/latest). Alternative download services are available:
|
||||
|
||||
* [Tianyi Netdisk](https://cloud.189.cn/t/Av67NvmEJVBv)
|
||||
|
||||
## Supports
|
||||
- [GitHub Issues](https://github.com/vnotex/vnote/issues);
|
||||
- Email: `tamlokveer at gmail.com`;
|
||||
- [Slack](https://join.slack.com/t/vnote/shared_invite/enQtNDg2MzY0NDg3NzI4LTVhMzBlOTY0YzVhMmQyMTFmZDdhY2M3MDQxYTBjOTA2Y2IxOGRiZjg2NzdhMjkzYmUyY2VkMWJlZTNhMTQyODU);
|
||||
- [Telegram](https://t.me/vnotex);
|
||||
- WeChat Public Account: vnotex;
|
||||
* [GitHub Issues](https://github.com/vnotex/vnote/issues);
|
||||
* Email: `tamlokveer at gmail.com`;
|
||||
* [Slack](https://join.slack.com/t/vnote/shared_invite/enQtNDg2MzY0NDg3NzI4LTVhMzBlOTY0YzVhMmQyMTFmZDdhY2M3MDQxYTBjOTA2Y2IxOGRiZjg2NzdhMjkzYmUyY2VkMWJlZTNhMTQyODU);
|
||||
* [Telegram](https://t.me/vnotex);
|
||||
* WeChat Public Account: vnotex;
|
||||
|
||||
## Donate
|
||||
You could help VNote's development in many ways.
|
||||
|
||||
- Keep monitoring VNote and sending feedback for improvement.
|
||||
- Spread and promote VNote to your friends. Popularity is a strong power to drive developers.
|
||||
- Participate in the development of VNote and send [Pull Request](https://github.com/vnotex/vnote/pulls) to make VNote perfect.
|
||||
- Last, really appreciate your donate to VNote if VNote does help.
|
||||
* Keep monitoring VNote and sending feedback for improvement.
|
||||
* Spread and promote VNote to your friends. Popularity is a strong power to drive developers.
|
||||
* Participate in the development of VNote and send [Pull Request](https://github.com/vnotex/vnote/pulls) to make VNote perfect.
|
||||
* Last, really appreciate your donate to VNote if VNote does help.
|
||||
|
||||
**PayPal**: [PayPal.Me/vnotemd](https://www.paypal.me/vnotemd)
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
<file>icons/import_notebook.svg</file>
|
||||
<file>icons/import_notebook_of_vnote2.svg</file>
|
||||
<file>icons/new_notebook.svg</file>
|
||||
<file>icons/notebook_menu.svg</file>
|
||||
<file>icons/new_notebook_from_folder.svg</file>
|
||||
<file>icons/discard_editor.svg</file>
|
||||
<file>icons/edit_editor.svg</file>
|
||||
@ -19,7 +20,10 @@
|
||||
<file>icons/help.svg</file>
|
||||
<file>icons/menu.svg</file>
|
||||
<file>icons/settings.svg</file>
|
||||
<file>icons/settings_menu.svg</file>
|
||||
<file>icons/whatsthis.svg</file>
|
||||
<file>icons/help_menu.svg</file>
|
||||
<file>icons/import_export_menu.svg</file>
|
||||
<file>icons/native_notebook_default.svg</file>
|
||||
<file>icons/notebook_default.svg</file>
|
||||
<file>icons/file_node.svg</file>
|
||||
|
14
src/data/core/icons/help_menu.svg
Normal file
14
src/data/core/icons/help_menu.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="512px" height="512px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<g>
|
||||
<path fill="#000000" d="M345.1,77.1C317.6,56.2,286.6,49,247.3,49c-29.8,0-55.3,6.1-75.5,19.7C142,89,128,123.1,128,177h76.8
|
||||
c0-14.4-1.4-29.9,7-43.2c8.4-13.3,20.1-23.5,40.2-23.5c20.4,0,30.9,5.9,40.8,18.1c8.4,10.4,11.6,22.8,11.6,36
|
||||
c0,11.4-5.8,21.9-12.7,31.4c-3.8,5.6-8.8,10.6-15.1,15.4c0,0-41.5,24.7-56.1,48.1c-10.9,17.4-14.8,39.2-15.7,65.3
|
||||
c-0.1,1.9,0.6,5.8,7.2,5.8c6.5,0,56,0,61.8,0c5.8,0,7-4.4,7.1-6.2c0.4-9.5,1.6-24.1,3.3-29.6c3.3-10.4,9.7-19.5,19.7-27.3
|
||||
l20.7-14.3c18.7-14.6,33.6-26.5,40.2-35.9c11.3-15.4,19.2-34.4,19.2-56.9C384,123.5,370.5,96.4,345.1,77.1z M242,370.2
|
||||
c-25.9-0.8-47.3,17.2-48.2,45.3c-0.8,28.2,19.5,46.7,45.5,47.5c27,0.8,47.9-16.6,48.7-44.7C288.8,390.2,269,371,242,370.2z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
1
src/data/core/icons/import_export_menu.svg
Normal file
1
src/data/core/icons/import_export_menu.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1607931217887" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1738" width="512" height="512" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M344.352 403.072l-160.8 0 243.296 243.264 243.296-243.264-157.376 0c8.832-338.976-299.168-376.736-491.424-198.88 130.528-72.096 329.664-84.192 323.04 198.88l0 0zM937.76 66.24l-524.896 0c26.976 13.92 51.232 31.904 72.512 53.76 27.872 28.576 49.536 55.456 68.128 120.448l395.04 0 0 701.088-827.104 0 0-683.936c0 0-16.768-20.128-52.96-2.496l0 680.448c0 35.904 29.088 64.864 64.928 64.864l804.384 0c35.872 0 64.896-28.96 64.896-64.864l0-804.384c0-35.84-29.024-64.928-64.928-64.928l0 0z" p-id="1739" fill="#000000"></path></svg>
|
After Width: | Height: | Size: 900 B |
8
src/data/core/icons/notebook_menu.svg
Normal file
8
src/data/core/icons/notebook_menu.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
|
||||
<path style="fill:#000000" d="M464,64v416H80c-17.672,0-32-14.313-32-32s14.328-32,32-32h352V0H80C44.656,0,16,28.656,16,64v384c0,35.344,28.656,64,64,64
|
||||
h416V64H464z M80,128V96V32h320v352H80V128z M336,96H144V64h192V96z M272,160H144v-32h128V160z M208,224h-64v-32h64V224z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 748 B |
18
src/data/core/icons/settings_menu.svg
Normal file
18
src/data/core/icons/settings_menu.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="512px" height="512px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<path style="fill:#000000" d="M450,138.3l-47.7,48.5l-2.7,2.8l-1.6,1.7c-1.1,0.8-2.4,1.2-3.9,1.2c-1.6,0-3.1-0.6-4.3-1.6l-0.9-0.9l-2.7-2.7l-41.3-42.1
|
||||
l-2.2-2.2l-1.7-1.7c-1-1.5-1.6-3.4-1.6-5.3c0-1.7,0.6-3.2,1.6-4.4l0.7-0.8l2.6-2.6l47.9-48.7c-5.1-10.1-24.7-14.9-35.1-14.1
|
||||
c-17.1,1.3-34.7,7-52.8,25.5c-0.7,0.8-1.5,1.6-2.2,2.3C277.5,120,272.6,156,282.6,189c0.7,1.4,1.3,3.1,1.6,4.6
|
||||
c1.1,5.5-0.4,10.2-4,13.5l-37.9,36.4c-11.8-12-13.5-13.6-13.5-13.6c-2-2-6-3.3-9.5-1.2l-5.9,3.6c-22.7-23.1-32.3-32.4-35.4-43.6
|
||||
c-3.2-11.7-0.3-27.3,2.7-33.1c2.5-4.6,10.3-8.9,16.9-9.4l8.6,8.8c2,2,5.1,2,7.1,0l30.9-31.4c2-2,2-5.3,0-7.3l-49.9-50.7
|
||||
c-2-2-5.2-2-7.1,0l-30.9,31.4c-2,2-2,5.3,0,7.3l3.3,3.4c0,4.9-0.7,12.5-4.7,16.6c-6.2,6.3-18.5-1-26.5,4.7
|
||||
c-7.9,5.6-17.9,14.6-24.3,21c-6.3,6.4-30.5,31.8-47.8,74.6c-17.3,42.8-4,82.5,5.4,92.9c5,5.5,14.1,11.1,12.5,0.7
|
||||
c-1.6-10.5-4.2-46.9,7.7-61.8c11.9-14.9,27.6-27.1,48-28.1c19.6-1,30.9,5.7,56.3,31.5l-2.8,5.2c-1.8,3.4-0.8,7.7,1.2,9.7
|
||||
c0,0,1.5,1.6,12.1,12.4l-97.2,93.2c-16.2,14.3-15.3,40.5-0.3,56c15.2,15.2,41.1,16.3,55.2-0.2l91.4-98.6
|
||||
c49.1,52.3,93.3,107.4,93.3,107.4c2,2,5.2,2,7.1,0l49.9-50.7c2-2,2-5.2,0-7.3c0,0-55.2-45.7-107-96.2l35.5-38.3
|
||||
c3.3-3.7,7.9-5.2,13.3-4.1c1.5,0.3,3.1,1,4.5,1.7c32.4,10.2,67.8,5.2,94-19.8c0.8-0.7,1.5-1.5,2.3-2.3c18.1-18.4,23.7-36.4,25-53.8
|
||||
C464.7,163.5,460.2,143.8,450,138.3z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
@ -49,6 +49,10 @@ MainWindow::MainWindow(QWidget *p_parent)
|
||||
|
||||
loadStateAndGeometry();
|
||||
|
||||
#if defined(Q_OS_MACOS) || defined(Q_OS_MAC)
|
||||
QApplication::setQuitOnLastWindowClosed(false);
|
||||
#endif
|
||||
|
||||
connect(qApp, &QCoreApplication::aboutToQuit,
|
||||
this, &MainWindow::closeOnQuit);
|
||||
}
|
||||
|
@ -279,8 +279,6 @@ void MarkdownViewWindow::setupToolBar()
|
||||
addAction(toolBar, ViewWindowToolBarHelper::TypeImage);
|
||||
addAction(toolBar, ViewWindowToolBarHelper::TypeTable);
|
||||
|
||||
toolBar->addSeparator();
|
||||
|
||||
ToolBarHelper::addSpacer(toolBar);
|
||||
addAction(toolBar, ViewWindowToolBarHelper::FindAndReplace);
|
||||
addAction(toolBar, ViewWindowToolBarHelper::Outline);
|
||||
|
@ -77,59 +77,6 @@ TitleBar *NotebookExplorer::setupTitleBar(QWidget *p_parent)
|
||||
p_parent);
|
||||
titleBar->setWhatsThis(tr("This title bar contains buttons and menu to manage notebooks and notes."));
|
||||
|
||||
titleBar->addMenuSeparator();
|
||||
auto newNoteAct = titleBar->addMenuAction(QStringLiteral("new_note.svg"),
|
||||
tr("New N&ote"),
|
||||
titleBar,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newNoteRequested();
|
||||
});
|
||||
WidgetUtils::addActionShortcutText(newNoteAct,
|
||||
ConfigMgr::getInst().getCoreConfig().getShortcut(CoreConfig::Shortcut::NewNote));
|
||||
|
||||
titleBar->addMenuSeparator();
|
||||
auto newFolderAct = titleBar->addMenuAction(QStringLiteral("new_folder.svg"),
|
||||
tr("New &Folder"),
|
||||
titleBar,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newFolderRequested();
|
||||
});
|
||||
|
||||
connect(this, &NotebookExplorer::updateTitleBarMenuActions,
|
||||
this, [=]() {
|
||||
newFolderAct->setEnabled(m_currentNotebook);
|
||||
newNoteAct->setEnabled(m_currentNotebook);
|
||||
});
|
||||
|
||||
titleBar->addMenuSeparator();
|
||||
titleBar->addMenuAction(QStringLiteral("new_notebook.svg"),
|
||||
tr("New &Notebook"),
|
||||
titleBar,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newNotebookRequested();
|
||||
});
|
||||
|
||||
titleBar->addMenuAction(QStringLiteral("new_notebook_from_folder.svg"),
|
||||
tr("N&ew Notebook From Folder"),
|
||||
titleBar,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newNotebookFromFolderRequested();
|
||||
});
|
||||
|
||||
titleBar->addMenuAction(QStringLiteral("import_notebook.svg"),
|
||||
tr("&Import Notebook"),
|
||||
titleBar,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importNotebookRequested();
|
||||
});
|
||||
|
||||
titleBar->addMenuAction(QStringLiteral("import_notebook_of_vnote2.svg"),
|
||||
tr("Import Legacy Notebook Of &VNote 2.0"),
|
||||
titleBar,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importLegacyNotebookRequested();
|
||||
});
|
||||
|
||||
titleBar->addMenuAction(QStringLiteral("manage_notebooks.svg"),
|
||||
tr("&Manage Notebooks"),
|
||||
titleBar,
|
||||
@ -139,19 +86,6 @@ TitleBar *NotebookExplorer::setupTitleBar(QWidget *p_parent)
|
||||
dialog.exec();
|
||||
});
|
||||
|
||||
titleBar->addMenuSeparator();
|
||||
titleBar->addMenuAction(tr("Import File"),
|
||||
titleBar,
|
||||
[this]() {
|
||||
emit VNoteX::getInst().importFileRequested();
|
||||
});
|
||||
|
||||
titleBar->addMenuAction(tr("Import Folder"),
|
||||
titleBar,
|
||||
[this]() {
|
||||
emit VNoteX::getInst().importFolderRequested();
|
||||
});
|
||||
|
||||
return titleBar;
|
||||
}
|
||||
|
||||
|
@ -65,8 +65,6 @@ void TextViewWindow::setupToolBar()
|
||||
|
||||
addAction(toolBar, ViewWindowToolBarHelper::Attachment);
|
||||
|
||||
toolBar->addSeparator();
|
||||
|
||||
ToolBarHelper::addSpacer(toolBar);
|
||||
addAction(toolBar, ViewWindowToolBarHelper::FindAndReplace);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <core/configmgr.h>
|
||||
#include <core/coreconfig.h>
|
||||
#include <core/fileopenparameters.h>
|
||||
#include "propertydefs.h"
|
||||
#include "dialogs/settings/settingsdialog.h"
|
||||
|
||||
using namespace vnotex;
|
||||
@ -39,7 +40,53 @@ QToolBar *ToolBarHelper::setupFileToolBar(MainWindow *p_win, QToolBar *p_toolBar
|
||||
tb = createToolBar(p_win, MainWindow::tr("File"), "FileToolBar");
|
||||
}
|
||||
|
||||
// New.
|
||||
// Notebook.
|
||||
{
|
||||
auto act = tb->addAction(generateIcon("notebook_menu.svg"), MainWindow::tr("Notebook"));
|
||||
|
||||
auto toolBtn = dynamic_cast<QToolButton *>(tb->widgetForAction(act));
|
||||
Q_ASSERT(toolBtn);
|
||||
toolBtn->setPopupMode(QToolButton::InstantPopup);
|
||||
toolBtn->setProperty(PropertyDefs::s_toolButtonWithoutMenuIndicator, true);
|
||||
|
||||
auto newMenu = WidgetsFactory::createMenu(tb);
|
||||
toolBtn->setMenu(newMenu);
|
||||
|
||||
newMenu->addAction(generateIcon("new_notebook.svg"),
|
||||
MainWindow::tr("New Notebook"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newNotebookRequested();
|
||||
});
|
||||
|
||||
// New notebook from folder.
|
||||
newMenu->addAction(generateIcon("new_notebook_from_folder.svg"),
|
||||
MainWindow::tr("New Notebook From Folder"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newNotebookFromFolderRequested();
|
||||
});
|
||||
|
||||
newMenu->addSeparator();
|
||||
|
||||
// Import notebook.
|
||||
newMenu->addAction(generateIcon("import_notebook.svg"),
|
||||
MainWindow::tr("Import Notebook"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importNotebookRequested();
|
||||
});
|
||||
|
||||
// Import notebook of VNote 2.0.
|
||||
newMenu->addAction(generateIcon("import_notebook_of_vnote2.svg"),
|
||||
MainWindow::tr("Import Legacy Notebook Of VNote 2.0"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importLegacyNotebookRequested();
|
||||
});
|
||||
}
|
||||
|
||||
// New Note.
|
||||
{
|
||||
const auto &coreConfig = ConfigMgr::getInst().getCoreConfig();
|
||||
|
||||
@ -63,8 +110,6 @@ QToolBar *ToolBarHelper::setupFileToolBar(MainWindow *p_win, QToolBar *p_toolBar
|
||||
// To hide the shortcut text shown in button.
|
||||
newBtn->setText(MainWindow::tr("New Note"));
|
||||
|
||||
newMenu->addSeparator();
|
||||
|
||||
// New folder.
|
||||
newMenu->addAction(generateIcon("new_folder.svg"),
|
||||
MainWindow::tr("New Folder"),
|
||||
@ -75,56 +120,6 @@ QToolBar *ToolBarHelper::setupFileToolBar(MainWindow *p_win, QToolBar *p_toolBar
|
||||
|
||||
newMenu->addSeparator();
|
||||
|
||||
// New notebook.
|
||||
newMenu->addAction(generateIcon("new_notebook.svg"),
|
||||
MainWindow::tr("New Notebook"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newNotebookRequested();
|
||||
});
|
||||
|
||||
// New notebook from folder.
|
||||
newMenu->addAction(generateIcon("new_notebook_from_folder.svg"),
|
||||
MainWindow::tr("New Notebook From Folder"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().newNotebookFromFolderRequested();
|
||||
});
|
||||
|
||||
// Import notebook.
|
||||
newMenu->addAction(generateIcon("import_notebook.svg"),
|
||||
MainWindow::tr("Import Notebook"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importNotebookRequested();
|
||||
});
|
||||
|
||||
// Import notebook of VNote 2.0.
|
||||
newMenu->addAction(generateIcon("import_notebook_of_vnote2.svg"),
|
||||
MainWindow::tr("Import Legacy Notebook Of VNote 2.0"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importLegacyNotebookRequested();
|
||||
});
|
||||
|
||||
newMenu->addSeparator();
|
||||
|
||||
// Import file.
|
||||
newMenu->addAction(MainWindow::tr("Import File"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importFileRequested();
|
||||
});
|
||||
|
||||
// Import folder.
|
||||
newMenu->addAction(MainWindow::tr("Import Folder"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importFolderRequested();
|
||||
});
|
||||
|
||||
newMenu->addSeparator();
|
||||
|
||||
// Open file.
|
||||
newMenu->addAction(MainWindow::tr("Open File"),
|
||||
newMenu,
|
||||
@ -147,6 +142,33 @@ QToolBar *ToolBarHelper::setupFileToolBar(MainWindow *p_win, QToolBar *p_toolBar
|
||||
tb->addWidget(newBtn);
|
||||
}
|
||||
|
||||
// Import and export.
|
||||
{
|
||||
auto act = tb->addAction(generateIcon("import_export_menu.svg"), MainWindow::tr("Import And Export"));
|
||||
|
||||
auto btn = dynamic_cast<QToolButton *>(tb->widgetForAction(act));
|
||||
Q_ASSERT(btn);
|
||||
btn->setPopupMode(QToolButton::InstantPopup);
|
||||
btn->setProperty(PropertyDefs::s_toolButtonWithoutMenuIndicator, true);
|
||||
|
||||
auto newMenu = WidgetsFactory::createMenu(tb);
|
||||
btn->setMenu(newMenu);
|
||||
|
||||
// Import file.
|
||||
newMenu->addAction(MainWindow::tr("Import File"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importFileRequested();
|
||||
});
|
||||
|
||||
// Import folder.
|
||||
newMenu->addAction(MainWindow::tr("Import Folder"),
|
||||
newMenu,
|
||||
[]() {
|
||||
emit VNoteX::getInst().importFolderRequested();
|
||||
});
|
||||
}
|
||||
|
||||
return tb;
|
||||
}
|
||||
|
||||
@ -176,9 +198,11 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
|
||||
auto btn = WidgetsFactory::createToolButton(tb);
|
||||
|
||||
auto expandAct = new QAction(generateIcon("expand.svg"),
|
||||
MainWindow::tr("Expand Content Area"),
|
||||
btn);
|
||||
auto menu = WidgetsFactory::createMenu(tb);
|
||||
btn->setMenu(menu);
|
||||
|
||||
auto expandAct = menu->addAction(generateIcon("expand.svg"),
|
||||
MainWindow::tr("Expand Content Area"));
|
||||
WidgetUtils::addActionShortcut(expandAct,
|
||||
coreConfig.getShortcut(CoreConfig::Shortcut::ExpandContentArea));
|
||||
expandAct->setCheckable(true);
|
||||
@ -190,9 +214,6 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
});
|
||||
btn->setDefaultAction(expandAct);
|
||||
|
||||
auto menu = WidgetsFactory::createMenu(tb);
|
||||
btn->setMenu(menu);
|
||||
|
||||
auto fullScreenAct = new FullScreenToggleAction(p_win,
|
||||
generateIcon("fullscreen.svg"),
|
||||
menu);
|
||||
@ -221,7 +242,11 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
{
|
||||
const auto &coreConfig = ConfigMgr::getInst().getCoreConfig();
|
||||
|
||||
auto btn = WidgetsFactory::createToolButton(tb);
|
||||
auto act = tb->addAction(generateIcon("settings_menu.svg"), MainWindow::tr("Settings"));
|
||||
auto btn = dynamic_cast<QToolButton *>(tb->widgetForAction(act));
|
||||
Q_ASSERT(btn);
|
||||
btn->setPopupMode(QToolButton::InstantPopup);
|
||||
btn->setProperty(PropertyDefs::s_toolButtonWithoutMenuIndicator, true);
|
||||
|
||||
auto menu = WidgetsFactory::createMenu(tb);
|
||||
btn->setMenu(menu);
|
||||
@ -235,7 +260,6 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
});
|
||||
WidgetUtils::addActionShortcut(settingsAct,
|
||||
coreConfig.getShortcut(CoreConfig::Shortcut::Settings));
|
||||
btn->setDefaultAction(settingsAct);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
@ -279,13 +303,15 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
[p_win]() {
|
||||
p_win->resetStateAndGeometry();
|
||||
});
|
||||
|
||||
tb->addWidget(btn);
|
||||
}
|
||||
|
||||
// WhatsThis.
|
||||
// Help.
|
||||
{
|
||||
auto btn = WidgetsFactory::createToolButton(tb);
|
||||
auto act = tb->addAction(generateIcon("help_menu.svg"), MainWindow::tr("Help"));
|
||||
auto btn = dynamic_cast<QToolButton *>(tb->widgetForAction(act));
|
||||
Q_ASSERT(btn);
|
||||
btn->setPopupMode(QToolButton::InstantPopup);
|
||||
btn->setProperty(PropertyDefs::s_toolButtonWithoutMenuIndicator, true);
|
||||
|
||||
auto menu = WidgetsFactory::createMenu(tb);
|
||||
btn->setMenu(menu);
|
||||
@ -297,7 +323,6 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
QWhatsThis::enterWhatsThisMode();
|
||||
});
|
||||
whatsThisAct->setToolTip(MainWindow::tr("Enter WhatsThis mode and click somewhere to show help information"));
|
||||
btn->setDefaultAction(whatsThisAct);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
@ -327,6 +352,14 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(MainWindow::tr("Feedback And Discussions"),
|
||||
menu,
|
||||
[]() {
|
||||
WidgetUtils::openUrlByDesktop(QUrl("https://github.com/vnotex/vnote/discussions"));
|
||||
});
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(MainWindow::tr("About"),
|
||||
menu,
|
||||
[p_win]() {
|
||||
@ -340,8 +373,6 @@ QToolBar *ToolBarHelper::setupSettingsToolBar(MainWindow *p_win, QToolBar *p_too
|
||||
aboutQtAct->setMenuRole(QAction::AboutQtRole);
|
||||
MainWindow::connect(aboutQtAct, &QAction::triggered,
|
||||
qApp, &QApplication::aboutQt);
|
||||
|
||||
tb->addWidget(btn);
|
||||
}
|
||||
|
||||
return tb;
|
||||
|
Loading…
x
Reference in New Issue
Block a user