qutebrowser icon indicating copy to clipboard operation
qutebrowser copied to clipboard

Style CompletionView scrollbar

Open The-Compiler opened this issue 12 years ago • 5 comments

The-Compiler avatar Oct 01 '14 19:10 The-Compiler

Doing this would mean adding some entries to the CompletionView stylesheet:

diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py
index 388c84b..e24b76b 100644
--- a/qutebrowser/completion/completionwidget.py
+++ b/qutebrowser/completion/completionwidget.py
@@ -81,6 +81,10 @@ class CompletionView(QTreeView):
         QTreeView:item::hover {
             border: 0px;
         }
+
+        QTreeView QScrollBar {
+            {{ color['completion.bg'] }}
+        }
     """

     # FIXME style scrollbar

This however looks bad because the shadows need customizing too. I also think those deserve their own entries in the config file.

See Customizing QScrollBar to see what can be customized.

The-Compiler avatar Aug 25 '15 09:08 The-Compiler

I would suggest removing the add-line and sub-line all together, and allow the following:

completion.scrollbar.fg
completion.scrollbar.bg
completion.scrollbar.width
completion.scrollbar.padding

where fg refers to the handle, and bg the scrollbar. 'padding' would be the border width value of the scroll handle.

for example, with

completion.scrollbar.fg = #ffffff
completion.scrollbar.bg = #000000
completion.scrollbar.width = 12
completion.scrollbar.padding = 2

one would get: one

my current style for this:

diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py
index 9281a05..3f81ee6 100644
--- a/qutebrowser/completion/completionwidget.py
+++ b/qutebrowser/completion/completionwidget.py
@@ -81,6 +81,21 @@ class CompletionView(QTreeView):
         QTreeView:item::hover {
             border: 0px;
         }
+
+        QTreeView QScrollBar {
+            width: 12px;
+            background: #000000;
+        }
+
+        QTreeView QScrollBar::handle{
+            background: #ffffff;
+            border: 2px solid #000000;
+        }
+
+        QTreeView QScrollBar::sub-line, QScrollBar::add-line{
+            border: none;
+            background:none;
+        }
     """

     # FIXME style scrollbar

an alternative setting(width=2, padding=0) would render: two

thoughts?

neeasade avatar Oct 15 '15 15:10 neeasade

Second one seems to match design trends perfectly.

r8b7xy avatar Oct 15 '15 15:10 r8b7xy

@neeasade I like it. The default colours should probably be sourced from other ui elements though, eg. ${statusbar.fg} and ${statusbar.bg}.

lamarpavel avatar Oct 17 '15 14:10 lamarpavel

@lamarpavel thanks - going with defaults of ${completion.fg} and ${completion.bg} in pull https://github.com/The-Compiler/qutebrowser/issues/1019 .

neeasade avatar Oct 17 '15 19:10 neeasade