diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-08-02 03:04:46 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-08-04 05:23:09 +0200 |
commit | 2ff01f9fdb374695aaaa074255c5f6916d5767bf (patch) | |
tree | 5b30408c9c6efbeee00fdc6c8ce2193b7cae842b /src/sdgui.c | |
parent | 5ed881d25bb9a73df57624d73cafb1af1638688e (diff) | |
download | tdv-2ff01f9fdb374695aaaa074255c5f6916d5767bf.tar.gz tdv-2ff01f9fdb374695aaaa074255c5f6916d5767bf.tar.xz tdv-2ff01f9fdb374695aaaa074255c5f6916d5767bf.zip |
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
Diffstat (limited to 'src/sdgui.c')
-rw-r--r-- | src/sdgui.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 (); |