mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
Vi: add config page
This commit is contained in:
parent
e9799990f0
commit
721e821ca5
@ -1 +1 @@
|
||||
Subproject commit ac58baf5f07643f57a2a208629b7056c24516ffc
|
||||
Subproject commit 77cf66845ac2dee3e49cee440f5a6b40b777e8bd
|
@ -6,6 +6,8 @@
|
||||
#include "texteditorconfig.h"
|
||||
#include "markdowneditorconfig.h"
|
||||
|
||||
#include <vtextedit/viconfig.h>
|
||||
|
||||
using namespace vnotex;
|
||||
|
||||
#define READINT(key) readInt(appObj, userObj, (key))
|
||||
@ -58,6 +60,9 @@ void EditorConfig::init(const QJsonObject &p_app,
|
||||
|
||||
loadImageHost(appObj, userObj);
|
||||
|
||||
m_viConfig = QSharedPointer<vte::ViConfig>::create();
|
||||
m_viConfig->fromJson(read(appObj, userObj, QStringLiteral("vi")).toObject());
|
||||
|
||||
m_textEditorConfig->init(appObj, userObj);
|
||||
m_markdownEditorConfig->init(appObj, userObj);
|
||||
}
|
||||
@ -139,6 +144,7 @@ QJsonObject EditorConfig::toJson() const
|
||||
obj[m_markdownEditorConfig->getSessionName()] = m_markdownEditorConfig->toJson();
|
||||
obj[QStringLiteral("core")] = saveCore();
|
||||
obj[QStringLiteral("image_host")] = saveImageHost();
|
||||
obj[QStringLiteral("vi")] = m_viConfig->toJson();
|
||||
return obj;
|
||||
}
|
||||
|
||||
@ -304,3 +310,8 @@ void EditorConfig::setClearObsoleteImageAtImageHostEnabled(bool p_enabled)
|
||||
{
|
||||
updateConfig(m_clearObsoleteImageAtImageHost, p_enabled, this);
|
||||
}
|
||||
|
||||
const QSharedPointer<vte::ViConfig> &EditorConfig::getViConfig() const
|
||||
{
|
||||
return m_viConfig;
|
||||
}
|
||||
|
@ -8,6 +8,11 @@
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
|
||||
namespace vte
|
||||
{
|
||||
class ViConfig;
|
||||
}
|
||||
|
||||
namespace vnotex
|
||||
{
|
||||
class TextEditorConfig;
|
||||
@ -120,6 +125,8 @@ namespace vnotex
|
||||
bool isClearObsoleteImageAtImageHostEnabled() const;
|
||||
void setClearObsoleteImageAtImageHostEnabled(bool p_enabled);
|
||||
|
||||
const QSharedPointer<vte::ViConfig> &getViConfig() const;
|
||||
|
||||
private:
|
||||
friend class MainConfig;
|
||||
|
||||
@ -165,6 +172,8 @@ namespace vnotex
|
||||
QString m_defaultImageHost;
|
||||
|
||||
bool m_clearObsoleteImageAtImageHost = false;
|
||||
|
||||
QSharedPointer<vte::ViConfig> m_viConfig;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,6 @@
|
||||
<file>icons/manage_notebooks.svg</file>
|
||||
<file>icons/up_parent_node.svg</file>
|
||||
<file>icons/properties.svg</file>
|
||||
<file>icons/remove_notebook.svg</file>
|
||||
<file>icons/close_notebook.svg</file>
|
||||
<file>icons/recycle_bin.svg</file>
|
||||
<file>icons/search_location_list.svg</file>
|
||||
<file>icons/save_editor.svg</file>
|
||||
|
@ -1 +1,10 @@
|
||||
<?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="1602768905506" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12426" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><defs><style type="text/css"></style></defs><path d="M761.6 701.44a21.333333 21.333333 0 0 1 0 30.293333l-29.866667 29.866667a21.333333 21.333333 0 0 1-30.293333 0L512 572.16l-189.44 189.44a21.333333 21.333333 0 0 1-30.293333 0l-29.866667-29.866667a21.333333 21.333333 0 0 1 0-30.293333L451.84 512 262.4 322.56a21.333333 21.333333 0 0 1 0-30.293333l29.866667-29.866667a21.333333 21.333333 0 0 1 30.293333 0L512 451.84l189.44-189.44a21.333333 21.333333 0 0 1 30.293333 0l29.866667 29.866667a21.333333 21.333333 0 0 1 0 30.293333L572.16 512z" p-id="12427" fill="#000000"></path></svg>
|
||||
<?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="M341,128V99c0-19.1-14.5-35-34.5-35H205.4C185.5,64,171,79.9,171,99v29H80v32h9.2c0,0,5.4,0.6,8.2,3.4c2.8,2.8,3.9,9,3.9,9
|
||||
l19,241.7c1.5,29.4,1.5,33.9,36,33.9h199.4c34.5,0,34.5-4.4,36-33.8l19-241.6c0,0,1.1-6.3,3.9-9.1c2.8-2.8,8.2-3.4,8.2-3.4h9.2v-32
|
||||
h-91V128z M192,99c0-9.6,7.8-15,17.7-15h91.7c9.9,0,18.6,5.5,18.6,15v29H192V99z M183.5,384l-10.3-192h20.3L204,384H183.5z
|
||||
M267.1,384h-22V192h22V384z M328.7,384h-20.4l10.5-192h20.3L328.7,384z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 907 B After Width: | Height: | Size: 955 B |
@ -1,10 +0,0 @@
|
||||
<?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="M341,128V99c0-19.1-14.5-35-34.5-35H205.4C185.5,64,171,79.9,171,99v29H80v32h9.2c0,0,5.4,0.6,8.2,3.4c2.8,2.8,3.9,9,3.9,9
|
||||
l19,241.7c1.5,29.4,1.5,33.9,36,33.9h199.4c34.5,0,34.5-4.4,36-33.8l19-241.6c0,0,1.1-6.3,3.9-9.1c2.8-2.8,8.2-3.4,8.2-3.4h9.2v-32
|
||||
h-91V128z M192,99c0-9.6,7.8-15,17.7-15h91.7c9.9,0,18.6,5.5,18.6,15v29H192V99z M183.5,384l-10.3-192h20.3L204,384H183.5z
|
||||
M267.1,384h-22V192h22V384z M328.7,384h-20.4l10.5-192h20.3L328.7,384z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 955 B |
@ -344,6 +344,9 @@
|
||||
],
|
||||
"default_image_host" : "",
|
||||
"clear_obsolete_image" : false
|
||||
},
|
||||
"vi" : {
|
||||
"control_c_to_copy" : false
|
||||
}
|
||||
},
|
||||
"widget" : {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "quickaccesspage.h"
|
||||
#include "themepage.h"
|
||||
#include "imagehostpage.h"
|
||||
#include "vipage.h"
|
||||
|
||||
using namespace vnotex;
|
||||
|
||||
@ -118,6 +119,12 @@ void SettingsDialog::setupPages()
|
||||
addSubPage(subPage, item);
|
||||
}
|
||||
|
||||
// Vi.
|
||||
{
|
||||
auto subPage = new ViPage(this);
|
||||
addSubPage(subPage, item);
|
||||
}
|
||||
|
||||
// Text Editor.
|
||||
{
|
||||
auto subPage = new TextEditorPage(this);
|
||||
|
62
src/widgets/dialogs/settings/vipage.cpp
Normal file
62
src/widgets/dialogs/settings/vipage.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
#include "vipage.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QFormLayout>
|
||||
|
||||
#include <vtextedit/viconfig.h>
|
||||
|
||||
#include <widgets/widgetsfactory.h>
|
||||
#include <core/editorconfig.h>
|
||||
#include <core/configmgr.h>
|
||||
#include <utils/widgetutils.h>
|
||||
|
||||
#include "editorpage.h"
|
||||
|
||||
using namespace vnotex;
|
||||
|
||||
ViPage::ViPage(QWidget *p_parent)
|
||||
: SettingsPage(p_parent)
|
||||
{
|
||||
setupUI();
|
||||
}
|
||||
|
||||
void ViPage::setupUI()
|
||||
{
|
||||
auto mainLayout = WidgetsFactory::createFormLayout(this);
|
||||
|
||||
{
|
||||
const QString label(tr("Control-C to copy"));
|
||||
m_controlCToCopyCheckBox = WidgetsFactory::createCheckBox(label, this);
|
||||
m_controlCToCopyCheckBox->setToolTip(tr("Use Control-C to copy text"));
|
||||
mainLayout->addRow(m_controlCToCopyCheckBox);
|
||||
addSearchItem(label, m_controlCToCopyCheckBox->toolTip(), m_controlCToCopyCheckBox);
|
||||
connect(m_controlCToCopyCheckBox, &QCheckBox::stateChanged,
|
||||
this, &ViPage::pageIsChanged);
|
||||
}
|
||||
}
|
||||
|
||||
void ViPage::loadInternal()
|
||||
{
|
||||
const auto &viConfig = ConfigMgr::getInst().getEditorConfig().getViConfig();
|
||||
|
||||
m_controlCToCopyCheckBox->setChecked(viConfig->m_controlCToCopy);
|
||||
}
|
||||
|
||||
bool ViPage::saveInternal()
|
||||
{
|
||||
auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
auto &viConfig = editorConfig.getViConfig();
|
||||
|
||||
viConfig->m_controlCToCopy = m_controlCToCopyCheckBox->isChecked();
|
||||
|
||||
editorConfig.update();
|
||||
|
||||
EditorPage::notifyEditorConfigChange();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QString ViPage::title() const
|
||||
{
|
||||
return tr("Vi Input Mode");
|
||||
}
|
30
src/widgets/dialogs/settings/vipage.h
Normal file
30
src/widgets/dialogs/settings/vipage.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef VIPAGE_H
|
||||
#define VIPAGE_H
|
||||
|
||||
#include "settingspage.h"
|
||||
|
||||
class QCheckBox;
|
||||
|
||||
namespace vnotex
|
||||
{
|
||||
class ViPage : public SettingsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ViPage(QWidget *p_parent = nullptr);
|
||||
|
||||
QString title() const Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
void loadInternal() Q_DECL_OVERRIDE;
|
||||
|
||||
bool saveInternal() Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
|
||||
QCheckBox *m_controlCToCopyCheckBox = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // VIPAGE_H
|
@ -181,15 +181,13 @@ void MarkdownViewWindow::handleEditorConfigChange()
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
const auto &markdownEditorConfig = editorConfig.getMarkdownEditorConfig();
|
||||
|
||||
if (markdownEditorConfig.revision() != m_markdownEditorConfigRevision) {
|
||||
m_markdownEditorConfigRevision = markdownEditorConfig.revision();
|
||||
|
||||
if (updateConfigRevision()) {
|
||||
updatePreviewHelperFromConfig(markdownEditorConfig);
|
||||
|
||||
HtmlTemplateHelper::updateMarkdownViewerTemplate(markdownEditorConfig);
|
||||
|
||||
if (m_editor) {
|
||||
auto config = createMarkdownEditorConfig(markdownEditorConfig);
|
||||
auto config = createMarkdownEditorConfig(editorConfig, markdownEditorConfig);
|
||||
m_editor->setConfig(config);
|
||||
|
||||
m_editor->updateFromConfig();
|
||||
@ -316,11 +314,10 @@ void MarkdownViewWindow::setupTextEditor()
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
const auto &markdownEditorConfig = editorConfig.getMarkdownEditorConfig();
|
||||
|
||||
m_editorConfigRevision = editorConfig.revision();
|
||||
m_markdownEditorConfigRevision = markdownEditorConfig.revision();
|
||||
updateConfigRevision();
|
||||
|
||||
m_editor = new MarkdownEditor(markdownEditorConfig,
|
||||
createMarkdownEditorConfig(markdownEditorConfig),
|
||||
createMarkdownEditorConfig(editorConfig, markdownEditorConfig),
|
||||
createMarkdownEditorParameters(editorConfig, markdownEditorConfig),
|
||||
this);
|
||||
m_splitter->insertWidget(0, m_editor);
|
||||
@ -405,8 +402,7 @@ void MarkdownViewWindow::setupViewer()
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
const auto &markdownEditorConfig = editorConfig.getMarkdownEditorConfig();
|
||||
|
||||
m_editorConfigRevision = editorConfig.revision();
|
||||
m_markdownEditorConfigRevision = markdownEditorConfig.revision();
|
||||
updateConfigRevision();
|
||||
|
||||
HtmlTemplateHelper::updateMarkdownViewerTemplate(markdownEditorConfig);
|
||||
|
||||
@ -852,11 +848,12 @@ void MarkdownViewWindow::setupOutlineProvider()
|
||||
});
|
||||
}
|
||||
|
||||
QSharedPointer<vte::MarkdownEditorConfig> MarkdownViewWindow::createMarkdownEditorConfig(const MarkdownEditorConfig &p_config)
|
||||
QSharedPointer<vte::MarkdownEditorConfig> MarkdownViewWindow::createMarkdownEditorConfig(const EditorConfig &p_editorConfig, const MarkdownEditorConfig &p_config)
|
||||
{
|
||||
const auto &themeMgr = VNoteX::getInst().getThemeMgr();
|
||||
|
||||
auto textEditorConfig = TextViewWindowHelper::createTextEditorConfig(p_config.getTextEditorConfig(),
|
||||
p_editorConfig.getViConfig(),
|
||||
themeMgr.getFile(Theme::File::MarkdownEditorStyle),
|
||||
themeMgr.getMarkdownEditorHighlightTheme());
|
||||
|
||||
@ -883,7 +880,7 @@ QSharedPointer<vte::MarkdownEditorConfig> MarkdownViewWindow::createMarkdownEdit
|
||||
return editorConfig;
|
||||
}
|
||||
|
||||
QSharedPointer<vte::TextEditorParameters> MarkdownViewWindow::createMarkdownEditorParameters(const EditorConfig& p_editorConfig, const MarkdownEditorConfig &p_config)
|
||||
QSharedPointer<vte::TextEditorParameters> MarkdownViewWindow::createMarkdownEditorParameters(const EditorConfig &p_editorConfig, const MarkdownEditorConfig &p_config)
|
||||
{
|
||||
auto paras = QSharedPointer<vte::TextEditorParameters>::create();
|
||||
paras->m_spellCheckEnabled = p_config.isSpellCheckEnabled();
|
||||
@ -1126,3 +1123,27 @@ void MarkdownViewWindow::removeFromImageHost(const QString &p_url)
|
||||
this);
|
||||
}
|
||||
}
|
||||
|
||||
bool MarkdownViewWindow::updateConfigRevision()
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
|
||||
if (m_editorConfigRevision != editorConfig.revision()) {
|
||||
changed = true;
|
||||
m_editorConfigRevision = editorConfig.revision();
|
||||
}
|
||||
|
||||
if (m_textEditorConfigRevision != editorConfig.getTextEditorConfig().revision()) {
|
||||
changed = true;
|
||||
m_textEditorConfigRevision = editorConfig.getTextEditorConfig().revision();
|
||||
}
|
||||
|
||||
if (m_markdownEditorConfigRevision != editorConfig.getMarkdownEditorConfig().revision()) {
|
||||
changed = true;
|
||||
m_markdownEditorConfigRevision = editorConfig.getMarkdownEditorConfig().revision();
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
@ -152,12 +152,14 @@ namespace vnotex
|
||||
|
||||
void removeFromImageHost(const QString &p_url);
|
||||
|
||||
bool updateConfigRevision();
|
||||
|
||||
template <class T>
|
||||
static QSharedPointer<Outline> headingsToOutline(const QVector<T> &p_headings);
|
||||
|
||||
static QSharedPointer<vte::MarkdownEditorConfig> createMarkdownEditorConfig(const MarkdownEditorConfig &p_config);
|
||||
static QSharedPointer<vte::MarkdownEditorConfig> createMarkdownEditorConfig(const EditorConfig &p_editorConfig, const MarkdownEditorConfig &p_config);
|
||||
|
||||
static QSharedPointer<vte::TextEditorParameters> createMarkdownEditorParameters(const EditorConfig& p_editorConfig, const MarkdownEditorConfig &p_config);
|
||||
static QSharedPointer<vte::TextEditorParameters> createMarkdownEditorParameters(const EditorConfig &p_editorConfig, const MarkdownEditorConfig &p_config);
|
||||
|
||||
// Splitter to hold editor and viewer.
|
||||
QSplitter *m_splitter = nullptr;
|
||||
@ -184,6 +186,8 @@ namespace vnotex
|
||||
|
||||
int m_viewerBufferRevision = 0;
|
||||
|
||||
int m_textEditorConfigRevision = 0;
|
||||
|
||||
int m_markdownEditorConfigRevision = 0;
|
||||
|
||||
ViewWindowMode m_previousMode = ViewWindowMode::Invalid;
|
||||
|
@ -30,12 +30,11 @@ void TextViewWindow::setupUI()
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
const auto &textEditorConfig = editorConfig.getTextEditorConfig();
|
||||
|
||||
m_editorConfigRevision = editorConfig.revision();
|
||||
m_textEditorConfigRevision = textEditorConfig.revision();
|
||||
updateConfigRevision();
|
||||
|
||||
// Central widget.
|
||||
{
|
||||
m_editor = new TextEditor(createTextEditorConfig(textEditorConfig),
|
||||
m_editor = new TextEditor(createTextEditorConfig(editorConfig, textEditorConfig),
|
||||
createTextEditorParameters(editorConfig, textEditorConfig),
|
||||
this);
|
||||
setCentralWidget(m_editor);
|
||||
@ -133,15 +132,33 @@ void TextViewWindow::handleEditorConfigChange()
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
const auto &textEditorConfig = editorConfig.getTextEditorConfig();
|
||||
|
||||
if (m_textEditorConfigRevision != textEditorConfig.revision()) {
|
||||
m_textEditorConfigRevision = textEditorConfig.revision();
|
||||
auto config = createTextEditorConfig(textEditorConfig);
|
||||
if (updateConfigRevision()) {
|
||||
auto config = createTextEditorConfig(editorConfig, textEditorConfig);
|
||||
m_editor->setConfig(config);
|
||||
|
||||
updateEditorFromConfig();
|
||||
}
|
||||
}
|
||||
|
||||
bool TextViewWindow::updateConfigRevision()
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
|
||||
if (m_editorConfigRevision != editorConfig.revision()) {
|
||||
changed = true;
|
||||
m_editorConfigRevision = editorConfig.revision();
|
||||
}
|
||||
|
||||
if (m_textEditorConfigRevision != editorConfig.getTextEditorConfig().revision()) {
|
||||
changed = true;
|
||||
m_textEditorConfigRevision = editorConfig.getTextEditorConfig().revision();
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
void TextViewWindow::setBufferRevisionAfterInvalidation(int p_bufferRevision)
|
||||
{
|
||||
m_bufferRevision = p_bufferRevision;
|
||||
@ -153,16 +170,17 @@ void TextViewWindow::setMode(ViewWindowMode p_mode)
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
||||
QSharedPointer<vte::TextEditorConfig> TextViewWindow::createTextEditorConfig(const TextEditorConfig &p_config)
|
||||
QSharedPointer<vte::TextEditorConfig> TextViewWindow::createTextEditorConfig(const EditorConfig &p_editorConfig, const TextEditorConfig &p_config)
|
||||
{
|
||||
const auto &themeMgr = VNoteX::getInst().getThemeMgr();
|
||||
auto config = TextViewWindowHelper::createTextEditorConfig(p_config,
|
||||
p_editorConfig.getViConfig(),
|
||||
themeMgr.getFile(Theme::File::TextEditorStyle),
|
||||
themeMgr.getEditorHighlightTheme());
|
||||
return config;
|
||||
}
|
||||
|
||||
QSharedPointer<vte::TextEditorParameters> TextViewWindow::createTextEditorParameters(const EditorConfig& p_editorConfig, const TextEditorConfig &p_config)
|
||||
QSharedPointer<vte::TextEditorParameters> TextViewWindow::createTextEditorParameters(const EditorConfig &p_editorConfig, const TextEditorConfig &p_config)
|
||||
{
|
||||
auto paras = QSharedPointer<vte::TextEditorParameters>::create();
|
||||
paras->m_spellCheckEnabled = p_config.isSpellCheckEnabled();
|
||||
|
@ -80,9 +80,11 @@ namespace vnotex
|
||||
|
||||
void handleFileOpenParameters(const QSharedPointer<FileOpenParameters> &p_paras);
|
||||
|
||||
static QSharedPointer<vte::TextEditorConfig> createTextEditorConfig(const TextEditorConfig &p_config);
|
||||
bool updateConfigRevision();
|
||||
|
||||
static QSharedPointer<vte::TextEditorParameters> createTextEditorParameters(const EditorConfig& p_editorConfig, const TextEditorConfig &p_config);
|
||||
static QSharedPointer<vte::TextEditorConfig> createTextEditorConfig(const EditorConfig &p_editorConfig, const TextEditorConfig &p_config);
|
||||
|
||||
static QSharedPointer<vte::TextEditorParameters> createTextEditorParameters(const EditorConfig &p_editorConfig, const TextEditorConfig &p_config);
|
||||
|
||||
// Managed by QObject.
|
||||
TextEditor *m_editor = nullptr;
|
||||
|
@ -14,6 +14,11 @@
|
||||
|
||||
#include "quickselector.h"
|
||||
|
||||
namespace vte
|
||||
{
|
||||
class ViConfig;
|
||||
}
|
||||
|
||||
namespace vnotex
|
||||
{
|
||||
class TextEditorConfig;
|
||||
@ -57,11 +62,14 @@ namespace vnotex
|
||||
}
|
||||
|
||||
static QSharedPointer<vte::TextEditorConfig> createTextEditorConfig(const TextEditorConfig &p_config,
|
||||
const QSharedPointer<vte::ViConfig> &p_viConfig,
|
||||
const QString &p_themeFile,
|
||||
const QString &p_syntaxTheme)
|
||||
{
|
||||
auto editorConfig = QSharedPointer<vte::TextEditorConfig>::create();
|
||||
|
||||
editorConfig->m_viConfig = p_viConfig;
|
||||
|
||||
if (!p_themeFile.isEmpty()) {
|
||||
editorConfig->m_theme = vte::Theme::createThemeFromFile(p_themeFile);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ SOURCES += \
|
||||
$$PWD/dialogs/settings/settingsdialog.cpp \
|
||||
$$PWD/dialogs/settings/texteditorpage.cpp \
|
||||
$$PWD/dialogs/settings/themepage.cpp \
|
||||
$$PWD/dialogs/settings/vipage.cpp \
|
||||
$$PWD/dialogs/snippetinfowidget.cpp \
|
||||
$$PWD/dialogs/snippetpropertiesdialog.cpp \
|
||||
$$PWD/dialogs/sortdialog.cpp \
|
||||
@ -140,6 +141,7 @@ HEADERS += \
|
||||
$$PWD/dialogs/settings/settingsdialog.h \
|
||||
$$PWD/dialogs/settings/texteditorpage.h \
|
||||
$$PWD/dialogs/settings/themepage.h \
|
||||
$$PWD/dialogs/settings/vipage.h \
|
||||
$$PWD/dialogs/snippetinfowidget.h \
|
||||
$$PWD/dialogs/snippetpropertiesdialog.h \
|
||||
$$PWD/dialogs/sortdialog.h \
|
||||
|
Loading…
x
Reference in New Issue
Block a user