From ac5bf13105f032d308a7db5c6fb4fc4e4dfa9b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Thu, 12 May 2016 19:50:24 +0200 Subject: [PATCH] Basic popover tab components. --- src/components/popover/popover.component.ts | 31 ++++++++++---- .../popover/tab/keymap-tab.component.ts | 16 ++++++++ .../keypress-tab.component.ts} | 17 ++++++-- .../popover/tab/layer-tab.component.ts | 28 +++++++++++++ .../popover/tab/macro-tab.component.ts | 16 ++++++++ .../popover/tab/mouse-tab.component.ts | 40 +++++++++++++++++++ .../popover/tab/none-tab.component.ts | 21 ++++++++++ .../capture-keystroke-button.component.ts | 0 8 files changed, 158 insertions(+), 11 deletions(-) create mode 100644 src/components/popover/tab/keymap-tab.component.ts rename src/components/popover/{keypress-edit.component.ts => tab/keypress-tab.component.ts} (73%) create mode 100644 src/components/popover/tab/layer-tab.component.ts create mode 100644 src/components/popover/tab/macro-tab.component.ts create mode 100644 src/components/popover/tab/mouse-tab.component.ts create mode 100644 src/components/popover/tab/none-tab.component.ts rename src/components/popover/{ => widgets}/capture-keystroke-button.component.ts (100%) diff --git a/src/components/popover/popover.component.ts b/src/components/popover/popover.component.ts index be5e65a5..8e43c0b2 100644 --- a/src/components/popover/popover.component.ts +++ b/src/components/popover/popover.component.ts @@ -13,7 +13,12 @@ import { import {NgSwitch, NgSwitchWhen} from '@angular/common'; -import {KeypressEditComponent} from './keypress-edit.component'; +import {KeypressTabComponent} from './tab/keypress-tab.component'; +import {LayerTabComponent} from './tab/layer-tab.component'; +import {MouseTabComponent} from './tab/mouse-tab.component'; +import {MacroTabComponent} from './tab/macro-tab.component'; +import {KeymapTabComponent} from './tab/keymap-tab.component'; +import {NoneTabComponent} from './tab/none-tab.component'; @Component({ moduleId: module.id, @@ -65,12 +70,12 @@ import {KeypressEditComponent} from './keypress-edit.component';
- -
Layer
-
Mouse
-
Macro
-
Keymap
-
None
+ + + + + +
@@ -115,7 +120,17 @@ import {KeypressEditComponent} from './keypress-edit.component'; } `], host: { 'class': 'popover' }, - directives: [NgSwitch, NgSwitchWhen, KeypressEditComponent] + directives: + [ + NgSwitch, + NgSwitchWhen, + KeypressTabComponent, + LayerTabComponent, + MouseTabComponent, + MacroTabComponent, + KeymapTabComponent, + NoneTabComponent + ] }) export class PopoverComponent implements OnInit, AfterViewInit { @Output() cancel = new EventEmitter(); diff --git a/src/components/popover/tab/keymap-tab.component.ts b/src/components/popover/tab/keymap-tab.component.ts new file mode 100644 index 00000000..e41f4895 --- /dev/null +++ b/src/components/popover/tab/keymap-tab.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'keymap-tab', + template: + ` + Keymap + ` +}) +export class KeymapTabComponent implements OnInit { + constructor() { } + + ngOnInit() { } + +} diff --git a/src/components/popover/keypress-edit.component.ts b/src/components/popover/tab/keypress-tab.component.ts similarity index 73% rename from src/components/popover/keypress-edit.component.ts rename to src/components/popover/tab/keypress-tab.component.ts index a1f20c42..cf190e43 100644 --- a/src/components/popover/keypress-edit.component.ts +++ b/src/components/popover/tab/keypress-tab.component.ts @@ -1,10 +1,14 @@ import { Component, OnInit } from '@angular/core'; -import {CaptureKeystrokeButtonComponent} from './capture-keystroke-button.component'; +import { CaptureKeystrokeButtonComponent } from '../widgets/capture-keystroke-button.component'; + +import { KeystrokeAction } from '../../../../config-serializer/config-items/KeystrokeAction'; +import { KeystrokeModifiersAction } from '../../../../config-serializer/config-items/KeystrokeModifiersAction'; +import { KeystrokeWithModifiersAction } from '../../../../config-serializer/config-items/KeystrokeWithModifiersAction'; @Component({ moduleId: module.id, - selector: 'keypress-edit', + selector: 'keypress-tab', template: `
@@ -41,10 +45,13 @@ import {CaptureKeystrokeButtonComponent} from './capture-keystroke-button.compon `, directives: [CaptureKeystrokeButtonComponent] }) -export class KeypressEditComponent implements OnInit { +export class KeypressTabComponent implements OnInit { private leftModifiers: string[]; private rightModifiers: string[]; + private leftModifierSelects: boolean[]; + private rightModifierSelects: boolean[]; + constructor() { this.leftModifiers = ['LShift', 'LCtrl', 'LSuper', 'LAlt']; this.rightModifiers = ['RShift', 'RCtrl', 'RSuper', 'RAlt']; @@ -52,4 +59,8 @@ export class KeypressEditComponent implements OnInit { ngOnInit() { } + getKeyAction(): KeystrokeAction | KeystrokeModifiersAction | KeystrokeWithModifiersAction { + return; + } + } diff --git a/src/components/popover/tab/layer-tab.component.ts b/src/components/popover/tab/layer-tab.component.ts new file mode 100644 index 00000000..194372b4 --- /dev/null +++ b/src/components/popover/tab/layer-tab.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'layer-tab', + template: + ` + + the + + + layer by holding this key. + + ` +}) +export class LayerTabComponent implements OnInit { + constructor() { } + + ngOnInit() { } + +} diff --git a/src/components/popover/tab/macro-tab.component.ts b/src/components/popover/tab/macro-tab.component.ts new file mode 100644 index 00000000..1abf2b3f --- /dev/null +++ b/src/components/popover/tab/macro-tab.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'macro-tab', + template: + ` + Macro + ` +}) +export class MacroTabComponent implements OnInit { + constructor() { } + + ngOnInit() { } + +} diff --git a/src/components/popover/tab/mouse-tab.component.ts b/src/components/popover/tab/mouse-tab.component.ts new file mode 100644 index 00000000..40f5bcfb --- /dev/null +++ b/src/components/popover/tab/mouse-tab.component.ts @@ -0,0 +1,40 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'mouse-tab', + template: + ` + +
+
+ `, + styles: + [` + :host { + display: flex; + } + + .mouse-action { + flex: 1; + border-right: 1px solid black; + } + + .details { + flex: 2; + } + `] +}) +export class MouseTabComponent implements OnInit { + constructor() { } + + ngOnInit() { } + +} diff --git a/src/components/popover/tab/none-tab.component.ts b/src/components/popover/tab/none-tab.component.ts new file mode 100644 index 00000000..563919dc --- /dev/null +++ b/src/components/popover/tab/none-tab.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'none-tab', + template: `This key is unassigned and has no functionality.`, + styles: + [` + :host { + display: flex; + justify-content: center; + padding: 2rem 0; + } + `] +}) +export class NoneTabComponent implements OnInit { + constructor() { } + + ngOnInit() { } + +} diff --git a/src/components/popover/capture-keystroke-button.component.ts b/src/components/popover/widgets/capture-keystroke-button.component.ts similarity index 100% rename from src/components/popover/capture-keystroke-button.component.ts rename to src/components/popover/widgets/capture-keystroke-button.component.ts