[evince/wip/gpoo/gtk4-rebase-port: 63/72] ev-view: detect the selection color for Default theme
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/wip/gpoo/gtk4-rebase-port: 63/72] ev-view: detect the selection color for Default theme
- Date: Mon, 21 Mar 2022 05:37:34 +0000 (UTC)
commit 94599fde1652ca2da988a5f247b0f1df839f5dbe
Author: Qiu Wenbo <qiuwenbo kylinos com cn>
Date: Mon Aug 30 16:57:15 2021 +0800
ev-view: detect the selection color for Default theme
Since the previewer use Default theme by default.
Signed-off-by: Qiu Wenbo <qiuwenbo kylinos com cn>
libview/ev-view.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 71e5b800f..2a3978d2b 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -7142,17 +7142,28 @@ _ev_view_get_selection_colors (EvView *view,
GtkWidget *widget = GTK_WIDGET (view);
GtkStyleContext *context = gtk_widget_get_style_context (widget);
- if (bg_color) {
- gtk_style_context_lookup_color (context, "accent_bg_color", bg_color);
+ if (bg_color &&
+ !gtk_style_context_lookup_color (context, "accent_bg_color", bg_color) &&
+ !gtk_style_context_lookup_color (context, "theme_selected_bg_color", bg_color)) {
+ bg_color->red = 0;
+ bg_color->green = 0.623;
+ bg_color->blue = 1.;
+ bg_color->alpha = 1.;
+ }
- if (gtk_widget_has_focus (widget))
- bg_color->alpha = 0.3;
- else
- bg_color->alpha = 0.6;
- }
+ if (gtk_widget_has_focus (widget))
+ bg_color->alpha = 0.3;
+ else
+ bg_color->alpha = 0.6;
- if (fg_color)
- gtk_style_context_lookup_color (context, "accent_fg_color", fg_color);
+ if (fg_color &&
+ !gtk_style_context_lookup_color (context, "accent_fg_color", fg_color) &&
+ !gtk_style_context_lookup_color (context, "theme_selected_fg_color", fg_color)) {
+ fg_color->red = 1.;
+ fg_color->green = 1.;
+ fg_color->blue = 1.;
+ fg_color->alpha = 1.;
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]