From 9f7fde8dc9cae395605b4923324895fbe7c1c8d0 Mon Sep 17 00:00:00 2001 From: Yuuki Harano Date: Tue, 23 Feb 2021 17:53:07 +0900 Subject: [PATCH] Make scrollbars ignore scroll-bar-fore/background. * src/pgtkfns.c (pgtk_set_scroll_bar_foreground): Handle frame parameters but actually ignore it. (pgtk_set_scroll_bar_background): The same. --- src/pgtkfns.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 07636a25ca0..e9ee2ba13f3 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -853,6 +853,7 @@ pgtk_set_scroll_bar_foreground (struct frame *f, Lisp_Object new_value, if (NILP (new_value)) { gtk_css_provider_load_from_data (css_provider, "", -1, NULL); + update_face_from_frame_parameter (f, Qscroll_bar_foreground, new_value); } else if (STRINGP (new_value)) { @@ -861,10 +862,14 @@ pgtk_set_scroll_bar_foreground (struct frame *f, Lisp_Object new_value, if (!pgtk_parse_color (f, SSDATA (new_value), &rgb)) error ("Unknown color."); + /* On pgtk, this frame parameter should be ignored, and honor gtk theme. */ +#if 0 char css[64]; sprintf (css, "scrollbar slider { background-color: #%06x; }", (unsigned int) rgb.pixel & 0xffffff); gtk_css_provider_load_from_data (css_provider, css, -1, NULL); +#endif + update_face_from_frame_parameter (f, Qscroll_bar_foreground, new_value); } else @@ -881,6 +886,7 @@ pgtk_set_scroll_bar_background (struct frame *f, Lisp_Object new_value, if (NILP (new_value)) { gtk_css_provider_load_from_data (css_provider, "", -1, NULL); + update_face_from_frame_parameter (f, Qscroll_bar_background, new_value); } else if (STRINGP (new_value)) { @@ -889,10 +895,14 @@ pgtk_set_scroll_bar_background (struct frame *f, Lisp_Object new_value, if (!pgtk_parse_color (f, SSDATA (new_value), &rgb)) error ("Unknown color."); + /* On pgtk, this frame parameter should be ignored, and honor gtk theme. */ +#if 0 char css[64]; sprintf (css, "scrollbar trough { background-color: #%06x; }", (unsigned int) rgb.pixel & 0xffffff); gtk_css_provider_load_from_data (css_provider, css, -1, NULL); +#endif + update_face_from_frame_parameter (f, Qscroll_bar_background, new_value); } else -- 2.39.5