Merge branch 'wip/jimmac/focus-tabs' into 'master'

Adwaita: don't focus outline tabs with mouse

Closes #2721

See merge request GNOME/gtk!1901
This commit is contained in:
Jakub Steiner 2020-05-14 17:35:10 +00:00
commit c025a569a9
2 changed files with 4 additions and 6 deletions

View File

@ -292,7 +292,7 @@ entry {
@include entry(normal);
@include focus-ring($within: true);
@include focus-ring($focus-state: 'focus-within');
> image { // icons inside the entry
&.left { margin-right: 6px; }
@ -342,7 +342,7 @@ entry {
&.#{$e_type} {
color: $e_color;
@include focus-ring($within: true, $fc: transparentize($e_color, 0.5));
@include focus-ring($focus-state: 'focus-within', $fc: transparentize($e_color, 0.5));
&:focus-within { @include entry(focus, $e_color); }
@ -1881,7 +1881,7 @@ popover.background {
* Notebooks *
*************/
notebook {
@include focus-ring("> header > tabs > tab", $offset: -2px, $within: true);
@include focus-ring("> header > tabs > tab:checked", $offset: -2px, $focus-state: 'focus-within:focus-visible');
> header {
padding: 1px;

View File

@ -9,14 +9,12 @@
// If $outer is true, the focus ring extends outward. Otherwise, it extends inward.
// If $within is true, use focus-within instead of focus:focus-visible
//
@mixin focus-ring($target: null, $width: 2px, $offset: -$width, $outer: false, $within: false, $fc: $focus_border_color) {
@mixin focus-ring($target: null, $width: 2px, $offset: -$width, $outer: false, $focus-state: 'focus:focus-visible', $fc: $focus_border_color) {
& #{$target} {
outline: 0 solid transparent;
outline-offset: if($outer, $offset + 4px, $offset + $width + 4px);
}
$focus-state: if($within, "focus-within", "focus:focus-visible");
&:#{$focus-state} #{$target} {
outline-color: $fc;
outline-width: $width;