Skip to content

Commit b7b99de

Browse files
ert78gbmondalaci
andauthored
feat: change position of module config icon (#2209)
* feat: change position of module config icon * Adjust the positions of module configuration circle buttons. --------- Co-authored-by: László Monda <[email protected]>
1 parent c6abe45 commit b7b99de

File tree

20 files changed

+60
-53
lines changed

20 files changed

+60
-53
lines changed

packages/uhk-common/src/config-serializer/config-items/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ export * from './module-configuration.js';
2121
export * from './mouse-speed-configuration.js';
2222
export * from './rgb-color.js';
2323
export * from './svg-keyboard-cover-colors.js';
24+
export * from './uhk-theme-colors.js';
2425
export * from './user-configuration.js';

packages/uhk-common/src/config-serializer/config-items/layer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { assertEnum } from '../assert.js';
44
import { Macro } from './macro.js';
55
import { Module } from './module.js';
66
import { SerialisationInfo } from './serialisation-info.js';
7-
import { SvgKeyboardCoverColors } from './svg-keyboard-cover-colors.js';
7+
import { UhkThemeColors } from './uhk-theme-colors.js';
88
import { UserConfiguration } from './user-configuration.js';
99
import { LayerName } from './layer-name.js';
1010

@@ -14,15 +14,15 @@ export class Layer {
1414

1515
modules: Module[];
1616

17-
svgKeyboardCoverColors: SvgKeyboardCoverColors;
17+
uhkThemeColors: UhkThemeColors;
1818

1919
constructor(layers?: Layer) {
2020
if (!layers) {
2121
return;
2222
}
2323
this.id = layers.id;
2424
this.modules = layers.modules.map(module => new Module(module));
25-
this.svgKeyboardCoverColors = layers.svgKeyboardCoverColors;
25+
this.uhkThemeColors = layers.uhkThemeColors;
2626
}
2727

2828
fromJsonObject(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): Layer {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { SvgKeyboardCoverColors } from './svg-keyboard-cover-colors.js';
2+
3+
export interface UhkThemeColors {
4+
backgroundColor: string;
5+
svgKeyboardCoverColors: SvgKeyboardCoverColors;
6+
}

packages/uhk-web/src/app/components/keyboard/slider/keyboard-slider.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[keyboardLayout]="keyboardLayout"
1111
[description]="description"
1212
[showDescription]="true"
13-
[svgKeyboardCoverColors]="aLayer.svgKeyboardCoverColors"
13+
[uhkThemeColors]="aLayer.uhkThemeColors"
1414
[lastEditedKey]="lastEditedKey"
1515
oncontextmenu="return false;"
1616
(keyClick)="keyClick.emit($event)"
@@ -34,7 +34,7 @@
3434
[keyboardLayout]="keyboardLayout"
3535
[description]="description"
3636
[showDescription]="true"
37-
[svgKeyboardCoverColors]="bLayer.svgKeyboardCoverColors"
37+
[uhkThemeColors]="bLayer.uhkThemeColors"
3838
[lastEditedKey]="lastEditedKey"
3939
oncontextmenu="return false;"
4040
(keyClick)="keyClick.emit($event)"

packages/uhk-web/src/app/components/popover/popover.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
[defaultKeyAction]="defaultKeyAction"
5050
[keymaps]="keymaps$ | async"
5151
[keymapOptions]="keymapOptions$ | async"
52-
[svgKeyboardCoverColors]="svgKeyboardCoverColors$ | async"
52+
[uhkThemeColors]="uhkThemeColors$ | async"
5353
(validAction)="setKeyActionValidState($event)"
5454
></keymap-tab>
5555
<none-tab #tab *ngSwitchCase="tabName.None" class="popover-content"

packages/uhk-web/src/app/components/popover/popover.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
MouseAction,
2525
PlayMacroAction,
2626
SecondaryRoleAction,
27-
SvgKeyboardCoverColors,
27+
UhkThemeColors,
2828
SwitchKeymapAction,
2929
SwitchLayerAction
3030
} from 'uhk-common';
@@ -37,7 +37,7 @@ import {
3737
getKeymapOptions,
3838
getKeymaps,
3939
getLayerOptions,
40-
getSvgKeyboardCoverColorsOfTheme,
40+
getUhkThemeColors,
4141
macroPlaybackSupported
4242
} from '../../store';
4343
import { KeyActionRemap } from '../../models/key-action-remap';
@@ -87,7 +87,7 @@ export class PopoverComponent implements OnChanges {
8787
tabName = TabName;
8888
keyActionValid: boolean;
8989
activeTab: TabName;
90-
svgKeyboardCoverColors$: Observable<SvgKeyboardCoverColors>;
90+
uhkThemeColors$: Observable<UhkThemeColors>;
9191
keymaps$: Observable<Keymap[]>;
9292
keymapOptions$: Observable<SelectOptionData[]>;
9393
shadowKeyAction: KeyAction;
@@ -130,7 +130,7 @@ export class PopoverComponent implements OnChanges {
130130

131131
constructor(private store: Store<AppState>,
132132
private cdRef: ChangeDetectorRef) {
133-
this.svgKeyboardCoverColors$ = store.select(getSvgKeyboardCoverColorsOfTheme);
133+
this.uhkThemeColors$ = store.select(getUhkThemeColors);
134134
this.keymaps$ = store.select(getKeymaps);
135135
this.keymapOptions$ = store.select(getKeymapOptions);
136136
this.macroPlaybackSupported$ = store.select(macroPlaybackSupported);

packages/uhk-web/src/app/components/popover/tab/keymap/keymap-tab.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<svg-keyboard *ngIf="selectedKeymap?.abbreviation"
3535
[moduleConfig]="selectedKeymap.layers[0].modules"
3636
[embedded]="true"
37-
[svgKeyboardCoverColors]="svgKeyboardCoverColors"
37+
[uhkThemeColors]="uhkThemeColors"
3838
>
3939
</svg-keyboard>
4040
</div>

packages/uhk-web/src/app/components/popover/tab/keymap/keymap-tab.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core';
2-
import { copyRgbColor, Keymap, KeyAction, SvgKeyboardCoverColors, SwitchKeymapAction } from 'uhk-common';
2+
import { copyRgbColor, Keymap, KeyAction, UhkThemeColors, SwitchKeymapAction } from 'uhk-common';
33

44
import { Tab } from '../tab';
55
import { SelectOptionData } from '../../../../models/select-option-data';
@@ -14,7 +14,7 @@ export class KeymapTabComponent extends Tab implements OnChanges {
1414
@Input() defaultKeyAction: KeyAction;
1515
@Input() keymaps: Keymap[];
1616
@Input() keymapOptions: SelectOptionData[];
17-
@Input() svgKeyboardCoverColors: SvgKeyboardCoverColors;
17+
@Input() uhkThemeColors: UhkThemeColors;
1818

1919
selectedKeymap: Keymap;
2020

packages/uhk-web/src/app/components/svg/keyboard/svg-keyboard.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
[selectedKey]="selectedKey"
2020
[@fadeKeyboard]="{value:'', params: { animationTime: modulesState[module.id].animationTime } }"
2121
[selected]="selectedKey?.moduleId === module.id"
22-
[svgKeyboardCoverColors]="svgKeyboardCoverColors"
22+
[uhkThemeColors]="uhkThemeColors"
2323
[lastEdited]="lastEditedKey?.moduleId === module.id"
2424
[lastEditedKeyId]="lastEditedKey?.key"
2525
(keyClick)="onKeyClick(module.id, $event)"

packages/uhk-web/src/app/components/svg/keyboard/svg-keyboard.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
LeftSlotModules,
2121
Module,
2222
RightSlotModules,
23-
SvgKeyboardCoverColors
23+
UhkThemeColors,
2424
} from 'uhk-common';
2525

2626
import { SvgModule } from '../module';
@@ -99,7 +99,7 @@ export class SvgKeyboardComponent implements AfterViewInit, OnInit, OnChanges {
9999
@Input() keyboardLayout = KeyboardLayout.ANSI;
100100
@Input() description: string;
101101
@Input() showDescription = false;
102-
@Input() svgKeyboardCoverColors: SvgKeyboardCoverColors;
102+
@Input() uhkThemeColors: UhkThemeColors;
103103
@Input() lastEditedKey: LastEditedKey;
104104
@Input() embedded = false;
105105
@Output() keyClick = new EventEmitter<SvgKeyboardKeyClickEvent>();

0 commit comments

Comments
 (0)