summaryrefslogtreecommitdiffstats
path: root/data/theme/gnome-shell-sass/widgets/_keyboard.scss
blob: 1dc6b953c64b6f92ef5c9727632b588a14131c58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* On-screen Keyboard */

$key_size: 1.2em;
$key_border_radius: $base_border_radius + 4px; // 12px
$key_bg_color:  darken($osd_fg_color, 70%);
// $default_key_bg_color: darken($key_bg_color, 4%);
$default_key_bg_color: if($variant=='light', darken($key_bg_color, 11%), darken($key_bg_color, 10%));


// draw keys using button function
#keyboard {
  // background-color: transparentize(if($variant=='light', darken($bg_color, 5%), darken($bg_color, 8%)), 0.1);
  background-color: $osd_bg_color;
  box-shadow: inset 0 1px 0 0 $osd_outer_borders_color;

  .page-indicator {
    padding: $base_padding;

    .page-indicator-icon {
      width: 8px;
      height: 8px;
    }
  }
}

// the container for individual keys
.key-container {
  padding: $base_margin;
  spacing: $base_margin;
}

// the keys
.keyboard-key {

  @include fontsize($base_font_size + 5);
  font-weight: bold;
  min-height: $key_size;
  min-width: $key_size;
  border-width: 1px;
  border-style: solid;
  border-radius: $key_border_radius;
  box-shadow: 0 1px 0 0 $shadow_color;

  @include keyboard_key(normal, $key_bg_color, $osd_fg_color);

  &:focus { @include keyboard_key(focus);}
  &:hover { @include keyboard_key(hover, $key_bg_color, $osd_fg_color);}
  &:active { @include keyboard_key(active, $key_bg_color, $osd_fg_color); }
  &:checked { @include keyboard_key(checked, $key_bg_color, $osd_fg_color); }

  &:grayed { //FIXMEy
    background-color: darken($bg_color, 3%);
    color: $osd_fg_color;
    border-color: $osd_borders_color;
  }

  // non-character keys
  &.default-key {
    @include keyboard_key(normal, $default_key_bg_color, $osd_fg_color);
    &:hover {@include keyboard_key(hover, $default_key_bg_color, $osd_fg_color);}
    &:active { @include keyboard_key(active, $default_key_bg_color, $osd_fg_color);}
    &:checked { @include keyboard_key(checked, $default_key_bg_color, $osd_fg_color);}
    border-radius: $key_border_radius;

    // keys that may be latched: ctrl/alt/shift
    &:latched {
      border-color: lighten($selected_bg_color, 5%);
      background-color: $selected_bg_color;
    }
  }

  // enter key is suggested-action
  &.enter-key {
    @include keyboard_key(normal, $selected_bg_color, $selected_fg_color);
    &:hover { @include keyboard_key(hover, $selected_bg_color, $selected_fg_color);}
    &:active {@include keyboard_key(active, $selected_bg_color, $selected_fg_color);}
    &:checked {@include keyboard_key(checked, $selected_bg_color, $selected_fg_color);}
    border-radius: $key_border_radius;
    color: $osd_fg_color;
  }

  &.shift-key-lowercase {}
  
  // pressed shift has different style
  &.shift-key-uppercase { 
    background-color: lighten($key_bg_color, 20%);
    color: $osd_bg_color;
    &:hover {
      background-color: lighten($key_bg_color, 25%);
      color: lighten($osd_bg_color, 5%);
    }
  }

  // size of icons on keys
  StIcon { icon-size: 24px; }
}

// long press on a key popup
.keyboard-subkeys {
  -arrow-border-radius: $base_border_radius*2;
  -arrow-background-color: $osd_bg_color;
  -arrow-border-width: 1px;
  -arrow-border-color: lighten($osd_bg_color, 9%);
  -arrow-base: 20px;
  -arrow-rise: 10px;
  -boxpointer-gap: $base_padding;
  padding: $base_padding;

  .keyboard-key {
    @include keyboard_key(normal, $key_bg_color, $osd_fg_color);

    &:focus { @include keyboard_key(focus);}
    &:hover { @include keyboard_key(hover, $key_bg_color, $osd_fg_color);}
    &:active { @include keyboard_key(active, $key_bg_color, $osd_fg_color); }
    &:checked { @include keyboard_key(checked, $key_bg_color, $osd_fg_color); }

    border-radius:$key_border_radius;
  }
}

// emoji
.emoji-page {
  .keyboard-key {
    background-color: transparent;
    border: none;
    color: initial;
  }
}

.emoji-panel {
  .keyboard-key:latched {
    border-color: lighten($selected_bg_color, 5%);
    background-color: $selected_bg_color;
  }
}

// suggestions
.word-suggestions {
  @include fontsize($base_font_size + 1);
  spacing: 12px;
  min-height: 17pt;
  padding: $base_padding*2;
  color: $osd_fg_color;

  // each suggestion
  StButton {
    margin: 0 3px;
    min-width: 32px;
    border-radius: $base_border_radius - 2px;
    padding: 0px $base_padding*3;

    @include keyboard_key(undecorated, $key_bg_color, $osd_fg_color);

    &:focus { @include keyboard_key(focus);}
    &:hover { @include keyboard_key(hover, $key_bg_color, $osd_fg_color);}
    &:active { @include keyboard_key(active, $key_bg_color, $osd_fg_color); }
    &:checked { @include keyboard_key(checked, $key_bg_color, $osd_fg_color); }
  }
}