Adwaita: drawing functions housekeeping

This commit is contained in:
Lapo Calamandrei 2014-07-10 12:22:41 +02:00
parent 17b679c866
commit 378c290150

View File

@ -36,20 +36,19 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
$base_color 90%);
// we need to match the same shadow types (inset/outset) in various states
// hence transparent shadows istead of resetting them when not needed
$_blank_inner_shadows: inset 0 2px 2px -2px transparentize(
mix(black, $base_color, 50%),1),
inset 0 0 2px 1px transparentize(
mix($fc,$base_color,20%),1);
$_blank_edge: if($noedge, none, 0 1px transparentize(white,1));
$_blank_inner_shadows: inset 0 2px 2px -2px
transparentize(mix(black, $base_color, 50%),1),
inset 0 0 2px 1px
transparentize(mix($fc,$base_color,20%),1);
$_entry_edge: $widget_edge;
@if $noedge { $_entry_edge: none; }
$_blank_edge: if($noedge, none, 0 1px transparentize(white,1));
$_entry_edge: if($noedge, none, $widget_edge);
@if $t==normal {
border-color: $borders_color;
@include _shadows(inset 0 2px 2px -2px mix(black, $base_color, 50%),
inset 0 0 2px 1px transparentize(
mix($fc,$base_color,20%),1),
inset 0 0 2px 1px
transparentize(mix($fc,$base_color, 20%),1),
$_entry_edge);
// the second transparent shadow is needed for the transition to work
}
@ -57,7 +56,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
@if $variant == 'light' {
border-color: $fc;
@include _shadows(inset 0 2px 2px -2px mix(black, $base_color, 50%),
inset 0 0 2px 1px mix($fc,$base_color,20%),
inset 0 0 2px 1px mix($fc,$base_color, 20%),
$_entry_edge);
}
@else {
@ -116,7 +115,7 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
}
}
@mixin button($t, $c:$bg_color, $tc:$fg_color, $noedge:false ) {
@mixin button($t, $c:$bg_color, $tc:$fg_color, $noedge:false) {
//
// Button drawing function
//
@ -135,7 +134,6 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
$_top_hilight: if(lightness($c)> 70%, white, transparentize(white,0.9)); //not just dark/light but colored buttons
@if $t==normal {
//
// normal button
//
@ -303,8 +301,10 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
border-color: $osd_borders_color;
color: $insensitive_fg_color;
}
@else if $t==undecorated {
//
// reset
//
border-color: transparent;
background-color: transparent;
background-image: none;
@ -319,25 +319,23 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
@if $flat { background-image: linear-gradient(to bottom,$c); }
@else {
background-image: linear-gradient(to bottom,
mix(black,$c,15%) 5%,
mix(black,$c,10%) 20%,
mix(black,$c,10%) 90%,
$c
);
mix(black,$c,15%) 5%,
mix(black,$c,10%) 20%,
mix(black,$c,10%) 90%,
$c);
}
@if $c!=$bg_color { border-color: _border_color($c); }
@else { border-color: $borders_color; }
border-color: if($c!=$bg_color, _border_color($c), $border_color);
@if $noedge==false {
@if not($noedge) {
@if lightness($c) > 60% {
box-shadow: inset 0 -1px 0 $borders_edge,
0 1px 0 $borders_edge;
box-shadow: inset 0 -1px $borders_edge,
0 1px $borders_edge;
}
@else {
box-shadow: inset 0 -1px 0 transparentize($borders_edge,0.5),
0 1px 0 transparentize($borders_edge,0.5);
box-shadow: inset 0 -1px transparentize($borders_edge,0.5),
0 1px transparentize($borders_edge,0.5);
}
}
@else { box-shadow: none; }
}