Changeset View
Changeset View
Standalone View
Standalone View
src/gtk318/widgets/_entry.scss
- This file was added.
1 | @mixin entry($t, $fc:v_color(active)) { | ||||
---|---|---|---|---|---|
2 | // | ||||
3 | // Entries drawing function | ||||
4 | // | ||||
5 | // $t: entry type | ||||
6 | // $fc: focus color | ||||
7 | // $edge: set to none to not draw the bottom edge or specify a color to not | ||||
8 | // use the default one | ||||
9 | // | ||||
10 | // possible $t values: | ||||
11 | // normal, focus, insensitive, backdrop, backdrop-insensitive, osd, osd-focus, osd-backdrop; | ||||
12 | // | ||||
13 | @if $t==normal { | ||||
14 | color: v_color(text); | ||||
15 | border-color: $border_color; | ||||
16 | background-color: v_color(normal); | ||||
17 | box-shadow: none; | ||||
18 | } | ||||
19 | | ||||
20 | @if $t==focus { | ||||
21 | border-color: $fc; | ||||
22 | } | ||||
23 | | ||||
24 | @if $t==insensitive { | ||||
25 | color: insensitive(v_color(text)); | ||||
26 | border-color: insensitive($border_color); | ||||
27 | background-color: insensitive(v_color(normal)); | ||||
28 | } | ||||
29 | | ||||
30 | @if $t==backdrop { | ||||
31 | color: backdrop(v_color(text)); | ||||
32 | border-color: backdrop($border_color); | ||||
33 | background-color: backdrop(v_color(normal)); | ||||
34 | } | ||||
35 | | ||||
36 | @if $t==backdrop-insensitive { | ||||
37 | color: backdrop(insensitive(v_color(text))); | ||||
38 | border-color: backdrop(insensitive($border_color)); | ||||
39 | background-color: backdrop(insensitive(v_color(normal))); | ||||
40 | } | ||||
41 | } | ||||
42 | | ||||
43 | /**************** | ||||
44 | * Text Entries * | ||||
45 | ****************/ | ||||
46 | | ||||
47 | .entry { | ||||
48 | border: 1px solid; | ||||
49 | padding: 5px 8px 5px; | ||||
50 | | ||||
51 | &.image { // icons inside the entry | ||||
52 | &.left { padding-left: 0; } | ||||
53 | &.right { padding-right: 0; } | ||||
54 | } | ||||
55 | | ||||
56 | border-radius: $r; | ||||
57 | transition: all 200ms $ease-out-quad; | ||||
58 | @include entry(normal); | ||||
59 | | ||||
60 | &.flat, &.flat:focus { | ||||
61 | padding: 2px; | ||||
62 | @include entry(normal); | ||||
63 | border: none; | ||||
64 | border-radius: 0; | ||||
65 | } | ||||
66 | | ||||
67 | &:focus { @include entry(focus); } | ||||
68 | &:insensitive { @include entry(insensitive); } | ||||
69 | &:backdrop { @include entry(backdrop); } | ||||
70 | &:backdrop:insensitive { @include entry(backdrop-insensitive); } | ||||
71 | | ||||
72 | &:selected, | ||||
73 | &:selected:focus { | ||||
74 | @extend %selected_items; | ||||
75 | } | ||||
76 | | ||||
77 | &.progressbar { | ||||
78 | margin: 1px; | ||||
79 | border-radius: 0; | ||||
80 | border-width: 0 0 2px; | ||||
81 | border-color: s_color(normal); | ||||
82 | border-style: solid; | ||||
83 | background-image: none; | ||||
84 | background-color: transparent; | ||||
85 | box-shadow: none; | ||||
86 | &:backdrop { | ||||
87 | background-color: transparent; | ||||
88 | border-color: backdrop(s_color(backdrop)); | ||||
89 | } | ||||
90 | } | ||||
91 | | ||||
92 | @each $e_type, $e_color in (error, $error_color), | ||||
93 | (warning, $warning_color) { | ||||
94 | &.#{$e_type} { | ||||
95 | color: $e_color; | ||||
96 | border-color: $e_color; | ||||
97 | background-color: transparentize($e_color, 0.5); | ||||
98 | &:focus { | ||||
99 | @include entry(focus, $e_color); | ||||
100 | background-color: transparentize($e_color, 0.5); | ||||
101 | } | ||||
102 | &:selected, &:selected:focus { background-color: $e_color; } | ||||
103 | &:backdrop { | ||||
104 | color: backdrop($e_color); | ||||
105 | border-color: backdrop($e_color); | ||||
106 | background-color: backdrop(transparentize($e_color, 0.5)); | ||||
107 | } | ||||
108 | } | ||||
109 | } | ||||
110 | | ||||
111 | &.image { // entry icons colors | ||||
112 | color: mix(w_color(text),v_color(text), 80%); | ||||
113 | &:hover { color: b_color(hover); } | ||||
114 | &:active { color: b_color(active); } | ||||
115 | &:backdrop { color: backdrop(mix(w_color(text), v_color(text), 80%)); } | ||||
116 | } | ||||
117 | } |