mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
Automatic color scheme switching: Fix title bar and scroll bar colors not being updated
Fixes #9167
This commit is contained in:
@@ -148,6 +148,9 @@ Detailed list of changes
|
|||||||
|
|
||||||
- Graphics: Fix overwrite composition mode for animation frames not being honored
|
- Graphics: Fix overwrite composition mode for animation frames not being honored
|
||||||
|
|
||||||
|
- Automatic color scheme switching: Fix title bar and scroll bar colors not being updated (:iss:`9167`)
|
||||||
|
|
||||||
|
|
||||||
0.44.0 [2025-11-03]
|
0.44.0 [2025-11-03]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@@ -197,8 +200,6 @@ Detailed list of changes
|
|||||||
- Wayland: Fix scrolling using some mouse wheels that produce "VALUE120" based
|
- Wayland: Fix scrolling using some mouse wheels that produce "VALUE120" based
|
||||||
scroll events too fast on some compositors (:pull:`9128`)
|
scroll events too fast on some compositors (:pull:`9128`)
|
||||||
|
|
||||||
- Automatic color scheme switching: Fix title bar color not being updated (:iss:`9167`)
|
|
||||||
|
|
||||||
- Add support for Unicode 17
|
- Add support for Unicode 17
|
||||||
|
|
||||||
- Fix a regression in 0.43.0 that caused :opt:`tab_bar_margin_width` to be
|
- Fix a regression in 0.43.0 that caused :opt:`tab_bar_margin_width` to be
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from typing import Literal, Optional, TypedDict
|
|||||||
from .config import parse_config
|
from .config import parse_config
|
||||||
from .constants import config_dir
|
from .constants import config_dir
|
||||||
from .fast_data_types import Color, get_boss, get_options, glfw_get_system_color_theme, patch_color_profiles, patch_global_colors, set_os_window_chrome
|
from .fast_data_types import Color, get_boss, get_options, glfw_get_system_color_theme, patch_color_profiles, patch_global_colors, set_os_window_chrome
|
||||||
from .options.types import Options, nullable_colors
|
from .options.types import Options, nullable_colors, special_colors
|
||||||
from .rgb import color_from_int
|
from .rgb import color_from_int
|
||||||
from .typing_compat import WindowType
|
from .typing_compat import WindowType
|
||||||
|
|
||||||
@@ -52,6 +52,8 @@ class ThemeColors:
|
|||||||
defval = getattr(defaults, name)
|
defval = getattr(defaults, name)
|
||||||
if isinstance(defval, Color):
|
if isinstance(defval, Color):
|
||||||
ans[name] = int(defval)
|
ans[name] = int(defval)
|
||||||
|
for name in special_colors:
|
||||||
|
ans[name] = getattr(defaults, name)
|
||||||
self.default_colors = ans
|
self.default_colors = ans
|
||||||
self.default_background_image_options: BackgroundImageOptions = {
|
self.default_background_image_options: BackgroundImageOptions = {
|
||||||
k: getattr(defaults, k) for k in BackgroundImageOptions.__optional_keys__} # type: ignore
|
k: getattr(defaults, k) for k in BackgroundImageOptions.__optional_keys__} # type: ignore
|
||||||
@@ -190,8 +192,9 @@ theme_colors = ThemeColors()
|
|||||||
|
|
||||||
|
|
||||||
def parse_colors(args: Iterable[str | Iterable[str]], background_image_options: BackgroundImageOptions | None = None) -> Colors:
|
def parse_colors(args: Iterable[str | Iterable[str]], background_image_options: BackgroundImageOptions | None = None) -> Colors:
|
||||||
colors: dict[str, Color | None] = {}
|
colors: dict[str, Color | None | int] = {}
|
||||||
nullable_color_map: dict[str, int | None] = {}
|
nullable_color_map: dict[str, int | None] = {}
|
||||||
|
special_color_map: dict[str, int] = {}
|
||||||
transparent_background_colors = ()
|
transparent_background_colors = ()
|
||||||
for spec in args:
|
for spec in args:
|
||||||
if isinstance(spec, str):
|
if isinstance(spec, str):
|
||||||
@@ -213,8 +216,13 @@ def parse_colors(args: Iterable[str | Iterable[str]], background_image_options:
|
|||||||
if q is not False:
|
if q is not False:
|
||||||
val = int(q) if isinstance(q, Color) else None
|
val = int(q) if isinstance(q, Color) else None
|
||||||
nullable_color_map[k] = val
|
nullable_color_map[k] = val
|
||||||
|
for k in special_colors:
|
||||||
|
sq = colors.pop(k, None)
|
||||||
|
if isinstance(sq, int):
|
||||||
|
special_color_map[k] = sq
|
||||||
ans: dict[str, int | None] = {k: int(v) for k, v in colors.items() if isinstance(v, Color)}
|
ans: dict[str, int | None] = {k: int(v) for k, v in colors.items() if isinstance(v, Color)}
|
||||||
ans.update(nullable_color_map)
|
ans.update(nullable_color_map)
|
||||||
|
ans.update(special_color_map)
|
||||||
return ans, transparent_background_colors
|
return ans, transparent_background_colors
|
||||||
|
|
||||||
|
|
||||||
@@ -228,7 +236,10 @@ def patch_options_with_color_spec(
|
|||||||
if k in nullable_colors:
|
if k in nullable_colors:
|
||||||
setattr(opts, k, None)
|
setattr(opts, k, None)
|
||||||
else:
|
else:
|
||||||
setattr(opts, k, color_from_int(v))
|
if k in special_colors:
|
||||||
|
setattr(opts, k, v)
|
||||||
|
else:
|
||||||
|
setattr(opts, k, color_from_int(v))
|
||||||
opts.transparent_background_colors = transparent_background_colors
|
opts.transparent_background_colors = transparent_background_colors
|
||||||
if background_image_options is not None:
|
if background_image_options is not None:
|
||||||
for k, bv in background_image_options.items():
|
for k, bv in background_image_options.items():
|
||||||
|
|||||||
@@ -1202,6 +1202,7 @@ PYWRAP1(patch_global_colors) {
|
|||||||
}
|
}
|
||||||
P(active_border_color); P(inactive_border_color); P(bell_border_color); P(tab_bar_background);
|
P(active_border_color); P(inactive_border_color); P(bell_border_color); P(tab_bar_background);
|
||||||
P(tab_bar_margin_color); P(macos_titlebar_color); P(wayland_titlebar_color);
|
P(tab_bar_margin_color); P(macos_titlebar_color); P(wayland_titlebar_color);
|
||||||
|
P(scrollbar_handle_color); P(scrollbar_track_color);
|
||||||
if (configured) {
|
if (configured) {
|
||||||
P(background); P(url_color);
|
P(background); P(url_color);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user