-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathravenmonaco.cpp
More file actions
31 lines (23 loc) · 887 Bytes
/
ravenmonaco.cpp
File metadata and controls
31 lines (23 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "ravenmonaco.h"
#include <QGuiApplication>
#include <QStyleHints>
#include <QWebChannel>
namespace fs = std::filesystem;
RavenMonaco::RavenMonaco(QWidget *parent) : QWebEngineView{parent}, m_page{new RavenMonacoPage(this)} {
// Init page
setPage(m_page);
// Init HTTP server for monaco-editor
m_server = new RavenMonacoHTTPServer(this);
m_server->init();
// Init bridge
m_bridge = new RavenMonacoBridge(this, (RavenEditor *)parent);
m_channel = new QWebChannel(this);
m_page->setWebChannel(m_channel);
m_channel->registerObject("cppBridge", m_bridge);
m_page->init();
// Light/dark theme switcher
// FIXME: Can we move this to page instead?
QStyleHints *hint = QGuiApplication::styleHints();
connect(hint, &QStyleHints::colorSchemeChanged, page(), &RavenMonacoPage::setTheme);
}
RavenMonaco::~RavenMonaco() {}