Skip to content

Commit 85138a0

Browse files
committed
[Gtk-3.22][Button-Redesign] Spinbutton: Fixing color and entry border
1 parent 8670cc0 commit 85138a0

2 files changed

Lines changed: 32 additions & 13 deletions

File tree

src/gtk-3.20/scss/widgets/_button.scss

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,12 @@
273273
$border_strength: if(lightness($bg) > 50, 0, .1);
274274
$shadow_strength: if(lightness($bg) > 50, 0, .1);
275275

276-
$button_bg: if(lightness($bg) > 50, shade($bg, 1.08), shade($bg, 1.2));
276+
$button_bg: if(lightness($bg) > 50, $bg, shade($bg, 1.2));
277277

278278
@extend %button;
279279
@if (lightness($button_bg) > 50) {
280280
border-color: border_normal($button_bg);
281-
@include linear-gradient($button_bg, 1.08);
281+
@include linear-gradient(shade($button_bg, 1.08));
282282
} @else {
283283
@include linear-gradient($button_bg);
284284
@include border(rgba(0, 0, 0, .12 + $border_strength));
@@ -298,7 +298,7 @@
298298
&:focus, &:hover {
299299
@if (lightness($button_bg) > 50) {
300300
border-color: border_active($button_bg);
301-
@include linear-gradient(shade($button_bg, 1.10));
301+
@include linear-gradient(shade($button_bg, 1.11));
302302
} @else {
303303
@include linear-gradient(shade($button_bg, 1.2));
304304
@include border(rgba(0, 0, 0, .2 + $border_strength));
@@ -417,9 +417,16 @@
417417
}
418418

419419
&:not(.vertical) {
420-
@extend %entry;
421-
@include linear-gradient($base_color, to top);
422-
border-color: border_normal($base_color);
420+
@if (lightness($bg_color) > 50) {
421+
border: 1px solid border_normal($bg_color);
422+
background-color: transparent;
423+
background-image: none;
424+
box-shadow: inset 1px 0 shade($base_color, .9);
425+
} @else {
426+
@extend %entry;
427+
@include linear-gradient($base_color, to top);
428+
@include border($base_color);
429+
}
423430

424431
padding: 0;
425432

@@ -444,11 +451,18 @@
444451
border-radius: 0;
445452
border-color: alpha($borders_color, .8);
446453
border-style: none none none solid;
447-
background-color: shade($bg_color, 1.08);
448454
background-image: none;
449455
box-shadow: none;
450456

451-
&:hover { background-color: shade($bg_color, 1.2); }
457+
@if (lightness($bg_color) > 50) {
458+
background-color: shade($bg_color, 1.08);
459+
}
460+
461+
&:hover {
462+
@if (lightness($bg_color) > 50) {
463+
background-color: shade($bg_color, 1.11);
464+
}
465+
}
452466

453467
&:dir(rtl) { border-style: none solid none none; }
454468

src/gtk-3.20/scss/widgets/_entry.scss

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,16 @@
9090
border-width: 1px;
9191
border-style: solid;
9292
border-radius: $roundness;
93-
transition: border 150ms ease;
94-
box-shadow: inset 1px 1px alpha($dark_shadow, .06),
95-
inset -1px 0 alpha($dark_shadow, .06);
93+
border-color: border_normal($bg_color);
94+
transition: border 100ms ease-out;
95+
&:focus, &:hover, &:active { transition: border 100ms ease-in; }
96+
97+
box-shadow: inset 1px 0 alpha($dark_shadow, 0.10),
98+
inset 0 1px alpha($dark_shadow, 0.12),
99+
inset -1px 0 alpha($dark_shadow, 0.10),
100+
inset 0 -1px alpha($dark_shadow, 0.05);
101+
96102

97-
&:focus, &:hover, &:active { transition: none; }
98103

99104
&:selected {
100105
&, &:selected:focus {
@@ -149,7 +154,7 @@
149154
@mixin entry($bg, $fg, $border: $borders_color) {
150155
@extend %entry;
151156
@include linear-gradient($bg, to top);
152-
@include border($bg);
157+
border-color: border_normal($bg);
153158

154159
padding: $spacing;
155160

0 commit comments

Comments
 (0)