Initial remote commit

This commit is contained in:
Eudaimon 2022-04-13 20:49:36 +02:00
parent f67c6bbc33
commit aaa9cf7d3c
595 changed files with 30274 additions and 0 deletions

View file

@ -0,0 +1,37 @@
$window_fg: #241f31;
$window_bg: #a7a7a7;
$text_widget_fg: #241f31;
$text_widget_bg: #908f8d;
$selected_fg: #000000;
$selected_bg: #386b00;
$button_fg: #241f31;
$button_bg: #bcbeb9;
$button_checked_bg: $selected_bg;
$button_checked_fg: $selected_fg;
$disabled_fg: #552222;
$disabled_bg: #938989;
$warningc: #f57900;
$errorc: #990000;
$successc: #73d216;
$titlebar_active_fg: $selected_fg;
$titlebar_active_bg: $selected_bg;
$titlebar_backdrop_fg: $window_fg;
$titlebar_backdrop_bg: $window_bg;
$hint_fg: #002269;
$hint_bg: #6789b4;
$osd_fg: $hint_fg;
$osd_bg: $hint_bg;

211
source/common/buttons.scss Normal file
View file

@ -0,0 +1,211 @@
//auxiliary functions for buttons first
$_default_button_c: $button_bg;
@function _border_color($c, $darker: false) {
@if $darker == true { @return darken($c, 20%); }
@else { @return darken($c, 10%); }
}
@function _text_shadow_color ($tc: $fg_color, $bg: $bg_color) {
//
// calculate the color of text shadows
//
// $tc is the text color
// $bg is the background color
//
$_lbg: lightness($bg)/100%;
@if lightness($tc)<50% { @return transparentize(white, 1-$_lbg/($_lbg*1.3)); }
@else { @return transparentize(black, $_lbg*0.8); }
}
@function _button_hilight_color($c) {
//
// calculate the right top hilight color for buttons
//
// $c: base color;
//
@if lightness($c)>95% { @return white; }
@else if lightness($c)>90% { @return transparentize(white, 0.15); }
@else if lightness($c)>80% { @return transparentize(white, 0.35); }
@else if lightness($c)>50% { @return transparentize(white, 0.5); }
@else if lightness($c)>40% { @return transparentize(white, 0.65); }
@else { @return transparentize(white, 0.7); }
//@return $top_hilight;
}
@mixin _button_text_shadow ($tc:$fg_color, $bg:$bg_color) {
//
// helper function for the text emboss effect
//
// $tc is the optional text color, not the shadow color
//
// TODO: this functions needs a way to deal with special cases
//
$_shadow: _text_shadow_color($tc, $bg);
@if lightness($tc)<50% {
text-shadow: 0 1px _button_hilight_color($tc);//$_shadow;
-gtk-icon-shadow: 0 1px _button_hilight_color($tc);//$_shadow;
}
@else {
text-shadow: 0 -1px $_shadow;
-gtk-icon-shadow: 0 -1px $_shadow;
}
}
@mixin button($t, $c:$button_bg, $tc:$button_fg, $edge: none, $backimage: null) {
//
// Button drawing function
//
// $t: button type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
// $edge: set to none to not draw the bottom edge or specify a color to not
// use the default one
// $backimage: additional background-image behind the default one
// (for the button.circular hack)
//
// possible $t values (gtk3):
// normal, hover, active, insensitive, insensitive-active,
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
// possible $t values (gtk4):
// normal, hover, active, checked-hover, checked-active, insensitive, insensitive-active,
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
// this mixin needs to cover both gtk3 and gtk4 cases in order to work.
// gtk4 mixin calls only include $t, $c and $tc, therefore it should be safe to use in both.
//TODO: gtk3 add cases in common.scss to separate active from checked-active
$_hilight_color: _button_hilight_color($c);
$_button_edge: if($edge == none, none, _widget_edge($edge));
$_blank_edge: if($edge == none, none, _widget_edge(transparentize($edge,1)));
$_button_shadow: 0 1px 2px transparentize($shadow_hard_color, 0.6);
$button_clickable_image: linear-gradient(
to bottom,
transparentize($_hilight_color, if($variant == 'light', 0.2 ,0.3 )),
transparentize($_hilight_color, 1) 50%,
transparentize($shadow_hard_color, 1) 50%,
transparentize($shadow_hard_color, if($variant == 'light',0.85,0.7)) );
@if $t==normal or $t==normal-alt {
//
// normal button
//
color: $tc;
background-color: $c;
outline-color: $focus_border_color;
background-image: $button_clickable_image;
@include _button_text_shadow($tc, $c);
@include _shadows(inset 0 1px $_hilight_color, $_button_edge, $_button_shadow);
}
@else if $t==hover or $t==hover-alt or $t==undecorated-hover {
//
// hovered button
//
background-color: shade($c, 1.1)
}
@else if ($t==active) {
//
// pushed button
//
//color: $button_checked_fg;
//background-color: $button_checked_bg;
@include _shadows(0 1px $_hilight_color, $_button_edge, inset $_button_shadow);
}
@else if ($t==checked-active ) {
//
// pushed and toggled button
//
color: $button_checked_fg;
background-color: $button_checked_bg;
@include _button_text_shadow($button_checked_fg, $button_checked_bg);
@include _shadows(0 1px $_hilight_color, $_button_edge, inset $_button_shadow);
}
@else if ($t==checked-hover) {
//
// toggled button and hover
//
color: $button_checked_fg;
background-color: shade($button_checked_bg, 1.1);
@include _button_text_shadow($button_checked_fg, $button_checked_bg);
@include _shadows(0 1px $_hilight_color, $_button_edge, inset $_button_shadow);
}
@else if $t==insensitive {
//
// insensitive button
//
color: $insensitive_fg_color;
background-color: $insensitive_bg_color;
background-image: if($backimage==null, none, $backimage);
}
@else if $t==insensitive-active {
//
// insensitive pushed button
//
color: $insensitive_fg_color;
background-color: mix($insensitive_bg_color, $button_checked_bg, 85%);
}
@else if $t==backdrop {
//
// backdrop button
//
background-image: if($backimage==null, none, $backimage);
}
@else if $t==backdrop-active {
//
// backdrop pushed button
//
}
@else if $t==backdrop-insensitive {
//
// backdrop insensitive button
//
}
@else if $t==backdrop-insensitive-active {
//
// backdrop insensitive pushed button
//
}
//TODO: what happens with OSDs? Is it necessary to redefine them?
@else if $t==undecorated {
//
// reset
//
border-color: transparent;
background-color: transparent;
background-image: none;
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
text-shadow: none;
-gtk-icon-shadow: none;
}
}

View file

@ -0,0 +1,68 @@
/***************************
* Check and Radio buttons *
***************************/
@mixin check($t, $c:$checkradio_bg_color, $tc:$checkradio_fg_color, $checked: false) {
// Check/Radio drawing function
//
// $t: check/radio type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
// $checked: bool to chose between checked/unchecked
//
// possible $t values:
// normal, hover, active, insensitive, backdrop, backdrop-insensitive, menu
$_border_color: if($c==$checkradio_bg_color, $checkradio_borders_color, $alt_borders_color);
$_dim_border_color: transparentize($_border_color, if($variant == 'light', 0.3, 0.7));
@if $t==normal {
background-clip: if($checked, border-box, padding-box);
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
border-color: $_border_color;
box-shadow: 0 1px transparentize(black, 0.95);
color: $tc;
}
@if $t==hover {
background-image: if($c == white, image(darken($c, 5%)), linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%));
}
@if $t==active {
box-shadow: inset 0 1px if($variant == 'light', rgba(0, 0, 0, 0.2), black);
background-image: if($c == white, image(darken($c, 15%)), image(darken($c, 5%)));
}
@if $t==insensitive {
box-shadow: none;
color: $insensitive_fg_color;
}
@if $t==backdrop {
background-image: image($c);
box-shadow: none;
color: $tc;
}
@if $t==backdrop-insensitive {
box-shadow: none;
color: $insensitive_fg_color;
}
@if $t==menu {
transform: scale(0.8);
border-width: 1.2px;
//border-color: transparent;
box-shadow: none;
background-image: image(transparent);
color: $tc;
}
@if $t==menu-active {
transform: scale(0.8);
border-width: 1.2px;
color: $tc;
box-shadow: none;
background-image: image(transparent);
}
}

View file

@ -0,0 +1,78 @@
// Common colors
$base_color: $text_widget_bg;
$text_color: $text_widget_fg;
$bg_color: $window_bg;
$fg_color: $window_fg;
$selected_fg_color: $selected_fg;
$selected_bg_color: $selected_bg;
$selected_borders_color: if($variant== 'light', darken($selected_bg_color, 15%), darken($selected_bg_color, 30%));
$borders_color: if($variant == 'light', darken($bg_color, 18%), darken($bg_color, 10%));
$alt_borders_color: if($variant == 'light', darken($bg_color, 24%), darken($bg_color, 18%));
$borders_edge: if($variant == 'light', transparentize(white, 0.2), transparentize($fg_color, 0.93));
$link_color: if($variant == 'light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 20%));
$link_visited_color: if($variant == 'light', darken($selected_bg_color, 20%), lighten($selected_bg_color, 10%));
$top_hilight: $borders_edge;
$dark_fill: mix($borders_color, $bg_color, 50%);
$menu_color: if($variant == 'light', $base_color, mix($bg_color, $base_color, 20%));
$scrollbar_bg_color: if($variant == 'light', mix($bg_color, $fg_color, 80%), mix($base_color, $bg_color, 50%));
$scrollbar_slider_color: mix($fg_color, $bg_color, 60%);
$scrollbar_slider_hover_color: mix($fg_color, $bg_color, 80%);
$scrollbar_slider_active_color: if($variant=='light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 10%));
$warning_color: $warningc;
$error_color: $errorc;
$success_color: $successc;
$destructive_color: $errorc;
//$warning_fg: if($variant == 'light', shade($warningc,0.5), shade($warningc,1.3));
//$warning_bg: if($variant == 'light', shade($warningc,1.3), shade($warningc,0.5));
$osd_fg_color: $osd_fg;
$osd_text_color: $osd_fg;
$osd_bg_color: transparentize($osd_bg, 0.3); //if($variant == 'light', transparentize(darken(desaturate($osd_bg, 100%), 4%),0.3), transparentize(darken(desaturate($osd_bg, 100%), 10%),0.3));
$osd_insensitive_bg_color: transparentize(mix($osd_fg_color, opacify($osd_bg_color, 1), 10%), 0.5);
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%);
$osd_borders_color: $hint_fg;
$sidebar_bg_color: mix($bg_color, $base_color, 50%);
$tooltip_borders_color: $hint_fg;
$shadow_color: transparentize(black, 0.9);
$shadow_hard_color: opacify($shadow_color, 1);
$drop_target_color: $success_color;
//insensitive state derived colors
$insensitive_fg_color: $disabled_fg;
$insensitive_bg_color: $disabled_bg;
$insensitive_borders_color: mix($borders_color, $disabled_fg, 50%);
//colors for the backdrop state, derived from the main colors.
$backdrop_base_color: if($variant == 'light', darken($base_color, 1%), lighten($base_color, 1%));
$backdrop_text_color: mix($text_color, $backdrop_base_color, 80%);
$backdrop_bg_color: $bg_color;
$backdrop_fg_color: mix($fg_color, $backdrop_bg_color, 50%);
$backdrop_insensitive_color: if($variant == 'light', darken($backdrop_bg_color, 15%), lighten($backdrop_bg_color, 15%));
$backdrop_selected_fg_color: if($variant == 'light', $backdrop_base_color, $backdrop_text_color);
$backdrop_selected_bg_color: transparentize(desaturate($selected_bg_color,100%),0.5);
$backdrop_borders_color: mix($borders_color, $bg_color, 80%);
$backdrop_dark_fill: mix($backdrop_borders_color, $backdrop_bg_color, 35%);
//special cased widget colors
$suggested_bg_color: $selected_bg_color;
$suggested_border_color: $selected_borders_color;
$progress_bg_color: $selected_bg_color;
$progress_border_color: $selected_borders_color;
$checkradio_bg_color: if($variant == 'light', $selected_bg_color, lighten($selected_bg_color,10%));
$checkradio_fg_color: $selected_fg_color;
$checkradio_borders_color: if($variant == 'light', darken($checkradio_bg_color,20%), darken($checkradio_bg_color,40%));
$focus_border_color: if($variant == 'light', transparentize($selected_bg_color, 0.5), transparentize($selected_bg_color, 0.3));

View file

@ -0,0 +1,49 @@
@function gtkalpha($c,$a) {
@return unquote("alpha(#{$c},#{$a})");
}
// Optional compact sizes for buttons, headerbar and headerbar widgets
$_sizevariant: 'compact'; //either 'default', or compact otherwise
$_headerbar_height: if($_sizevariant=='default', 46px, 40px);
$_entry_height: if($_sizevariant=='default', 32px, 28px);
$_btn_pad: if($_sizevariant=='default', 4px 9px, 2px 6px);
$_hb_btn_pad: if($_sizevariant=='default', 6px, 5px);
$_img_btn_pad: if($_sizevariant=='default', 5px, 2px);
$_sel_menu_pad: if($_sizevariant=='default', 6px 10px, 4px 10px);
$_circ_btn_pad: if($_sizevariant=='default', 4px, 2px);
$_switch_margin: if($_sizevariant=='default', 10px, 7px);
$ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
$asset_suffix: if($variant=='dark', '-dark', '');
$backdrop_transition: 200ms ease-out;
$button_transition: all 200ms $ease-out-quad;
$button_radius: 5px;
//added by me:
$button_min_height: 24px;
$button_min_width: 16px;
$button_padding: $_btn_pad;
$button_border: 1px solid;
$menu_radius: 5px;
%selected_items {
background-color: $selected_bg_color;
@at-root %nobg_selected_items, & {
color: $selected_fg_color;
@at-root %selected_items_disabled,
&:disabled { color: mix($selected_fg_color, $selected_bg_color, 50%); }
@at-root %selected_items_backdrop,
&:backdrop {
color: $backdrop_selected_fg_color;
&:disabled { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
}
}
}

View file

@ -0,0 +1,494 @@
//This file is just a quick placeholder for removed code, so I can easily inspect it when I see bugs in my code that replaces this.
//It is not used when compiling the theme
// _drawing.scss
@mixin button($t, $c:$button_bg, $tc:$button_fg, $edge: none, $backimage: null) {
//
// Button drawing function
//
// $t: button type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
// $edge: set to none to not draw the bottom edge or specify a color to not
// use the default one
// $backimage: additional background-image behind the default one
// (for the button.circular hack)
//
// possible $t values:
// normal, hover, active, insensitive, insensitive-active,
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
//
$_hilight_color: _button_hilight_color($tc);
$_button_edge: if($edge == none, none, _widget_edge($edge));
$_blank_edge: if($edge == none, none, _widget_edge(transparentize($edge,1)));
$_button_shadow: 0 1px 2px transparentize($shadow_color, 0.03);
//$tc=red; //to test, comment!
@if $t==normal {
//
// normal button
//
color: $tc;
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c), $borders_color);
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
background-image: if($variant == 'light', linear-gradient(to top, darken($c, 4%) 2px, $c),
linear-gradient(to top, darken($c,1%) 2px, $c)),
$backimage;
@include _button_text_shadow($tc, $c);
@include _shadows(inset 0 1px $_hilight_color, $_button_edge, $_button_shadow);
}
@else if $t==hover {
//
// hovered button
//
color: $tc;
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c), $borders_color);
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
@if $variant == 'light' {
background-image: linear-gradient(to top, $c, lighten($c, 1%) 1px),
$backimage;
@include _button_text_shadow($tc, lighten($c, 6%));
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)), $_button_edge, $_button_shadow);
}
@else {
background-image: linear-gradient(to top, darken($c,1%), lighten($c, 1%) 1px),
$backimage;
@include _button_text_shadow($tc,lighten($c, 6%));
@include _shadows(inset 0 1px _button_hilight_color(darken($c, 2%)), $_button_edge, $_button_shadow);
}
}
@if $t==normal-alt {
//
// normal button alternative look
//
color: $tc;
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
@include _button_text_shadow($tc, $c);
@if $variant == 'light' {
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),
$_button_edge, $_button_shadow);
}
@else {
background-image: linear-gradient(to bottom, darken($c, 3%) 20%, darken($c, 6%) 90%);
@include _shadows(inset 0 1px $_hilight_color,
$_button_edge, $_button_shadow);
}
}
@else if $t==hover-alt {
//
// hovered button alternative look
//
color: $tc;
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
@if $variant == 'light' {
background-image: linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%);
@include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),
$_button_edge, $_button_shadow);
}
@else {
background-image: linear-gradient(to bottom, $c 20%, darken($c, 4%) 90%);
@include _shadows(inset 0 1px $_hilight_color,
$_button_edge, $_button_shadow);
}
}
@else if $t==active {
//
// pushed button
//
color: $tc;
outline-color: transparentize($tc, 0.7);
border-color: if($c != $bg_color, _border_color($c), $borders_color);
background-image: if($variant == 'light', image(darken($c, 14%)), image(darken($c, 9%)));
@include _shadows(inset 0 1px transparentize($_hilight_color, 1), $_button_edge);
text-shadow: none;
-gtk-icon-shadow: none;
}
@else if $t==insensitive {
//
// insensitive button
//
$_bg: $insensitive_bg_color;
color: $insensitive_fg_color;
border-color: $insensitive_borders_color;
background-image: image($_bg);
text-shadow: none;
-gtk-icon-shadow: none;
// white with 0 alpha to avoid an ugly transition, since no color means
// black with 0 alpha
@include _shadows(inset 0 1px transparentize(white, 1), $_button_edge);
}
@else if $t==insensitive-active {
//
// insensitive pushed button
//
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 6%));
$_bc: if($c != $bg_color, _border_color($c), $insensitive_borders_color);
color: if($c != $bg_color, mix($tc, $_bg, 60%), $insensitive_fg_color);
border-color: $_bc;
background-image: image($_bg);
// white with 0 alpha to avoid an ugly transition, since no color means
// black with 0 alpha
@include _shadows(inset 0 1px transparentize(white, 1), $_button_edge);
}
@else if $t==backdrop {
//
// backdrop button
//
$_bg: if($c != $bg_color, $c, $backdrop_bg_color);
$_bc: if($variant == 'light', $c, _border_color($c));
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
text-shadow: none;
-gtk-icon-shadow: none;
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
}
@else if $t==backdrop-active {
//
// backdrop pushed button
//
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
$_bc: if($variant == 'light', $_bg ,_border_color($c));
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
}
@else if $t==backdrop-insensitive {
//
// backdrop insensitive button
//
$_bg: if($c != $bg_color, mix($c, $base_color, 85%), $insensitive_bg_color);
$_bc: if($variant == 'light', $_bg,_border_color($c));
color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
text-shadow: none;
-gtk-icon-shadow: none;
// white with 0 alpha to avoid an ugly transition, since no color means
// black with 0 alpha
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
}
@else if $t==backdrop-insensitive-active {
//
// backdrop insensitive pushed button
//
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
$_bc: if($variant == 'light', $_bg, _border_color($c));
color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
}
@else if $t==osd {
//
// normal osd button
//
$_bg: if($c != $bg_color, transparentize($c, 0.5), $osd_bg_color);
color: $osd_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: inset 0 1px transparentize(white, 0.9);
text-shadow: 0 1px black;
-gtk-icon-shadow: 0 1px black;
outline-color: transparentize($osd_fg_color, 0.7);
}
@else if $t==osd-hover {
//
// active osd button
//
$_bg: if($c != $bg_color, transparentize($c, 0.3), lighten($osd_bg_color, 12%));
color: white;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: inset 0 1px transparentize(white, 0.9);
text-shadow: 0 1px black;
-gtk-icon-shadow: 0 1px black;
outline-color: transparentize($osd_fg_color, 0.7);
}
@else if $t==osd-active {
//
// active osd button
//
$_bg: if($c != $bg_color, $c, $osd_borders_color);
color: white;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: none;
text-shadow: none;
-gtk-icon-shadow: none;
outline-color: transparentize($osd_fg_color, 0.7);
}
@else if $t==osd-insensitive {
//
// insensitive osd button
//
color: $osd_insensitive_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($osd_insensitive_bg_color);
background-clip: padding-box;
box-shadow: none;
text-shadow: none;
-gtk-icon-shadow: none;
}
@else if $t==osd-backdrop {
//
// backdrop osd button
//
$_bg: if($c != $bg_color, transparentize($c, 0.5), $osd_bg_color);
color: $osd_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: none;
text-shadow: none;
-gtk-icon-shadow: none;
}
@else if $t==undecorated {
//
// reset
//
border-color: transparent;
background-color: transparent;
background-image: none;
@include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
text-shadow: none;
-gtk-icon-shadow: none;
}
}
/***************************
* Check and Radio buttons *
***************************/
@import "../common/buttons.scss";
@mixin check($t, $c:$bg_color, $tc:$fg_color, $checked: false) {
// Check/Radio drawing function
//
// $t: check/radio type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
// $checked: bool to chose between checked/unchecked
//
// possible $t values:
// normal, hover, active, insensitive, backdrop, backdrop-insensitive
$_border_color: if($c==$checkradio_bg_color, $c, $alt_borders_color);
$_dim_border_color: transparentize($_border_color, if($variant == 'light', 0.3, 0.7));
@if $t==normal {
background-clip: if($checked, border-box, padding-box);
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
border-color: $_border_color;
box-shadow: 0 1px transparentize(black, 0.95);
color: $tc;
}
@if $t==hover {
background-image: if($c == white, image(darken($c, 5%)), linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%));
}
@if $t==active {
box-shadow: inset 0 1px 1px 0px if($variant == 'light', rgba(0, 0, 0, 0.2), black);
}
@if $t==insensitive {
box-shadow: none;
color: transparentize($tc, 0.3);
}
@if $t==backdrop {
background-image: image($c);
box-shadow: none;
color: $tc;
}
@if $t==backdrop-insensitive {
box-shadow: none;
color: transparentize($tc, 0.3);
}
}
// _common.scss
/* Darken switchbuttons for headerbars. issue #1588 */
stackswitcher button:checked,
button.toggle:checked {
background: if($variant == 'light', image(darken($bg_color, 17%)), image(darken($bg_color, 9%)));
border-color: darken($borders_color, 3%);
border-top-color: darken($borders_color, 8%);
&:backdrop {
@include button(backdrop-active);
}
}
/*****************
* GtkSpinButton *
*****************/
// this was inside
button {
min-height: 16px;
margin: 0;
padding-bottom: 0;
padding-top: 0;
color: mix($fg_color, $base_color, 90%);
background-image: none;
border-style: none none none solid;
border-color: transparentize($borders_color, 0.7);
border-radius: 0;
box-shadow: none;
background-color: transparent;
&:dir(rtl) { border-style: none solid none none; }
&:hover {
color: $fg_color;
background-color: $base_hover_color;
}
&:disabled {
color: $insensitive_fg_color;
background-color: $insensitive_bg_color;
}
&:active {
background-color: transparentize(black, 0.9);
box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
}
&:backdrop {
color: mix($backdrop_fg_color, $backdrop_base_color, 90%);
background-color: transparent;
border-color: transparentize($backdrop_borders_color, 0.7);
transition: $backdrop_transition;
}
&:backdrop:disabled {
color: $insensitive_fg_color;
background-color: $insensitive_bg_color;
background-image: none;
border-style: none none none solid; // It is needed or it gets overridden
&:dir(rtl) { border-style: none solid none none; }
}
&:dir(ltr):last-child { border-radius: 0 $button_radius $button_radius 0; }
&:dir(rtl):first-child { border-radius: $button_radius 0 0 $button_radius; }
}
// scrollbar {...
&.overlay-indicator {
&:not(.dragging):not(.hovering) {
border-color: transparent;
opacity: 0.4;
background-color: transparent;
slider {
margin: 0;
min-width: 3px;
min-height: 3px;
background-color: $fg_color;
border: 1px solid if($variant == 'light', white, black);
}
button {
min-width: 5px;
min-height: 5px;
background-color: $fg_color;
background-clip: padding-box;
border-radius: 100%;
border: 1px solid if($variant == 'light', white, black);
-gtk-icon-source: none;
}
&.horizontal {
slider {
margin: 0 2px;
min-width: $_slider_min_length;
}
button {
margin: 1px 2px;
min-width: 5px;
}
}
&.vertical {
slider {
margin: 2px 0;
min-height: $_slider_min_length;
}
button {
margin: 2px 1px;
min-height: 5px;
}
}
}
&.dragging,
&.hovering { opacity: 0.8; }
}

View file

@ -0,0 +1,427 @@
//This file is just a quick placeholder for removed code, so I can easily inspect it when I see bugs in my code that replaces this.
//It is not used when compiling the theme
// _drawing.scss
@mixin button($t, $c:$_default_button_c, $tc:$fg_color) {
//
// Button drawing function
//
// $t: button type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
//
// possible $t values:
// normal, hover, active, checked-hover, checked-active, insensitive, insensitive-active,
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
//
$_button_shadow: 0 1px 2px transparentize($shadow_color, 0.03);
@if $t==normal {
//
// normal button
//
color: $tc;
outline-color: if($c != $_default_button_c, $alt_focus_border_color, $focus_border_color);
border-color: if($c!=$_default_button_c, _border_color($c, true), $borders_color); //tint if not default button color
background-image: if($variant == 'light', linear-gradient(to top, darken($c, 2%) 2px, $c),
linear-gradient(to top, darken($c,1%) 2px, $c));
@include _shadows($_button_shadow);
}
@else if $t==hover {
//
// hovered button
//
color: $tc;
border-color: if($c != $_default_button_c, _border_color($c), $borders_color);
@if $variant == 'light' {
background-image: linear-gradient(to top, darken($c,16%), darken($c,8%) 1px);
@include _shadows($_button_shadow);
}
@else {
background-image: linear-gradient(to top, darken($c,4%) 20%, darken($c, 3%) 90%);
@include _shadows($_button_shadow);
}
}
@else if $t==active {
//
// pushed button
//
color: $tc;
border-color: if($c != $_default_button_c, _border_color($c), $borders_color);
background-image: if($variant == 'light', image(darken($c, 14%)), image(darken($c, 9%)));
box-shadow: none;
}
@else if $t==checked-hover {
//
// pushed togglebutton hover
//
color: $tc;
border-color: if($c != $_default_button_c, _border_color($c), $borders_color);
background-image: if($variant == 'light', image(darken($c, 18%)), image(darken($c, 12%)));
box-shadow: none;
}
@else if $t==checked-active {
//
// pushed togglebutton pushed further :)
//
color: $tc;
border-color: if($c != $_default_button_c, _border_color($c), $borders_color);
background-image: if($variant == 'light', image(darken($c, 22%)), image(darken($c, 14%)));
box-shadow: none;
}
@else if $t==insensitive {
//
// insensitive button
//
$_bg: if($c != $_default_button_c, mix($c, $base_color, 85%), $insensitive_bg_color);
color: if($tc != $fg_color, mix($tc, $_bg, 50%), $insensitive_fg_color);
border-color: if($c != $_default_button_c, _border_color($c), $insensitive_borders_color);
background-image: image($_bg);
}
@else if $t==insensitive-active {
//
// insensitive pushed button
//
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 6%));
$_bc: if($c != $_default_button_c, _border_color($c), $insensitive_borders_color);
color: if($c != $_default_button_c, mix($tc, $_bg, 60%), $insensitive_fg_color);
border-color: $_bc;
background-image: image($_bg);
box-shadow: none;
}
@else if $t==backdrop {
//
// backdrop button
//
$_bg: if($c != $_default_button_c, $c, $backdrop_bg_color);
$_bc: if($variant == 'light', $c, _border_color($c));
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $_default_button_c, $_bc, $backdrop_borders_color);
background-image: image($_bg);
box-shadow: none;
}
@else if $t==backdrop-active {
//
// backdrop pushed button
//
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
$_bc: if($variant == 'light', $_bg ,_border_color($c));
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $_default_button_c, $_bc, $backdrop_borders_color);
background-image: image($_bg);
box-shadow: none;
}
@else if $t==backdrop-insensitive {
//
// backdrop insensitive button
//
$_bg: if($c != $_default_button_c, mix($c, $base_color, 85%), $insensitive_bg_color);
$_bc: if($variant == 'light', $_bg,_border_color($c));
color: if($c != $_default_button_c, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $_default_button_c, $_bc, $backdrop_borders_color);
background-image: image($_bg);
box-shadow: none;
}
@else if $t==backdrop-insensitive-active {
//
// backdrop insensitive pushed button
//
$_bg: if($variant == 'light', darken(mix($c, $base_color, 85%), 8%), darken(mix($c, $base_color, 85%), 4%));
$_bc: if($variant == 'light', $_bg, _border_color($c));
color: if($c != $_default_button_c, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $_default_button_c, $_bc, $backdrop_borders_color);
background-image: image($_bg);
box-shadow: none;
}
@else if $t==osd {
//
// normal osd button
//
$_bg: if($c != $_default_button_c, transparentize($c, 0.5), $osd_bg_color);
color: $osd_fg_color;
outline-color: if($c != $_default_button_c, $alt_focus_border_color, $focus_border_color);
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
}
@else if $t==osd-hover {
//
// active osd button
//
$_bg: if($c != $_default_button_c, transparentize($c, 0.3), darken($osd_bg_color, 10%));
color: white;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
}
@else if $t==osd-active {
//
// active osd button
//
$_bg: if($c != $_default_button_c, $c, darken($osd_bg_color, 20%));
color: white;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
box-shadow: none;
}
@else if $t==osd-insensitive {
//
// insensitive osd button
//
color: $osd_insensitive_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($osd_insensitive_bg_color);
background-clip: padding-box;
}
@else if $t==osd-backdrop {
//
// backdrop osd button
//
$_bg: if($c != $_default_button_c, transparentize($c, 0.5), $osd_bg_color);
color: $osd_fg_color;
border-color: $osd_borders_color;
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
}
@else if $t==undecorated {
//
// reset
//
border-color: transparent;
background-color: transparent;
background-image: none;
box-shadow: none;
}
@else if $t==undecorated-hover {
border-color: transparent;
background-image: none;
box-shadow: none;
@if $variant == 'light' {
background-color: darken($c,14%);
} @else {
background-color: darken($c,1%);
}
}
@else if $t==undecorated-active {
border-color: transparent;
background-image: none;
box-shadow: none;
@if $variant == 'light' {
background-color: darken($c,20%);
}
@else {
background-color: darken($c,5%);
}
}
}
/***************************
* Check and Radio buttons *
***************************/
@mixin check($t, $c:$checkradio_bg_color, $tc:$checkradio_fg_color, $checked: false) {
// Check/Radio drawing function
//
// $t: check/radio type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
// $checked: bool to chose between checked/unchecked
//
// possible $t values:
// normal, hover, active, insensitive, backdrop, backdrop-insensitive, menu
$_border_color: if($c==$checkradio_bg_color, $checkradio_borders_color, $alt_borders_color);
$_dim_border_color: transparentize($_border_color, if($variant == 'light', 0.3, 0.7));
@if $t==normal {
background-clip: if($checked, border-box, padding-box);
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
border-color: $_border_color;
box-shadow: 0 1px transparentize(black, 0.95);
color: $tc;
}
@if $t==hover {
background-image: if($c == white, image(darken($c, 5%)), linear-gradient(to bottom, lighten($c, 9%) 10%, lighten($c, 4%) 90%));
}
@if $t==active {
box-shadow: inset 0 1px if($variant == 'light', rgba(0, 0, 0, 0.2), black);
background-image: if($c == white, image(darken($c, 15%)), image(darken($c, 5%)));
}
@if $t==insensitive {
box-shadow: none;
color: transparentize($tc, 0.3);
}
@if $t==backdrop {
background-image: image($c);
box-shadow: none;
color: $tc;
}
@if $t==backdrop-insensitive {
box-shadow: none;
color: transparentize($tc, 0.3);
}
@if $t==menu {
transform: scale(0.8);
border-width: 1.2px;
border-color: transparent;
box-shadow: none;
background-image: image(transparent);
color: $tc;
}
@if $t==menu-active {
transform: scale(0.8);
border-width: 1.2px;
color: $tc;
box-shadow: none;
background-image: image(transparent);
}
}
// _common.scss
/* Darken switchbuttons for headerbars. issue #1588 */
stackswitcher > button:checked,
button.toggle:checked {
background: if($variant == 'light', image(darken($bg_color, 17%)), image(darken($bg_color, 9%)));
border-color: darken($borders_color, 3%);
border-top-color: darken($borders_color, 8%);
&:backdrop {
@include button(backdrop-active);
}
}
/*****************
* GtkSpinButton *
*****************/
//this was inside
> button.image-button.up:not(.flat),
> button.image-button.down:not(.flat) {
min-height: 16px;
margin: 0;
padding-bottom: 0;
padding-top: 0;
color: mix($fg_color, $base_color, 90%);
background-image: none;
border-style: none none none solid;
border-color: transparentize($borders_color, 0.7);
border-radius: 0;
box-shadow: none;
background-color: transparent;
&:dir(rtl) { border-style: none solid none none; }
&:hover {
color: $fg_color;
background-color: darken($bg_color,5%);
}
&:disabled {
color: $insensitive_fg_color;
background-color: $insensitive_bg_color;
}
&:active {
background-color: transparentize(black, 0.9);
box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
}
&:dir(ltr):last-child { border-radius: 0 $button_radius $button_radius 0; }
&:dir(rtl):first-child { border-radius: $button_radius 0 0 $button_radius; }
}
// scrollbar {...
&.overlay-indicator {
&:not(.dragging):not(.hovering) {
border-color: transparent;
opacity: 0.4;
background-color: transparent;
> range > trough > slider {
margin: 0;
min-width: 3px;
min-height: 3px;
background-color: $fg_color;
border: 1px solid if($variant == 'light', white, black);
}
&.horizontal {
> range > trough > slider {
margin: 0 2px;
min-width: $_slider_min_length;
}
}
&.vertical {
> range > trough > slider {
margin: 2px 0;
min-height: $_slider_min_length;
}
}
}
&.dragging,
&.hovering { opacity: 0.8; }
}*/

View file

@ -0,0 +1,90 @@
//this used to be in _common.scss. I've left there the warning to locate where it used to be. This code is now unused.
/*
// *WARNING* scale with marks madness following
// FIXME: OSD and selected list rows missing, I don't feel like adding the other 144 assets needed for those...
$suffix: if($variant == 'light', '', '-dark');
@each $dir_class, $dir_infix in ('horizontal', 'horz'),
('vertical', 'vert') {
@each $marks_infix, $marks_class in ('scale-has-marks-above', 'marks-before:not(.marks-after)'),
('scale-has-marks-below', 'marks-after:not(.marks-before)') {
@each $state, $state_infix in ('', ''),
(':hover', '-hover'),
(':active', '-active'),
(':disabled', '-insensitive'),
(':backdrop', '-backdrop'),
(':backdrop:disabled', '-backdrop-insensitive') {
&.#{$dir_class}.#{$marks_class} {
slider {
&#{$state} {
// an asymmetric slider asset is used here, so the margins are uneven, the smaller
// margin is set on the point side.
margin: -10px;
$_scale_asset: 'assets/slider-#{$dir_infix}-#{$marks_infix}#{$state_infix}#{$suffix}';
border-style: none;
border-radius: 0;
background-color: transparent;
background-image: -gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png'));
$_scale_slider_bg_pos: bottom;
@if $dir_class == 'horizontal' {
min-height: 26px;
min-width: 22px;
@if $marks_infix == 'scale-has-marks-above' {
margin-top: -14px;
$_scale_slider_bg_pos: top;
}
@else { margin-bottom: -14px; }
}
@else {
min-height: 22px;
min-width: 26px;
@if $marks_infix == 'scale-has-marks-above' {
margin-left: -14px;
$_scale_slider_bg_pos: left bottom;
}
@else {
margin-right: -14px;
$_scale_slider_bg_pos: right bottom;
}
}
background-position: $_scale_slider_bg_pos;
background-repeat: no-repeat;
box-shadow: none;
}
}
&.fine-tune slider {
// bigger negative margins to make the trough grow here as well
margin: -7px;
@if $dir_class == 'horizontal' {
@if $marks_infix == 'scale-has-marks-above' { margin-top: -11px; }
@else { margin-bottom: -11px; }
}
@else {
@if $marks_infix == 'scale-has-marks-above' { margin-left: -11px; }
@else { margin-right: -11px; }
}
}
}
}
}
}*/