From d8505f09ebcd1dea1a0e439d04859f225cf7ecf0 Mon Sep 17 00:00:00 2001 From: Jakub Steiner Date: Fri, 10 Dec 2021 11:36:10 +0100 Subject: [PATCH 1/2] Revert "styling: Have unfocused selections" This reverts commit 96f63a6bf343d1f2fbdbcbdaca9835fa675351dc. --- gtk/theme/Default/_common.scss | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gtk/theme/Default/_common.scss b/gtk/theme/Default/_common.scss index 2725291cfd..ebef2a800c 100644 --- a/gtk/theme/Default/_common.scss +++ b/gtk/theme/Default/_common.scss @@ -4127,11 +4127,7 @@ tooltip.csd { // catch all extend :) %selected_items { - background-color: desaturate($selected_bg_color,100%); - - &:focus-within { - background-color: $selected_bg_color; - } + background-color: $selected_bg_color; @at-root %nobg_selected_items, & { color: $selected_fg_color; From d74e62886cdbe4604829b374f56f39bb3205e3ae Mon Sep 17 00:00:00 2001 From: Jakub Steiner Date: Fri, 10 Dec 2021 12:00:12 +0100 Subject: [PATCH 2/2] selections: have unfocused state - text selections for unfocused elements - textview, label, entry, spinbutton fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4393 --- gtk/theme/Default/_colors.scss | 1 + gtk/theme/Default/_common.scss | 39 ++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/gtk/theme/Default/_colors.scss b/gtk/theme/Default/_colors.scss index 03e812447f..07e842db75 100644 --- a/gtk/theme/Default/_colors.scss +++ b/gtk/theme/Default/_colors.scss @@ -56,6 +56,7 @@ $backdrop_bg_color: $bg_color; $backdrop_fg_color: mix($fg_color, $backdrop_bg_color, 50%); $backdrop_insensitive_color: if($variant == 'light', darken($backdrop_bg_color, 15%), lighten($backdrop_bg_color, 15%)); $backdrop_selected_fg_color: if($variant == 'light', $backdrop_base_color, $backdrop_text_color); +$backdrop_selected_bg_color: transparentize(desaturate($selected_bg_color,100%),0.5); $backdrop_borders_color: mix($borders_color, $bg_color, 80%); $backdrop_dark_fill: mix($backdrop_borders_color, $backdrop_bg_color, 35%); diff --git a/gtk/theme/Default/_common.scss b/gtk/theme/Default/_common.scss index ebef2a800c..12584b3298 100644 --- a/gtk/theme/Default/_common.scss +++ b/gtk/theme/Default/_common.scss @@ -66,7 +66,13 @@ textview { > text { @extend %view; - > selection { &:focus, & { @extend %selected_items; }} + > selection { + background-color: $backdrop_selected_bg_color; + + &:focus-within { + background-color: $selected_bg_color; + } + } } &:drop(active) { @@ -152,8 +158,11 @@ label { &:selected { @extend %nobg_selected_items; } > selection { - background-color: $selected_bg_color; + background-color: $backdrop_selected_bg_color; color: $selected_fg_color; + &:focus-within { + background-color: $selected_bg_color; + } } &:disabled { @@ -318,7 +327,14 @@ entry { &:disabled { @include entry(insensitive); } - > text > selection { @extend %selected_items; } + > text > selection { + background-color: $backdrop_selected_bg_color; + color: transparent; + &:focus-within { + background-color: $selected_bg_color; + color: $selected_fg_color; + } + } // entry error and warning style @each $e_type, $e_color in (error, $error_color), @@ -1134,7 +1150,14 @@ spinbutton { padding: 0; border-radius: 0; - > selection { @extend %selected_items; } + > selection { + background-color: $backdrop_selected_bg_color; + color: transparent; + &:focus-within { + background-color: $selected_bg_color; + color: $selected_fg_color; + } + } > block-cursor { @include entry(block_cursor); } } @@ -3357,8 +3380,12 @@ columnview row:not(:selected) cell editablelabel.editing:focus-within { } columnview row:not(:selected) cell editablelabel.editing text selection { - color: $selected_fg_color; - background-color: $selected_bg_color; + background-color: $backdrop_selected_bg_color; + color: transparent; + &:focus-within { + background-color: $selected_bg_color; + color: $selected_fg_color; + } } /*******************************************************