diff --git a/src/_functions.scss b/src/_functions.scss index 3ca9405..0b6deb6 100644 --- a/src/_functions.scss +++ b/src/_functions.scss @@ -1,252 +1,255 @@ // // Theme color functions // // Button Color @function b_color($c: normal) { @if $c == normal { @return $ButtonBackgroundNormal; } @if $c == hover { @return $ButtonDecorationHover; } @if $c == active { @return $ButtonDecorationFocus; } @if $c == text { @return $ButtonForegroundNormal; } @if $c == active-text { @return $SelectionForegroundNormal; } } // Selection Color @function s_color($c: normal) { @if $c == normal { @return $SelectionBackgroundNormal; } @if $c == hover { @return $SelectionDecorationHover; } @if $c == text { @return $SelectionForegroundNormal; } @if $c == backdrop { @return transparentize($SelectionBackgroundNormal,0.5); } } // View Color @function v_color($c: normal) { @if $c == normal { @return $ViewBackgroundNormal; } @if $c == hover { @return $ViewDecorationHover; } @if $c == active { @return $ViewDecorationFocus; } @if $c == text { @return $ViewForegroundNormal; } } // Window Color @function w_color($c: normal) { @if $c == normal { @return $WindowBackgroundNormal; } @if $c == text { @return $WindowForegroundNormal; } } // Titlebar color @function t_color($c: text) { @if $c == text { @return $WMactiveForeground; } @if $c == background { @return $WMactiveBackground; } + @if $c == background-light { + @return change-color(t_color(background),$lightness: min(lightness(t_color(background))*1.2,100%)) + } @if $c == backdrop-text { @return $WMinactiveForeground; } @if $c == backdrop-background { @return $WMinactiveBackground; } } @function tooltip($c: text) { @if $c == text { @return $TooltipForegroundNormal; } @if $c == background { @return $TooltipBackgroundNormal; } } @function button_gradient($c, $state: normal) { @if $state == normal { @return linear-gradient(to bottom, change-color($c, $lightness: min(lightness($c)*1.01,100%)), change-color($c, $lightness:min(lightness($c)/1.03,100%))); } @else { @return linear-gradient(to bottom, change-color($c, $lightness: min(lightness($c)*1.03,100%)), change-color($c, $lightness:min(lightness($c)/1.10,100%))); } } $border_color: mix($WindowBackgroundNormal,$WindowForegroundNormal, 75%); $menu_color: w_color(normal); $link_color: $ViewForegroundLink; $link_visited_color: $ViewForegroundVisited; $warning_color: $ViewForegroundNeutral; $error_color: $ViewForegroundNegative; $success_color: $ViewForegroundPositive; $destructive_color: $error_color; $trough_color: mix(w_color(normal),w_color(text),70%); $scrollbar_color: mix($trough_color,v_color(text),50%); // // Color effects // // // Color maps for color effect functions // $Color: ( Disabled: $DisabledColor, Inactive: $InactiveColor ); $ColorAmount: ( Disabled: $DisabledColorAmount, Inactive: $InactiveColorAmount ); $ColorEffect: ( Disabled: $DisabledColorEffect, Inactive: $InactiveColorEffect ); $ContrastAmount: ( Disabled: $DisabledContrastAmount, Inactive: $InactiveContrastAmount ); $ContrastEffect: ( Disabled: $DisabledContrastEffect, Inactive: $InactiveContrastEffect ); $IntensityAmount: ( Disabled: $DisabledIntensityAmount, Inactive: $InactiveIntensityAmount ); $IntensityEffect: ( Disabled: $DisabledIntensityEffect, Inactive: $InactiveIntensityEffect ); $r: 3px; // standard radius @function insensitive($c) { @return Color(Intensity(Contrast($c, Disabled), Disabled), Disabled); } @function backdrop($c) { @if $InactiveEnable == true { @return Color(Intensity(Contrast($c, Inactive), Inactive), Inactive); } @else { @return $c; } } @function Contrast($c, $state) { @if map-get($ContrastEffect, $state) == 0 { @return $c; } @if map-get($ContrastEffect, $state) == 1 { @if lightness(w_color()) > lightness(w_color(text)) { @if lightness($c) < lightness(w_color()) or ($c == t_color(text) and lightness(t_color(background)) <= lightness(t_color(text))) { @return transparentize($c, map-get($ContrastAmount, $state)); } @else { @return $c; } } @if lightness(w_color()) <= lightness(w_color(text)) { @if lightness($c) > lightness(w_color()) or ($c == t_color(text) and lightness(t_color(background)) > lightness(t_color(text))) { @return transparentize($c, map-get($ContrastAmount, $state)); } @else { @return $c; } } } @if map-get($ContrastEffect, $state) == 2 { @if lightness(w_color()) > lightness(w_color(text)) { // don't know what a reasonable lightness treshhold is for Contrast @if lightness($c) < lightness(w_color()) or ($c == t_color(text) and lightness(t_color(background)) <= lightness(t_color(text))) { @return transparentize($c, map-get($ContrastAmount, $state)); } @else { @return $c; } } @if lightness(w_color()) <= lightness(w_color(text)) { @if lightness($c) > lightness(w_color()) or ($c == t_color(text) and lightness(t_color(background)) > lightness(t_color(text))){ @return transparentize($c, map-get($ContrastAmount, $state)); } @else { @return $c; } } } } @function Color($c, $state) { @if map-get($ColorEffect, $state) ==0 { @return $c; } @if map-get($ColorEffect, $state) ==1 { @if map-get($ColorAmount, $state) >=0 { @return desaturate($c, percentage(map-get($ColorAmount, $state))); } @else { @return saturate($c, percentage(abs(map-get($ColorAmount, $state)))); } } @if map-get($ColorEffect, $state)==2 or map-get($ColorEffect, $state)==3 { // 2 and 3 seem to do the same @return mix(map-get($Color, $state),$c, percentage(map-get($ColorAmount, $state))); } } @function Intensity($c, $state) { @if map-get($IntensityEffect, $state) == 0 { @return $c; } @if map-get($IntensityEffect, $state) == 1 { @if map-get($IntensityAmount, $state) >= 0 { @return mix(white, $c, percentage(map-get($IntensityAmount, $state))); } @else { @return mix(black, $c, percentage(abs(map-get($IntensityAmount, $state)))); } } @if map-get($IntensityEffect, $state) == 2 { @if map-get($IntensityAmount, $state) == -1 { @return change-color($c, $lightness: 100%); } @else { @return change-color($c, $lightness: min(lightness($c)/(1+map-get($IntensityAmount, $state)),100%)); } } @if map-get($IntensityEffect, $state) == 3 { @return change-color($c, $lightness: min(lightness($c)*(1+map-get($IntensityAmount, $state)),100%)); } } @function alpha2solid($c,$background) { $amount:alpha($c); $c:rgb(red($c),green($c),blue($c)); @return mix($c,$background,$amount); } diff --git a/src/gtk316/widgets/_headerbar.scss b/src/gtk316/widgets/_headerbar.scss index eb996ec..bbc300a 100644 --- a/src/gtk316/widgets/_headerbar.scss +++ b/src/gtk316/widgets/_headerbar.scss @@ -1,157 +1,157 @@ /*************** * Header bars * ***************/ .titlebar, .header-bar { transition: none; padding: 4px 6px; border-width: 0px 0px 1px 0px; border-radius: 3px 3px 0px 0px; border-style: solid; border-color: s_color(normal); color: t_color(text); - background-image: linear-gradient(to bottom,change-color(t_color(background),$lightness: min(lightness(t_color(background))*1.2,100%)),t_color(background)); + background-image: linear-gradient(to bottom,t_color(background-light),t_color(background)); &:backdrop { border-color: transparent; background-image: none; background-color: t_color(backdrop-background); color: t_color(backdrop-text); box-shadow: none; } .path-bar .button { color: t_color(text); } .button { transition: none; @include button(undecorated, $tc: t_color(text)); &.flat { @include button(undecorated,$tc: t_color(text)); } &:hover { @include button(hover, $tc: t_color(text)); &:backdrop { border-color: t_color(backdrop-background); } } &:active, &:checked { @include button(active); &:hover { @include button(active-hover); } &:backdrop { background-image: none; background-color: t_color(backdrop-background); border-color: t_color(backdrop-background); color: t_color(backdrop-text); } } &.suggested-action { @extend %suggested-action; } &:backdrop { background-color: t_color(backdrop-background); color: t_color(backdrop-text); } &.flat:backdrop, &.flat:backdrop:insensitive, &:insensitive:backdrop { background-image: none; background-color: t_color(backdrop-background); color: t_color(backdrop-text); border-color: transparent; } &.flat:insensitive { @extend %undecorated_button;; color: insensitive(t_color(text)); } &:insensitive { background-color: transparent; background-image: none; color: insensitive(t_color(text)); &:active, &:checked { @include button(insensitive-active); } } } .title { font-weight: normal; padding: 0px 12px; } .subtitle { font-size: smaller; padding: 0 12px; @extend .dim-label; } .header-bar-separator, & > GtkBox > .separator.vertical { -GtkWidget-wide-separators: true; -GtkWidget-separator-width: 1px; border-width: 0px; background-color: t_color(background); border-color: t_color(background); &:backdrop { background-color: t_color(backdrop-background); border-color: t_color(backdrop-background); } } &.selection-mode { @extend .info; &.suggested-action { @extend %suggested-action; } .subtitle:link { @extend *:link:selected; } .selection-menu { padding-left: 10px; padding-right: 10px; GtkArrow { -GtkArrow-arrow-scaling: 1; } .arrow { -gtk-icon-source: -gtk-icontheme('arrow-down'); icon-shadow: none; } } } .tiled &, .maximized & { border-radius: 0; // squared corners when the window is max'd or tiled } &.default-decoration { padding: 4px; .button { padding: 5px; } } } %suggested-action { background-image: none; background-color: b_color(active); &:hover { background-color: b_color(hover); color: b_color(text) } &:insensitive { background-color: transparent; background-image: none; color: insensitive(t_color(text)); &:active, &:checked { @include button(insensitive-active); } } &:backdrop { background-color: t_color(backdrop-background); border-color: transparent; color: t_color(backdrop-text); &:insensitive { color: insensitive(t_color(backdrop-text)); } } } diff --git a/src/gtk316/widgets/_window_decorations.scss b/src/gtk316/widgets/_window_decorations.scss index c8c720f..ea66bdf 100644 --- a/src/gtk316/widgets/_window_decorations.scss +++ b/src/gtk316/widgets/_window_decorations.scss @@ -1,174 +1,174 @@ /********************** * Window Decorations * *********************/ .window-frame { //border: 1px solid transparent; border-radius: $r; box-shadow: 0 2px 6px 1px rgba(0, 0, 0, 0.5); // FIXME rationalize window-frame shadows /* this is used for the resize cursor area */ margin: 10px; &:backdrop { box-shadow: 0 2px 6px 1px rgba(0, 0, 0, 0.5); } &.tiled { border-radius: 0; } &.popup { border-radius: $r; box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.1) } // server-side decorations as used by mutter &.ssd { box-shadow: 0 2px 6px 1px rgba(0, 0, 0, 0.1); } &.csd { border-radius: $r; &.popup { box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.1) } &.tooltip { box-shadow: none; } &.message-dialog { box-shadow: 0 2px 6px 1px rgba(0, 0, 0, 0.5) } } &.solid-csd { border-radius: 0; - margin: 1px; - background-color: $border_color; + margin: 0px; + background-color: t_color(background-light); border: none; box-shadow: none; } } // Window Close button .header-bar .button.titlebutton, .titlebar .button.titlebutton { @extend %undecorated_button; padding: 0px; &:hover, &:active, &:checked, &:backdrop, &:active:hover { @extend %undecorated_button; transition: none;} &.close { padding: 6px 1px; color: transparent; border-image: none; box-shadow: none; background-position: center; background-repeat: no-repeat; background-image: -gtk-scaled(url('../assets/titlebutton-close.png'),url('../assets/titlebutton-close@2.png')); } &.close:hover { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-close-hover.png'),url('../assets/titlebutton-close-hover@2.png')); } &.close:active { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-close-active.png'),url('../assets/titlebutton-close-active@2.png')); } &.close:backdrop { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-close-backdrop.png'),url('../assets/titlebutton-close-backdrop@2.png')); } &.maximize { padding: 6px 1px; color: transparent; border-image: none; box-shadow: none; background-position: center; background-repeat: no-repeat; background-image: -gtk-scaled(url('../assets/titlebutton-maximize.png'),url('../assets/titlebutton-maximize@2.png')); } &.maximize:hover { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-maximize-hover.png'),url('../assets/titlebutton-maximize-hover@2.png')); } &.maximize:active { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-maximize-active.png'),url('../assets/titlebutton-maximize-active@2.png')); } &.maximize:backdrop { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-maximize-backdrop.png'),url('../assets/titlebutton-maximize-backdrop@2.png')); } &.minimize { padding: 6px 1px; color: transparent; border-image: none; box-shadow: none; background-position: center; background-repeat: no-repeat; background-image: -gtk-scaled(url('../assets/titlebutton-minimize.png'),url('../assets/titlebutton-minimize@2.png')); } &.minimize:hover { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-minimize-hover.png'),url('../assets/titlebutton-minimize-hover@2.png')); } &.minimize:active { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-minimize-active.png'),url('../assets/titlebutton-minimize-active@2.png')); } &.minimize:backdrop { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-minimize-backdrop.png'),url('../assets/titlebutton-minimize-backdrop@2.png')); } } .header-bar, .titlebar { .maximized & { .button.titlebutton { &.maximize { padding: 6px 1px; color: transparent; border-image: none; box-shadow: none; background-position: center; background-repeat: no-repeat; background-image: -gtk-scaled(url('../assets/titlebutton-maximize-maximized.png'),url('../assets/titlebutton-maximize-maximized@2.png')); } &.maximize:hover { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-maximize-maximized-hover.png'),url('../assets/titlebutton-maximize-maximized-hover@2.png')); } &.maximize:active { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-maximize-maximized-active.png'),url('../assets/titlebutton-maximize-maximized-active@2.png')); } &.maximize:backdrop { border-color: transparent; background-color: transparent; background-image: -gtk-scaled(url('../assets/titlebutton-maximize-maximized-backdrop.png'),url('../assets/titlebutton-maximize-maximized-backdrop@2.png')); } } } } .header-bar.selection-mode .button.titlebutton, .titlebar.selection-mode .button.titlebutton { text-shadow: none; &:backdrop { icon-shadow: none; } }