From 2ff01f9fdb374695aaaa074255c5f6916d5767bf Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Tue, 2 Aug 2022 03:04:46 +0200 Subject: sdgui: support text selection in the view This is generally an improvement over the initial GtkLabel approach: - Multiple definition lines can be selected at once. - The widget doesn't keep a selection caret around (which means it can't be controlled from the keyboard, a conscious trade-off). - Text doesn't needlessly go to PRIMARY immediately during selection, making it somewhat possible lift the self-exception for the PRIMARY selection watch. Closes #2 --- src/sdgui.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sdgui.c') diff --git a/src/sdgui.c b/src/sdgui.c index 2c92ac3..e0becd3 100644 --- a/src/sdgui.c +++ b/src/sdgui.c @@ -454,7 +454,10 @@ main (int argc, char *argv[]) "stardict-view.even:backdrop {" "background: mix(@theme_unfocused_base_color, " "@theme_fg_color, 0.03); " - "color: @theme_fg_color; /* should be more faded than 'text' */ }"; + "color: @theme_fg_color; /* should be more faded than 'text' */ }" + "stardict-view:selected {" + "background-color: @theme_selected_bg_color; " + "color: @theme_selected_fg_color; }"; GdkScreen *screen = gdk_screen_get_default (); GtkCssProvider *provider = gtk_css_provider_new (); -- cgit v1.2.3-70-g09d2