diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-04 21:03:14 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-05-04 21:03:14 +0200 |
commit | 591e25eb4431e44e8ae28da299e2f024a95c2c03 (patch) | |
tree | 5963ced1a971fb630d70125b4b03cc9da3e8c8e2 /lib | |
parent | Merge address bar menus (diff) | |
download | smolbote-591e25eb4431e44e8ae28da299e2f024a95c2c03.tar.xz |
Stylesheet load setting
Diffstat (limited to 'lib')
-rw-r--r-- | lib/addressbar/addressbar.cpp | 2 | ||||
-rw-r--r-- | lib/addressbar/completer.cpp | 1 | ||||
-rw-r--r-- | lib/addressbar/urllineedit.cpp | 1 | ||||
-rw-r--r-- | lib/configuration/configuration.cpp | 2 | ||||
-rw-r--r-- | lib/configuration/configuration.h | 6 |
5 files changed, 9 insertions, 3 deletions
diff --git a/lib/addressbar/addressbar.cpp b/lib/addressbar/addressbar.cpp index a923e72..2215c0e 100644 --- a/lib/addressbar/addressbar.cpp +++ b/lib/addressbar/addressbar.cpp @@ -30,13 +30,13 @@ AddressBar::AddressBar(const QHash<QString, QString> &config, QWidget *parent) urlBar->selectAll(); }); - connect(urlBar, &UrlLineEdit::textEdited, [=](const QString &text) { std::function<void(QStringList &)> callback = std::bind(&UrlLineEdit::updateCompleter, urlBar, std::placeholders::_1); emit complete(text, callback); }); progressBar = new QProgressBar(this); + progressBar->setObjectName("LoadingBar"); progressBar->setMaximumHeight(5); progressBar->setTextVisible(false); layout()->addWidget(progressBar); diff --git a/lib/addressbar/completer.cpp b/lib/addressbar/completer.cpp index 9b95ac0..6c04775 100644 --- a/lib/addressbar/completer.cpp +++ b/lib/addressbar/completer.cpp @@ -12,6 +12,7 @@ Completer::Completer(QWidget *parent) : QListView(parent) { + setObjectName("Completer"); setWindowFlags(Qt::ToolTip); } diff --git a/lib/addressbar/urllineedit.cpp b/lib/addressbar/urllineedit.cpp index f92518e..ac311b3 100644 --- a/lib/addressbar/urllineedit.cpp +++ b/lib/addressbar/urllineedit.cpp @@ -16,6 +16,7 @@ UrlLineEdit::UrlLineEdit(QWidget *parent) : QLineEdit(parent) , m_listView(new Completer(this)) { + setObjectName("UrlBar"); setPlaceholderText(tr("Enter address")); m_listView->setVisible(false); diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp index 6351348..1829a5e 100644 --- a/lib/configuration/configuration.cpp +++ b/lib/configuration/configuration.cpp @@ -53,6 +53,8 @@ Configuration::Configuration() ; configuration_desc.add_options() + ("browser.stylesheet", po::value<std::string>()) + // main window ui ("mainwindow.height", po::value<int>()->default_value(720)) ("mainwindow.width", po::value<int>()->default_value(1280)) diff --git a/lib/configuration/configuration.h b/lib/configuration/configuration.h index 5bb9f5d..af75122 100644 --- a/lib/configuration/configuration.h +++ b/lib/configuration/configuration.h @@ -31,11 +31,13 @@ public: { // if setting doesn't exist, we crash // in debug builds, check if setting exists -#ifdef QT_DEBUG + if(vm.count(path) == 0) { +#ifdef QT_DEBUG qWarning("value(%s) does not exist, probably crashing now", path); - } #endif + return std::nullopt; + } if constexpr(std::is_same_v<T, std::string>) { std::string r; |