diff --git a/src/components/popover/popover.component.html b/src/components/popover/popover.component.html
index 20bc355c..b8fdc819 100644
--- a/src/components/popover/popover.component.html
+++ b/src/components/popover/popover.component.html
@@ -48,7 +48,7 @@
-
+
diff --git a/src/components/popover/popover.component.ts b/src/components/popover/popover.component.ts
index 5c33386e..31a1dd8b 100644
--- a/src/components/popover/popover.component.ts
+++ b/src/components/popover/popover.component.ts
@@ -67,6 +67,7 @@ enum TabName {
export class PopoverComponent implements OnChanges {
@Input() defaultKeyAction: KeyAction;
@Input() currentKeymap: Keymap;
+ @Input() currentLayer: number;
@Input() keyPosition: ClientRect;
@Input() wrapPosition: ClientRect;
@Input() visible: boolean;
diff --git a/src/components/popover/tab/layer/layer-tab.component.html b/src/components/popover/tab/layer/layer-tab.component.html
index cfdbeae7..5cf920c5 100644
--- a/src/components/popover/tab/layer/layer-tab.component.html
+++ b/src/components/popover/tab/layer/layer-tab.component.html
@@ -1,15 +1,20 @@
-
-
the
-
-
- layer by pressing this key.
- layer by holding this key.
-
\ No newline at end of file
+
+
+ the
+
+
+ layer by pressing this key.
+ layer by holding this key.
+
+
+
+ Layer switching is only possible from the base layer.
+
\ No newline at end of file
diff --git a/src/components/popover/tab/layer/layer-tab.component.scss b/src/components/popover/tab/layer/layer-tab.component.scss
index 6c2d387a..7a67b95c 100644
--- a/src/components/popover/tab/layer/layer-tab.component.scss
+++ b/src/components/popover/tab/layer/layer-tab.component.scss
@@ -2,6 +2,10 @@
display: flex;
margin: 0 -5px;
+ &.no-base {
+ justify-content: center;
+ }
+
> span,
> select {
margin: 0 5px;
diff --git a/src/components/popover/tab/layer/layer-tab.component.ts b/src/components/popover/tab/layer/layer-tab.component.ts
index ca0e9a54..6fefe13e 100644
--- a/src/components/popover/tab/layer/layer-tab.component.ts
+++ b/src/components/popover/tab/layer/layer-tab.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, OnChanges } from '@angular/core';
+import { Component, HostBinding, Input, OnChanges, SimpleChanges } from '@angular/core';
import { KeyAction, LayerName, SwitchLayerAction } from '../../../../config-serializer/config-items/key-action';
@@ -11,8 +11,11 @@ import { Tab } from '../tab';
})
export class LayerTabComponent implements OnChanges, Tab {
@Input() defaultKeyAction: KeyAction;
+ @Input() currentLayer: number;
- toggleData: {id: boolean, text: string}[] = [
+ @HostBinding('class.no-base') isNotBase: boolean;
+
+ toggleData: { id: boolean, text: string }[] = [
{
id: false,
text: 'Activate'
@@ -23,7 +26,7 @@ export class LayerTabComponent implements OnChanges, Tab {
}
];
- layerData: {id: number, text: string}[] = [
+ layerData: { id: number, text: string }[] = [
{
id: 0,
text: 'Mod'
@@ -46,8 +49,14 @@ export class LayerTabComponent implements OnChanges, Tab {
this.layer = LayerName.mod;
}
- ngOnChanges() {
- this.fromKeyAction(this.defaultKeyAction);
+ ngOnChanges(changes: SimpleChanges) {
+ if (changes['defaultKeyAction']) {
+ this.fromKeyAction(this.defaultKeyAction);
+ }
+
+ if (changes['currentLayer']) {
+ this.isNotBase = this.currentLayer > 0;
+ }
}
keyActionValid(): boolean {
diff --git a/src/components/svg/wrap/svg-keyboard-wrap.component.html b/src/components/svg/wrap/svg-keyboard-wrap.component.html
index 07a3314f..9dbc9b9f 100644
--- a/src/components/svg/wrap/svg-keyboard-wrap.component.html
+++ b/src/components/svg/wrap/svg-keyboard-wrap.component.html
@@ -5,7 +5,8 @@
[keybindAnimationEnabled]="keybindAnimationEnabled"
(keyClick)="onKeyClick($event.moduleId, $event.keyId, $event.keyTarget)"
(keyHover)="onKeyHover($event.moduleId, $event.event, $event.over, $event.keyId)">
-
+