Adwaita: notebook style rewrite

This commit is contained in:
Lapo Calamandrei 2016-01-29 16:32:43 +01:00
parent 01626e0f4b
commit 31cc642288
3 changed files with 911 additions and 1200 deletions

View File

@ -1757,232 +1757,173 @@ popover.background {
*************/ *************/
notebook { notebook {
// Through me you go to the grief wracked city; > header {
// Through me you go to everlasting pain; border-color: $borders_color;
// Through me you go a pass among lost souls. border-width: 1px;
// ... background-color: $dark_fill;
// Abandon all hope Ye Who Enter Here &:backdrop {
padding: 0; border-color: $backdrop_borders_color;
background-color: $base_color; background-color: $backdrop_dark_fill;
transition: all 200ms $ease-out-quad;
&:backdrop { background-color: $backdrop_base_color; }
&.frame {
border: 1px solid $borders_color;
&:backdrop { border-color: $backdrop_borders_color; }
}
header {
//vertical tab sizing
$vt_vpadding: 8px;
$vt_hpadding: 20px;
// horizontal tab sizing
$ht_vpadding: 5px;
$ht_hpadding: 20px;
$tab_indicator_size: 3px;
$_header_shade: inset 0 2px 3px -1px transparentize(black, 0.85);
// FIXME: double borders in some case, can't fix it w/o a class tho
// FIXME: doesn't work on dark var
background-color: mix($bg_color, $borders_color, 70%);
// this is the shading of the header behind the tabs
.frame & {
border: 1px solid $borders_color;
&.top { border-bottom-width: 0; }
&.bottom { border-top-width: 0; }
&.right { border-left-width: 0; }
&.left { border-right-width: 0; }
&:backdrop { border-color: $backdrop_borders_color; }
} }
&.top { &.top {
box-shadow: $_header_shade, border-bottom-style: solid;
inset 0 -1px $borders_color; // border > tabs {
&:backdrop { box-shadow: inset 0 -1px $backdrop_borders_color; } margin-bottom: -1px;
& tab { > tab {
padding: $vt_vpadding $vt_hpadding; &:hover { box-shadow: inset 0 -3px $borders_color; }
border-bottom-width: $tab_indicator_size; &:backdrop { box-shadow: none; }
&.reorderable-page { &:active { box-shadow: inset 0 -3px $selected_bg_color; }
padding-left: 12px; // for a nicer close button
padding-right: 12px; // placement
border-left-width: 1px;
border-right-width: 1px;
} }
} }
} }
&.bottom { &.bottom {
box-shadow: $_header_shade, border-top-style: solid;
inset 0 1px $borders_color; > tabs {
&:backdrop { box-shadow: inset 0 1px $backdrop_borders_color; } margin-top: -1px;
tab { > tab {
padding: $vt_vpadding $vt_hpadding; &:hover { box-shadow: inset 0 3px $borders_color; }
border-top-width: $tab_indicator_size; &:backdrop { box-shadow: none; }
&.reorderable-page { &:active { box-shadow: inset 0 3px $selected_bg_color; }
padding-left: 12px; // for a nicer close button
padding-right: 12px; // placement
border-left-width: 1px;
border-right-width: 1px;
}
}
}
&.right {
box-shadow: $_header_shade,
inset 1px 0 $borders_color;
&:backdrop { box-shadow: inset 1px 0 $backdrop_borders_color; }
tab {
padding: $ht_vpadding $ht_hpadding;
border-left-width: $tab_indicator_size;
&.reorderable-page {
border-bottom-width: 1px;
border-top-width: 1px;
} }
} }
} }
&.left { &.left {
box-shadow: $_header_shade, border-right-style: solid;
inset -1px 0 $borders_color; > tabs {
&:backdrop { box-shadow: inset -1px 0 $backdrop_borders_color; } margin-right: -1px;
> tab {
&:hover { box-shadow: inset -3px 0 $borders_color; }
&:backdrop { box-shadow: none; }
&:active { box-shadow: inset -3px 0 $selected_bg_color; }
}
}
}
&.right {
border-left-style: solid;
> tabs {
margin-left: -1px;
> tab {
&:hover { box-shadow: inset 3px 0 $borders_color; }
&:backdrop { box-shadow: none; }
&:active { box-shadow: inset 3px 0 $selected_bg_color; }
}
}
}
tab { tab {
padding: $ht_vpadding $ht_hpadding; font-weight: bold;
border-right-width: $tab_indicator_size; min-height: 36px;
&.reorderable-page { min-width: 36px;
border-bottom-width: 1px; padding-left: 12px;
border-top-width: 1px; padding-right: 12px;
}
}
}
&:backdrop {
// same color as backdrop pushed button
background-color: $backdrop_dark_fill;
box-shadow: none;
}
&.top, &.bottom {
tabs arrow.up { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
tabs arrow.down { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
}
&.left, &.right {
tabs arrow.up { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
tabs arrow.down { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
}
& tabs arrow {
color: $insensitive_fg_color; color: $insensitive_fg_color;
border-width: 1px; // for reorderable tabs
&:hover { color: mix($fg_color, $insensitive_fg_color, 50%); } border-color: transparent; //
&:active { color: $fg_color; }
&:disabled { color: transparentize($insensitive_fg_color,0.7); }
&:backdrop { color: transparentize($backdrop_fg_color,0.6); }
&:backdrop:disabled { color: $backdrop_insensitive_color; }
}
}
tab {
border-width: 0;
border-style: solid;
border-color: transparent;
background-color: transparent;
outline-offset: 0;
//here's the interesting stuff
&:hover { border-color: $borders_color; }
&:active,
&:backdrop:active { border-color: $selected_bg_color; }
&:backdrop {
background-color: transparent;
border-color: transparent;
}
@each $_tab, $_border in (top, bottom),
(bottom, top),
(left, right),
(right, left) {
.#{$_tab} &.reorderable-page {
border-color: transparent;
&:hover { &:hover {
color: mix($insensitive_fg_color, $fg_color, 50%);
&.reorderable-page {
border-color: transparentize($borders_color, 0.7); border-color: transparentize($borders_color, 0.7);
border-#{$_border}-color: $borders_color;
background-color: transparentize($bg_color, 0.8); background-color: transparentize($bg_color, 0.8);
} }
}
&:backdrop {
color: mix($backdrop_fg_color, $backdrop_bg_color, 60%);
&.reorderable-page {
border-color: transparent;
background-color: transparent;
}
}
&:active { &:active {
background-color: transparentize($bg_color,0.5); color: $fg_color;
&.reorderable-page {
border-color: transparentize($borders_color, 0.5); border-color: transparentize($borders_color, 0.5);
border-#{$_border}-color: $selected_bg_color; background-color: transparentize($bg_color, 0.5);
&:hover { background-color: transparentize($bg_color,0.3); }
&:backdrop { &:hover { background-color: transparentize($bg_color, 0.3); }
}
}
&:backdrop:active {
color: $backdrop_fg_color;
&.reorderable-page {
border-color: $backdrop_borders_color; border-color: $backdrop_borders_color;
background-color: $backdrop_bg_color; background-color: $backdrop_bg_color;
border-#{$_border}-color: $selected_bg_color;
} }
} }
&:backdrop { // colors the button like the label, overridden otherwise
border-color: transparent; button.flat {
background-color: transparent; &:hover { color: currentColor; }
}
}
}
label { //tab text &, &:backdrop { color: gtkalpha(currentColor, 0.3); }
padding: 0 2px; // needed for a nicer focus ring
font-weight: bold;
color: $insensitive_fg_color;
&:backdrop { color: mix($backdrop_fg_color, $backdrop_insensitive_color, 50%); } margin-top: 8px;
} margin-bottom: 8px;
// FIXME: generalize .small-button?
&:hover label {
// prelight tab text
color: mix($fg_color, $insensitive_fg_color, 50%);
&:backdrop { color: mix($backdrop_fg_color, $backdrop_insensitive_color, 50%); }
}
&:active label {
// active tab text
color: $fg_color;
&:backdrop { color: $backdrop_fg_color; }
}
button.flat { //tab close button
min-height: 18px;
min-width: 18px; min-width: 18px;
padding: 0; min-height: 18px;
border: 1px solid transparent;
@extend %undecorated_button;
-gtk-icon-shadow: none;
transition: none;
color: transparentize($fg_color,0.7);
&:hover { &:last-child {
color: $fg_color; margin-left: 4px;
@include button(hover, $edge:none); margin-right: -4px;
background-image: none;
box-shadow: none;
} }
&:active { @include button(active, $edge:none); } &:first-child {
margin-left: -4px;
margin-right: 4px;
}
}
}
&:backdrop { &.top,
color: transparentize($backdrop_fg_color,0.7); &.bottom {
border-color: transparent; tabs {
margin-left: 4px;
margin-right: 4px;
tab {
margin-left: 4px;
margin-right: 4px;
&.reorderable-page { border-style: none solid; }
}
}
}
&.left,
&.right {
tabs {
margin-top: 4px;
margin-bottom: 4px;
tab {
margin-top: 4px;
margin-bottom: 4px;
&.reorderable-page { border-style: solid none; }
} }
} }
} }
} }
> stack {
background-color: $base_color;
&:backdrop { background-color: $backdrop_base_color; }
}
}
/************** /**************
* Scrollbars * * Scrollbars *
**************/ **************/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff