diff --git a/src/components/popover/tab/keypress/keypress-tab.component.html b/src/components/popover/tab/keypress/keypress-tab.component.html
index c0ea90d6..7632971f 100644
--- a/src/components/popover/tab/keypress/keypress-tab.component.html
+++ b/src/components/popover/tab/keypress/keypress-tab.component.html
@@ -8,14 +8,20 @@
Modifiers:
Long press action:
-
+
diff --git a/src/components/popover/tab/keypress/keypress-tab.component.ts b/src/components/popover/tab/keypress/keypress-tab.component.ts
index de3c7c35..3ba46c75 100644
--- a/src/components/popover/tab/keypress/keypress-tab.component.ts
+++ b/src/components/popover/tab/keypress/keypress-tab.component.ts
@@ -110,10 +110,11 @@ export class KeypressTabComponent implements OnChanges, Tab {
if (state.additional && state.additional.explanation) {
return jQuery(
''
- + state.text
- + ' '
- + state.additional.explanation
- + ''
+ + '' + state.text + ''
+ + ' '
+ + state.additional.explanation
+ + '' +
+ ''
);
} else {
return jQuery('' + state.text + '');
diff --git a/src/components/popover/tab/keypress/scancodes.json b/src/components/popover/tab/keypress/scancodes.json
index afecb298..da395873 100644
--- a/src/components/popover/tab/keypress/scancodes.json
+++ b/src/components/popover/tab/keypress/scancodes.json
@@ -159,9 +159,9 @@
{
"id": "40",
"additional": {
- "explanation": "Enter"
+ "explanation": "Return"
},
- "text": "Return"
+ "text": "Enter"
},
{
"id": "41",
@@ -177,7 +177,7 @@
},
{
"id": "44",
- "text": "Spacebar"
+ "text": "Space"
}
]
},
@@ -231,7 +231,7 @@
]
},
{
- "text": "Functionkeys",
+ "text": "Function keys",
"children": [
{
"id": "58",
@@ -350,7 +350,7 @@
]
},
{
- "text": "NumberPad",
+ "text": "Numpad",
"children": [
{
"id": "83",
@@ -503,7 +503,7 @@
]
},
{
- "text": "MediaKeys",
+ "text": "Media Keys",
"children": [
{
"id": "127",
diff --git a/src/components/popover/tab/layer/layer-tab.component.html b/src/components/popover/tab/layer/layer-tab.component.html
index 6c1fb4a3..cfdbeae7 100644
--- a/src/components/popover/tab/layer/layer-tab.component.html
+++ b/src/components/popover/tab/layer/layer-tab.component.html
@@ -1,6 +1,14 @@
-
+
the
-
+
layer by pressing this key.
layer by holding this key.
diff --git a/src/components/popover/tab/layer/layer-tab.component.scss b/src/components/popover/tab/layer/layer-tab.component.scss
index e885e076..6c2d387a 100644
--- a/src/components/popover/tab/layer/layer-tab.component.scss
+++ b/src/components/popover/tab/layer/layer-tab.component.scss
@@ -3,9 +3,16 @@
margin: 0 -5px;
> span,
- > select2 {
+ > select {
margin: 0 5px;
display: flex;
align-items: center;
}
}
+
+select {
+ background-color: #fff;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ padding: 4px 20px 4px 8px;
+}
diff --git a/src/components/popover/tab/layer/layer-tab.component.ts b/src/components/popover/tab/layer/layer-tab.component.ts
index 205873a5..ca0e9a54 100644
--- a/src/components/popover/tab/layer/layer-tab.component.ts
+++ b/src/components/popover/tab/layer/layer-tab.component.ts
@@ -1,9 +1,7 @@
-import { Component, Input, OnChanges, ViewChild } from '@angular/core';
+import { Component, Input, OnChanges } from '@angular/core';
import { KeyAction, LayerName, SwitchLayerAction } from '../../../../config-serializer/config-items/key-action';
-import { Select2Component, Select2OptionData } from 'ng2-select2/ng2-select2';
-
import { Tab } from '../tab';
@Component({
@@ -13,39 +11,35 @@ import { Tab } from '../tab';
})
export class LayerTabComponent implements OnChanges, Tab {
@Input() defaultKeyAction: KeyAction;
- @ViewChild('toggleSelect') toggleSelect2: Select2Component;
- @ViewChild('layerSelect') layerSelect2: Select2Component;
- private toggle: boolean;
- private layer: LayerName;
-
- /* tslint:disable:no-unused-variable: They're used in the template */
- private toggleData: Array = [
+ toggleData: {id: boolean, text: string}[] = [
{
- id: 'false',
+ id: false,
text: 'Activate'
},
{
- id: 'true',
+ id: true,
text: 'Toggle'
}
];
- private layerData: Array = [
+ layerData: {id: number, text: string}[] = [
{
- id: '0',
+ id: 0,
text: 'Mod'
},
{
- id: '1',
+ id: 1,
text: 'Fn'
},
{
- id: '2',
+ id: 2,
text: 'Mouse'
}
];
- /* tslint:enable:no-unused-variable */
+
+ private toggle: boolean;
+ private layer: LayerName;
constructor() {
this.toggle = false;
@@ -64,6 +58,7 @@ export class LayerTabComponent implements OnChanges, Tab {
if (!(keyAction instanceof SwitchLayerAction)) {
return false;
}
+
let switchLayerAction: SwitchLayerAction = keyAction;
this.toggle = switchLayerAction.isLayerToggleable;
this.layer = switchLayerAction.layer;
@@ -77,17 +72,11 @@ export class LayerTabComponent implements OnChanges, Tab {
return keyAction;
}
- // TODO: change to the correct type when the wrapper has added it.
- /* tslint:disable:no-unused-variable: This function is used in the template */
- private toggleChanged(event: any) {
- /* tslint:enable:no-unused-variable */
- this.toggle = event.value;
+ toggleChanged(value: string) {
+ this.toggle = value === 'true';
}
- // TODO: change to the correct type when the wrapper has added it.
- /* tslint:disable:no-unused-variable: This function is used in the template */
- private layerChanged(event: any) {
- /* tslint:enable:no-unused-variable */
- this.layer = +event.value;
+ layerChanged(value: number) {
+ this.layer = +value;
}
}
diff --git a/src/main-app/main-app.component.scss b/src/main-app/main-app.component.scss
index 49520954..5769f6bc 100644
--- a/src/main-app/main-app.component.scss
+++ b/src/main-app/main-app.component.scss
@@ -17,10 +17,20 @@ main-app {
.select2 {
&-container {
z-index: 1100;
+
+ .scancode--searchterm {
+ text-align: right;
+ color: #b7b7b7;
+ }
+ }
+
+ &-item {
+ display: flex;
+ justify-content: space-between;
}
&-results {
- text-align: center;
+ text-align: left;
}
}
@@ -28,6 +38,10 @@ main-app {
cursor: pointer;
}
+.select2-container--default .select2-dropdown--below .select2-results > .select2-results__options {
+ max-height: 300px;
+}
+
/* GitHub ribbon */
.github-fork-ribbon {
background-color: #a00;