Adwaita: style entry.warning and entry.error

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=724084
This commit is contained in:
Lapo Calamandrei 2014-07-03 12:29:25 +02:00
parent d043125800
commit 9044bf5328
4 changed files with 88 additions and 5 deletions

View File

@ -206,6 +206,30 @@ GtkLabel {
&:dir(rtl) { border-left-style: solid; }
}
}
&.error {
color: $error_color;
border-color: $error_color;
&:focus { @include entry(focus, $error_color); }
&:selected, &:selected:focus {
background-color: $error_color;
}
@if $variant == 'dark' {
&:selected:focus { color: $base_color; }
&:selected:backdrop { color: $backdrop_base_color; }
}
}
&.warning {
color: $warning_color;
border-color: $warning_color;
&:focus { @include entry(focus, $warning_color); }
&:selected, &:selected:focus {
background-color: $warning_color;
}
@if $variant == 'dark' {
&:selected:focus { color: $base_color; }
&:selected:backdrop { color: $backdrop_base_color; }
}
}
}
/***********

View File

@ -17,11 +17,12 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
// entries
@mixin entry($t, $noedge:false) {
@mixin entry($t, $fc:$selected_bg_color, $noedge:false) {
//
// Entries drawing function
//
// $t: entry type
// $fc: focus color
// $noedge: set to true not to draw the bottom edge hilight
//
// possible $t values:
@ -43,15 +44,17 @@ $widget_edge: 0 1px $borders_edge; //outer hilight "used" on
}
@if $t==focus {
@if $variant == 'light' {
border-color: $selected_bg_color;
border-color: $fc;
@include _shadows(inset 0 2px 2px -2px mix(black, $base_color, 50%),
inset 0 0 2px 1px mix($selected_bg_color,$base_color,20%),
inset 0 0 2px 1px mix($fc,$base_color,20%),
$_entry_edge);
}
@else {
border-color: $selected_borders_color;
border-color: if($fc==$selected_bg_color,
$selected_borders_color,
darken($fc,35%));
@include _shadows(inset 0 2px 2px -2px mix(black, $base_color, 50%),
inset 0 0 1px 1px $selected_bg_color,
inset 0 0 1px 1px $fc,
$_entry_edge);
}
}

View File

@ -207,6 +207,38 @@
border-left-style: none; }
.linked .entry:last-child:dir(rtl) {
border-left-style: solid; }
.entry.error {
color: #cc0000;
border-color: #cc0000; }
.entry.error:focus {
background-color: transparent;
border-style: solid;
border-width: 1px;
background-image: linear-gradient(to bottom, #212121, #292929 90%);
border-color: #1a0000;
box-shadow: inset 0 2px 2px -2px #141414, inset 0 0 1px 1px #cc0000, 0 1px rgba(238, 238, 236, 0.1); }
.entry.error:selected, .entry.error:selected:focus {
background-color: #cc0000; }
.entry.error:selected:focus {
color: #292929; }
.entry.error:selected:backdrop {
color: #2c2c2c; }
.entry.warning {
color: #f57900;
border-color: #f57900; }
.entry.warning:focus {
background-color: transparent;
border-style: solid;
border-width: 1px;
background-image: linear-gradient(to bottom, #212121, #292929 90%);
border-color: #432100;
box-shadow: inset 0 2px 2px -2px #141414, inset 0 0 1px 1px #f57900, 0 1px rgba(238, 238, 236, 0.1); }
.entry.warning:selected, .entry.warning:selected:focus {
background-color: #f57900; }
.entry.warning:selected:focus {
color: #292929; }
.entry.warning:selected:backdrop {
color: #2c2c2c; }
/***********
* Buttons *

View File

@ -207,6 +207,30 @@
border-left-style: none; }
.linked .entry:last-child:dir(rtl) {
border-left-style: solid; }
.entry.error {
color: #cc0000;
border-color: #cc0000; }
.entry.error:focus {
background-color: transparent;
border-style: solid;
border-width: 1px;
background-image: linear-gradient(to bottom, #f7f7f7, white 90%);
border-color: #cc0000;
box-shadow: inset 0 2px 2px -2px #7f7f7f, inset 0 0 2px 1px #f4cccc, 0 1px white; }
.entry.error:selected, .entry.error:selected:focus {
background-color: #cc0000; }
.entry.warning {
color: #f57900;
border-color: #f57900; }
.entry.warning:focus {
background-color: transparent;
border-style: solid;
border-width: 1px;
background-image: linear-gradient(to bottom, #f7f7f7, white 90%);
border-color: #f57900;
box-shadow: inset 0 2px 2px -2px #7f7f7f, inset 0 0 2px 1px #fde4cc, 0 1px white; }
.entry.warning:selected, .entry.warning:selected:focus {
background-color: #f57900; }
/***********
* Buttons *