diff options
author | Florian Bruhin <me@the-compiler.org> | 2019-12-30 17:56:15 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2019-12-30 17:56:15 +0100 |
commit | d2362d3aa05c8e3311197f63ef47ee95ff7c6f28 (patch) | |
tree | 523e65f960355ec35ffdebf02919b89ec83c0f17 | |
parent | 7c4ba0b86b70add9efa165bebf485df698479f01 (diff) | |
download | qutebrowser-d2362d3aa05c8e3311197f63ef47ee95ff7c6f28.tar.gz qutebrowser-d2362d3aa05c8e3311197f63ef47ee95ff7c6f28.zip |
Add more colors.contextmenu settings
-rw-r--r-- | doc/changelog.asciidoc | 6 | ||||
-rw-r--r-- | doc/help/settings.asciidoc | 32 | ||||
-rw-r--r-- | qutebrowser/config/configdata.yml | 28 | ||||
-rw-r--r-- | qutebrowser/mainwindow/mainwindow.py | 17 |
4 files changed, 70 insertions, 13 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 9f7a22ac2..cc44bffd7 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -26,8 +26,10 @@ Added tabs. - New settings to configure the appearance of context menus: - `fonts.contextmenu` - - `colors.contextmenu.bg` - - `colors.contextmenu.fg` + - `colors.contextmenu.menu.bg` + - `colors.contextmenu.menu.fg` + - `colors.contextmenu.active.bg` + - `colors.contextmenu.active.fg` - New `content.site_specific_quirks` setting which enables workarounds for websites with broken user agent parsing (enabled by default, see the "Fixed" section for fixed websites). diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 3f43495c3..7cab1dbe9 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -32,8 +32,10 @@ |<<colors.completion.odd.bg,colors.completion.odd.bg>>|Background color of the completion widget for odd rows. |<<colors.completion.scrollbar.bg,colors.completion.scrollbar.bg>>|Color of the scrollbar in the completion view. |<<colors.completion.scrollbar.fg,colors.completion.scrollbar.fg>>|Color of the scrollbar handle in the completion view. -|<<colors.contextmenu.bg,colors.contextmenu.bg>>|Background color of the context menu. -|<<colors.contextmenu.fg,colors.contextmenu.fg>>|Foreground color of the context menu. +|<<colors.contextmenu.menu.bg,colors.contextmenu.menu.bg>>|Background color of the context menu. +|<<colors.contextmenu.menu.fg,colors.contextmenu.menu.fg>>|Foreground color of the context menu. +|<<colors.contextmenu.selected.bg,colors.contextmenu.selected.bg>>|Background color of the context menu's selected item. +|<<colors.contextmenu.selected.fg,colors.contextmenu.selected.fg>>|Foreground color of the context menu's selected item. |<<colors.downloads.bar.bg,colors.downloads.bar.bg>>|Background color for the download bar. |<<colors.downloads.error.bg,colors.downloads.error.bg>>|Background color for downloads with errors. |<<colors.downloads.error.fg,colors.downloads.error.fg>>|Foreground color for downloads with errors. @@ -860,8 +862,8 @@ Type: <<types,QssColor>> Default: +pass:[white]+ -[[colors.contextmenu.bg]] -=== colors.contextmenu.bg +[[colors.contextmenu.menu.bg]] +=== colors.contextmenu.menu.bg Background color of the context menu. If set to null, the Qt default is used. @@ -869,8 +871,8 @@ Type: <<types,QssColor>> Default: empty -[[colors.contextmenu.fg]] -=== colors.contextmenu.fg +[[colors.contextmenu.menu.fg]] +=== colors.contextmenu.menu.fg Foreground color of the context menu. If set to null, the Qt default is used. @@ -878,6 +880,24 @@ Type: <<types,QssColor>> Default: empty +[[colors.contextmenu.selected.bg]] +=== colors.contextmenu.selected.bg +Background color of the context menu's selected item. +If set to null, the Qt default is used. + +Type: <<types,QssColor>> + +Default: empty + +[[colors.contextmenu.selected.fg]] +=== colors.contextmenu.selected.fg +Foreground color of the context menu's selected item. +If set to null, the Qt default is used. + +Type: <<types,QssColor>> + +Default: empty + [[colors.downloads.bar.bg]] === colors.downloads.bar.bg Background color for the download bar. diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 8d157d442..1814c3a5a 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -2084,6 +2084,12 @@ colors.completion.scrollbar.bg: desc: Color of the scrollbar in the completion view. colors.contextmenu.bg: + renamed: colors.contextmenu.menu.bg + +colors.contextmenu.fg: + renamed: colors.contextmenu.menu.fg + +colors.contextmenu.menu.bg: type: name: QssColor none_ok: true @@ -2093,7 +2099,7 @@ colors.contextmenu.bg: If set to null, the Qt default is used. -colors.contextmenu.fg: +colors.contextmenu.menu.fg: type: name: QssColor none_ok: true @@ -2103,6 +2109,26 @@ colors.contextmenu.fg: If set to null, the Qt default is used. +colors.contextmenu.selected.bg: + type: + name: QssColor + none_ok: true + default: null + desc: >- + Background color of the context menu's selected item. + + If set to null, the Qt default is used. + +colors.contextmenu.selected.fg: + type: + name: QssColor + none_ok: true + default: null + desc: >- + Foreground color of the context menu's selected item. + + If set to null, the Qt default is used. + colors.downloads.bar.bg: default: black type: QssColor diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index e0f047bfb..c2dea4dc7 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -165,11 +165,20 @@ class MainWindow(QWidget): {% if conf.fonts.contextmenu %} font: {{ conf.fonts.contextmenu }}; {% endif %} - {% if conf.colors.contextmenu.bg %} - background-color: {{ conf.colors.contextmenu.bg }}; + {% if conf.colors.contextmenu.menu.bg %} + background-color: {{ conf.colors.contextmenu.menu.bg }}; {% endif %} - {% if conf.colors.contextmenu.fg %} - color: {{ conf.colors.contextmenu.fg }}; + {% if conf.colors.contextmenu.menu.fg %} + color: {{ conf.colors.contextmenu.menu.fg }}; + {% endif %} + } + + QMenu::item:selected { + {% if conf.colors.contextmenu.selected.bg %} + background-color: {{ conf.colors.contextmenu.selected.bg }}; + {% endif %} + {% if conf.colors.contextmenu.selected.fg %} + color: {{ conf.colors.contextmenu.selected.fg }}; {% endif %} } """ |