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 { > tab {
padding: $ht_vpadding $ht_hpadding; &:hover { box-shadow: inset -3px 0 $borders_color; }
border-right-width: $tab_indicator_size; &:backdrop { box-shadow: none; }
&.reorderable-page { &:active { box-shadow: inset -3px 0 $selected_bg_color; }
border-bottom-width: 1px;
border-top-width: 1px;
} }
} }
} }
&:backdrop {
// same color as backdrop pushed button &.right {
background-color: $backdrop_dark_fill; border-left-style: solid;
box-shadow: none; > 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; }
}
}
} }
&.top, &.bottom {
tabs arrow.up { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); } tab {
tabs arrow.down { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); } font-weight: bold;
} min-height: 36px;
&.left, &.right { min-width: 36px;
tabs arrow.up { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } padding-left: 12px;
tabs arrow.down { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); } padding-right: 12px;
}
& tabs arrow {
color: $insensitive_fg_color; color: $insensitive_fg_color;
border-width: 1px; // for reorderable tabs
border-color: transparent; //
&:hover { color: mix($fg_color, $insensitive_fg_color, 50%); } &:hover {
color: mix($insensitive_fg_color, $fg_color, 50%);
&:active { color: $fg_color; } &.reorderable-page {
border-color: transparentize($borders_color, 0.7);
&:disabled { color: transparentize($insensitive_fg_color,0.7); } background-color: transparentize($bg_color, 0.8);
&: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 {
border-color: transparentize($borders_color,0.7);
border-#{$_border}-color: $borders_color;
background-color: transparentize($bg_color,0.8);
} }
}
&:active { &:backdrop {
background-color: transparentize($bg_color,0.5); color: mix($backdrop_fg_color, $backdrop_bg_color, 60%);
border-color: transparentize($borders_color,0.5);
border-#{$_border}-color: $selected_bg_color;
&:hover { background-color: transparentize($bg_color,0.3); }
&:backdrop { &.reorderable-page {
border-color: $backdrop_borders_color;
background-color: $backdrop_bg_color;
border-#{$_border}-color: $selected_bg_color;
}
}
&:backdrop {
border-color: transparent; border-color: transparent;
background-color: transparent; background-color: transparent;
} }
} }
}
label { //tab text &:active {
padding: 0 2px; // needed for a nicer focus ring color: $fg_color;
font-weight: bold; &.reorderable-page {
color: $insensitive_fg_color; border-color: transparentize($borders_color, 0.5);
background-color: transparentize($bg_color, 0.5);
&:backdrop { color: mix($backdrop_fg_color, $backdrop_insensitive_color, 50%); } &:hover { background-color: transparentize($bg_color, 0.3); }
} }
&: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;
padding: 0;
border: 1px solid transparent;
@extend %undecorated_button;
-gtk-icon-shadow: none;
transition: none;
color: transparentize($fg_color,0.7);
&:hover {
color: $fg_color;
@include button(hover, $edge:none);
background-image: none;
box-shadow: none;
} }
&:active { @include button(active, $edge:none); } &:backdrop:active {
color: $backdrop_fg_color;
&:backdrop { &.reorderable-page {
color: transparentize($backdrop_fg_color,0.7); border-color: $backdrop_borders_color;
border-color: transparent; background-color: $backdrop_bg_color;
}
}
// colors the button like the label, overridden otherwise
button.flat {
&:hover { color: currentColor; }
&, &:backdrop { color: gtkalpha(currentColor, 0.3); }
margin-top: 8px;
margin-bottom: 8px;
// FIXME: generalize .small-button?
min-width: 18px;
min-height: 18px;
&:last-child {
margin-left: 4px;
margin-right: -4px;
}
&:first-child {
margin-left: -4px;
margin-right: 4px;
}
}
}
&.top,
&.bottom {
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