From ce1b515f1429f6d0a4ff398bfe0d6fc909d89144 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Thu, 20 May 2021 02:45:31 +0500 Subject: [PATCH 1/3] stylesheet: Update levelbar style Match the new check style. Also remove a redundant border and instead use a box-shadow for HC. This is simpler and won't break if at some point the trough sets overflow=hidden. --- src/stylesheet/widgets/_level-bar.scss | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/stylesheet/widgets/_level-bar.scss b/src/stylesheet/widgets/_level-bar.scss index 512b3b3ae..00079a3bd 100644 --- a/src/stylesheet/widgets/_level-bar.scss +++ b/src/stylesheet/widgets/_level-bar.scss @@ -1,5 +1,5 @@ -$_levelbar_size: 9px; -$_levelbar_border_radius: 5px; +$_levelbar_size: 11px; +$_levelbar_border_radius: 6px; levelbar { &.horizontal { @@ -23,9 +23,9 @@ levelbar { // segmented level bar &.discrete > trough > block { - min-height: 2px; + min-height: 4px; margin: 1px; - min-width: 24px; + min-width: 26px; border-radius: 0; &:first-child { @@ -47,7 +47,7 @@ levelbar { &.discrete > trough > block { min-width: $_levelbar_size - 7px; margin: 1px 0; - min-height: 32px; + min-height: 34px; } } @@ -56,27 +56,25 @@ levelbar { // level bar colours > block { - border: 1px solid; - &.low { - border-color: $warning_color; background-color: $warning_color; } &.high, &:not(.empty) { - border-color: $selected_bg_color; background-color: $selected_bg_color; } &.full { - border-color: $success_color; background-color: $success_color; } &.empty { - background-color: darken($bg_color, 5%); - border-color: darken($bg_color, 5%); + background-color: transparentize($text_color, .85); + + @if $contrast == "high" { + box-shadow: inset 0 0 0 1px $borders_color; + } } } } -- GitLab From 37bc98516c037bd14dd07ad5327f8d97061b35a2 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Thu, 20 May 2021 02:54:38 +0500 Subject: [PATCH 2/3] stylesheet: Add a disabled state for levelbars --- src/stylesheet/widgets/_level-bar.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stylesheet/widgets/_level-bar.scss b/src/stylesheet/widgets/_level-bar.scss index 00079a3bd..aca00aab6 100644 --- a/src/stylesheet/widgets/_level-bar.scss +++ b/src/stylesheet/widgets/_level-bar.scss @@ -2,6 +2,10 @@ $_levelbar_size: 11px; $_levelbar_border_radius: 6px; levelbar { + &:disabled { + filter: opacity(.5); + } + &.horizontal { trough > block { min-height: $_levelbar_size; -- GitLab From 8e0633b89d8cda700d061791c6b9a33f1e7f4d61 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Thu, 20 May 2021 13:12:27 +0500 Subject: [PATCH 3/3] stylesheet: Fix vertical levelbar bugs --- src/stylesheet/widgets/_level-bar.scss | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/stylesheet/widgets/_level-bar.scss b/src/stylesheet/widgets/_level-bar.scss index aca00aab6..ccbcf3f77 100644 --- a/src/stylesheet/widgets/_level-bar.scss +++ b/src/stylesheet/widgets/_level-bar.scss @@ -27,7 +27,7 @@ levelbar { // segmented level bar &.discrete > trough > block { - min-height: 4px; + min-height: $_levelbar_size - 7px; margin: 1px; min-width: 26px; border-radius: 0; @@ -45,13 +45,28 @@ levelbar { &.vertical { trough > block { min-width: $_levelbar_size; - border-radius: $_levelbar_border_radius; + border-radius: $_levelbar_border_radius $_levelbar_border_radius 0 0; + + &.empty, + &.full { + border-radius: $_levelbar_border_radius; + } } + // segmented level bar &.discrete > trough > block { min-width: $_levelbar_size - 7px; - margin: 1px 0; - min-height: 34px; + margin: 1px; + min-height: 26px; + border-radius: 0; + + &:first-child { + border-radius: 2px 2px 0 0; + } + + &:last-child { + border-radius: 0 0 2px 2px; + } } } -- GitLab