summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2019-12-16 12:16:09 +0100
committerFlorian Bruhin <me@the-compiler.org>2019-12-16 12:16:26 +0100
commit036ddb431f118840a0ffd8aefd26536b194918b8 (patch)
treef38cfd8db2e9504800ca0724572db7af44f2b89e
parent64b0fb41d338739913e75d0d5024b5188d657573 (diff)
downloadqutebrowser-036ddb431f118840a0ffd8aefd26536b194918b8.tar.gz
qutebrowser-036ddb431f118840a0ffd8aefd26536b194918b8.zip
Add settings to customize context menus
-rw-r--r--doc/changelog.asciidoc4
-rw-r--r--doc/help/settings.asciidoc30
-rw-r--r--qutebrowser/config/configdata.yml30
-rw-r--r--qutebrowser/mainwindow/mainwindow.py12
4 files changed, 76 insertions, 0 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index 753d29ced..34d3f71b6 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -23,6 +23,10 @@ Added
- New `tabs.tooltips` setting which can be used to disable hover tooltips for
tabs.
+- New settings to configure the appearance of context menus:
+ - `fonts.contextmenu`
+ - `colors.contextmenu.bg`
+ - `colors.contextmenu.fg`
Changed
~~~~~~~
diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc
index 38732f88b..355c30153 100644
--- a/doc/help/settings.asciidoc
+++ b/doc/help/settings.asciidoc
@@ -32,6 +32,8 @@
|<<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.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.
@@ -183,6 +185,7 @@
|<<editor.encoding,editor.encoding>>|Encoding to use for the editor.
|<<fonts.completion.category,fonts.completion.category>>|Font used in the completion categories.
|<<fonts.completion.entry,fonts.completion.entry>>|Font used in the completion widget.
+|<<fonts.contextmenu,fonts.contextmenu>>|Font used for the context menu.
|<<fonts.debug_console,fonts.debug_console>>|Font used for the debugging console.
|<<fonts.downloads,fonts.downloads>>|Font used for the downloadbar.
|<<fonts.hints,fonts.hints>>|Font used for the hints.
@@ -855,6 +858,24 @@ Type: <<types,QssColor>>
Default: +pass:[white]+
+[[colors.contextmenu.bg]]
+=== colors.contextmenu.bg
+Background color of the context menu.
+If set to null, the Qt default is used.
+
+Type: <<types,QssColor>>
+
+Default: empty
+
+[[colors.contextmenu.fg]]
+=== colors.contextmenu.fg
+Foreground color of the context menu.
+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.
@@ -2371,6 +2392,15 @@ Type: <<types,Font>>
Default: +pass:[10pt monospace]+
+[[fonts.contextmenu]]
+=== fonts.contextmenu
+Font used for the context menu.
+If set to null, the Qt default is used.
+
+Type: <<types,Font>>
+
+Default: empty
+
[[fonts.debug_console]]
=== fonts.debug_console
Font used for the debugging console.
diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml
index 21380f81d..84c157b28 100644
--- a/qutebrowser/config/configdata.yml
+++ b/qutebrowser/config/configdata.yml
@@ -2040,6 +2040,26 @@ colors.completion.scrollbar.bg:
type: QssColor
desc: Color of the scrollbar in the completion view.
+colors.contextmenu.bg:
+ type:
+ name: QssColor
+ none_ok: true
+ default: null
+ desc: >-
+ Background color of the context menu.
+
+ If set to null, the Qt default is used.
+
+colors.contextmenu.fg:
+ type:
+ name: QssColor
+ none_ok: true
+ default: null
+ desc: >-
+ Foreground color of the context menu.
+
+ If set to null, the Qt default is used.
+
colors.downloads.bar.bg:
default: black
type: QssColor
@@ -2438,6 +2458,16 @@ fonts.completion.category:
type: Font
desc: Font used in the completion categories.
+fonts.contextmenu:
+ type:
+ name: Font
+ none_ok: true
+ default: null
+ desc: >-
+ Font used for the context menu.
+
+ If set to null, the Qt default is used.
+
fonts.debug_console:
default: 10pt monospace
type: QtFont
diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py
index 435416027..ac5df12e6 100644
--- a/qutebrowser/mainwindow/mainwindow.py
+++ b/qutebrowser/mainwindow/mainwindow.py
@@ -160,6 +160,18 @@ class MainWindow(QWidget):
padding-left: 3px;
padding-right: 3px;
}
+
+ QMenu {
+ {% if conf.fonts.contextmenu %}
+ font: {{ conf.fonts.contextmenu }};
+ {% endif %}
+ {% if conf.colors.contextmenu.bg %}
+ background-color: {{ conf.colors.contextmenu.bg }};
+ {% endif %}
+ {% if conf.colors.contextmenu.fg %}
+ color: {{ conf.colors.contextmenu.fg }};
+ {% endif %}
+ }
"""
def __init__(self, *, private, geometry=None, parent=None):