From 21dada59c2510cc7b040ff812108dff4fd04a06e Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 27 Jan 2023 16:27:22 +0100 Subject: move smooth scrolling to environment --- README.md | 22 ++++++++++++++++------ config.hpp | 1 - sb.cpp | 9 +-------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a4368e7..28b0481 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,21 @@ this browser is written in c++. ## Keybindings -- k : scroll up -- j : scroll down -- o : open url +- k : scroll up +- j : scroll down +- o : open url -## TODO +## How to enable darkmode -- Execute Shell Commands -- add config-header-file +Put this line into your `profile`: +```sh +export QTWEBENGINE_CHROMIUM_FLAGS='--force-dark-mode' + +``` + +## How to enable smooth scrolling +Put this line into your `profile`: +```sh +export QTWEBENGINE_CHROMIUM_FLAGS='--enable-smooth-scrolling' + +``` diff --git a/config.hpp b/config.hpp index 7504719..8c57e2d 100644 --- a/config.hpp +++ b/config.hpp @@ -1,5 +1,4 @@ -const bool enable_smooth_scrollig = true; const char search_engine[] = "https://searx.org/search?q="; const char dmenu_args[] = "-s 0 -b"; const unsigned scroll_speed = 100; diff --git a/sb.cpp b/sb.cpp index ea9dd84..2de8c55 100644 --- a/sb.cpp +++ b/sb.cpp @@ -118,14 +118,7 @@ void help(char *arg0) { int main(int argc, char **argv) { - std::vector arg(argv, argv + argc); - - if (enable_smooth_scrollig) - arg.emplace_back((char*)"--enable-smooth-scrolling"); - - int size = arg.size(); - - QApplication app(size, arg.data()); + QApplication app(argc, argv); QWebEngineProfile profile; WebEnginePage page(&profile); QProgressBar progressbar; -- cgit v1.2.3-70-g09d2