aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index bfe4ecd..548aec8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -12,11 +12,15 @@
#include "webengine/webprofile.h"
#include <configuration/configuration.h>
#include <memory>
+#include <QFile>
int main(int argc, char **argv)
{
Browser app(argc, argv);
+ // set this, otherwise the webview becomes black when using a stylesheet
+ app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
+
// create and load configuration
std::shared_ptr<Configuration> config = std::make_shared<Configuration>();
if(!config->parseCommandLine(argc, argv)) {
@@ -37,6 +41,15 @@ int main(int argc, char **argv)
// if we are the only instance, set up the browser
if(isSingleInstance) {
+ auto stylesheet = config->value<std::string>("browser.stylesheet");
+ if(stylesheet) {
+ QFile f(QString::fromStdString(stylesheet.value()));
+ if(f.open(QIODevice::ReadOnly)) {
+ app.setStyleSheet(f.readAll());
+ f.close();
+ }
+ }
+
app.setup(QString::fromStdString(config->value<std::string>("profile.default").value()));
QObject::connect(&app, &Browser::messageAvailable, &app, &Browser::createSession);
}