summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-06-04 00:57:36 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-06-04 00:57:36 +0200
commita73fee80453ef485f8df35000de06d6732ba9af6 (patch)
tree793e804151a9ffa450c4e25c268b64bf89fd302a
parent368061dc3d87ecf68cffeeb95bc6b059b370ce8a (diff)
downloadqutebrowser-a73fee80453ef485f8df35000de06d6732ba9af6.tar.gz
qutebrowser-a73fee80453ef485f8df35000de06d6732ba9af6.zip
Add settings to customize tooltips
See #7706
-rw-r--r--doc/changelog.asciidoc1
-rw-r--r--doc/help/settings.asciidoc30
-rw-r--r--qutebrowser/config/configdata.yml30
-rw-r--r--qutebrowser/mainwindow/mainwindow.py12
4 files changed, 73 insertions, 0 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index 2c1763afc..50d157d40 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -51,6 +51,7 @@ Added
* `qute-keepassxc` now supports unlock-on-demand, multiple account
selection via rofi, and inserting TOTP-codes (experimental).
- New `colors.webpage.darkmode.increase_text_contrast` setting for Qt 6.3+
+- New `fonts.tooltip`, `colors.tooltip.bg` and `colors.tooltip.fg` settings.
Removed
~~~~~~~
diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc
index 0e58fda8c..34262b945 100644
--- a/doc/help/settings.asciidoc
+++ b/doc/help/settings.asciidoc
@@ -112,6 +112,8 @@
|<<colors.tabs.selected.even.fg,colors.tabs.selected.even.fg>>|Foreground color of selected even tabs.
|<<colors.tabs.selected.odd.bg,colors.tabs.selected.odd.bg>>|Background color of selected odd tabs.
|<<colors.tabs.selected.odd.fg,colors.tabs.selected.odd.fg>>|Foreground color of selected odd tabs.
+|<<colors.tooltip.bg,colors.tooltip.bg>>|Background color of tooltips.
+|<<colors.tooltip.fg,colors.tooltip.fg>>|Foreground color of tooltips.
|<<colors.webpage.bg,colors.webpage.bg>>|Background color for webpages if unset (or empty to use the theme's color).
|<<colors.webpage.darkmode.algorithm,colors.webpage.darkmode.algorithm>>|Which algorithm to use for modifying how colors are rendered with darkmode.
|<<colors.webpage.darkmode.contrast,colors.webpage.darkmode.contrast>>|Contrast for dark mode.
@@ -237,6 +239,7 @@
|<<fonts.statusbar,fonts.statusbar>>|Font used in the statusbar.
|<<fonts.tabs.selected,fonts.tabs.selected>>|Font used for selected tabs.
|<<fonts.tabs.unselected,fonts.tabs.unselected>>|Font used for unselected tabs.
+|<<fonts.tooltip,fonts.tooltip>>|Font used for tooltips.
|<<fonts.web.family.cursive,fonts.web.family.cursive>>|Font family for cursive fonts.
|<<fonts.web.family.fantasy,fonts.web.family.fantasy>>|Font family for fantasy fonts.
|<<fonts.web.family.fixed,fonts.web.family.fixed>>|Font family for fixed fonts.
@@ -1614,6 +1617,24 @@ Type: <<types,QtColor>>
Default: +pass:[white]+
+[[colors.tooltip.bg]]
+=== colors.tooltip.bg
+Background color of tooltips.
+If set to null, the Qt default is used.
+
+Type: <<types,QssColor>>
+
+Default: empty
+
+[[colors.tooltip.fg]]
+=== colors.tooltip.fg
+Foreground color of tooltips.
+If set to null, the Qt default is used.
+
+Type: <<types,QssColor>>
+
+Default: empty
+
[[colors.webpage.bg]]
=== colors.webpage.bg
Background color for webpages if unset (or empty to use the theme's color).
@@ -3186,6 +3207,15 @@ Type: <<types,Font>>
Default: +pass:[default_size default_family]+
+[[fonts.tooltip]]
+=== fonts.tooltip
+Font used for tooltips.
+If set to null, the Qt default is used.
+
+Type: <<types,Font>>
+
+Default: empty
+
[[fonts.web.family.cursive]]
=== fonts.web.family.cursive
Font family for cursive fonts.
diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml
index e8975373a..bedcc2ade 100644
--- a/qutebrowser/config/configdata.yml
+++ b/qutebrowser/config/configdata.yml
@@ -2726,6 +2726,26 @@ colors.contextmenu.bg:
colors.contextmenu.fg:
renamed: colors.contextmenu.menu.fg
+colors.tooltip.bg:
+ type:
+ name: QssColor
+ none_ok: true
+ default: null
+ desc: >-
+ Background color of tooltips.
+
+ If set to null, the Qt default is used.
+
+colors.tooltip.fg:
+ type:
+ name: QssColor
+ none_ok: true
+ default: null
+ desc: >-
+ Foreground color of tooltips.
+
+ If set to null, the Qt default is used.
+
colors.contextmenu.menu.bg:
type:
name: QssColor
@@ -3392,6 +3412,16 @@ fonts.completion.category:
type: Font
desc: Font used in the completion categories.
+fonts.tooltip:
+ type:
+ name: Font
+ none_ok: true
+ default: null
+ desc: >-
+ Font used for tooltips.
+
+ If set to null, the Qt default is used.
+
fonts.contextmenu:
type:
name: Font
diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py
index 4b01dadfd..dccf9cea7 100644
--- a/qutebrowser/mainwindow/mainwindow.py
+++ b/qutebrowser/mainwindow/mainwindow.py
@@ -152,6 +152,18 @@ class MainWindow(QWidget):
padding-bottom: {{ conf.hints.padding['bottom'] }}px;
}
+ QToolTip {
+ {% if conf.fonts.tooltip %}
+ font: {{ conf.fonts.tooltip }};
+ {% endif %}
+ {% if conf.colors.tooltip.bg %}
+ background-color: {{ conf.colors.tooltip.bg }};
+ {% endif %}
+ {% if conf.colors.tooltip.fg %}
+ color: {{ conf.colors.tooltip.fg }};
+ {% endif %}
+ }
+
QMenu {
{% if conf.fonts.contextmenu %}
font: {{ conf.fonts.contextmenu }};