Merge branch 'wip/jimmac/unfocused-selection-dejavu' into 'main'

Revert "styling: Have unfocused selections"

Closes #4393

See merge request GNOME/gtk!4228
This commit is contained in:
Matthias Clasen 2021-12-10 13:17:32 +00:00
commit d6181b2335
2 changed files with 35 additions and 11 deletions

View File

@ -56,6 +56,7 @@ $backdrop_bg_color: $bg_color;
$backdrop_fg_color: mix($fg_color, $backdrop_bg_color, 50%); $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_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_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_borders_color: mix($borders_color, $bg_color, 80%);
$backdrop_dark_fill: mix($backdrop_borders_color, $backdrop_bg_color, 35%); $backdrop_dark_fill: mix($backdrop_borders_color, $backdrop_bg_color, 35%);

View File

@ -66,7 +66,13 @@ textview {
> text { > text {
@extend %view; @extend %view;
> selection { &:focus, & { @extend %selected_items; }} > selection {
background-color: $backdrop_selected_bg_color;
&:focus-within {
background-color: $selected_bg_color;
}
}
} }
&:drop(active) { &:drop(active) {
@ -152,8 +158,11 @@ label {
&:selected { @extend %nobg_selected_items; } &:selected { @extend %nobg_selected_items; }
> selection { > selection {
background-color: $selected_bg_color; background-color: $backdrop_selected_bg_color;
color: $selected_fg_color; color: $selected_fg_color;
&:focus-within {
background-color: $selected_bg_color;
}
} }
&:disabled { &:disabled {
@ -318,7 +327,14 @@ entry {
&:disabled { @include entry(insensitive); } &: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 // entry error and warning style
@each $e_type, $e_color in (error, $error_color), @each $e_type, $e_color in (error, $error_color),
@ -1134,7 +1150,14 @@ spinbutton {
padding: 0; padding: 0;
border-radius: 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); } > 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 { columnview row:not(:selected) cell editablelabel.editing text selection {
color: $selected_fg_color; background-color: $backdrop_selected_bg_color;
background-color: $selected_bg_color; color: transparent;
&:focus-within {
background-color: $selected_bg_color;
color: $selected_fg_color;
}
} }
/******************************************************* /*******************************************************
@ -4127,11 +4154,7 @@ tooltip.csd {
// catch all extend :) // catch all extend :)
%selected_items { %selected_items {
background-color: desaturate($selected_bg_color,100%); background-color: $selected_bg_color;
&:focus-within {
background-color: $selected_bg_color;
}
@at-root %nobg_selected_items, & { @at-root %nobg_selected_items, & {
color: $selected_fg_color; color: $selected_fg_color;