Skip to content

Commit

Permalink
Improve drivers menu layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem committed Dec 11, 2023
1 parent a27485d commit 923cfba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/app/drivers/drivers.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ion-content>
<ion-reorder-group (ionItemReorder)="reorderItems($event)" disabled="false">
<ion-item *ngFor="let driver of drivers; index as id">
<ion-item *ngFor="let driver of drivers; index as id" class="driver">
<ion-button slot="start" size="large" (click)="chooseColor(id)" fill="clear" class="ion-no-padding">
<outline [color]="driver.color">
{{id + 1}}
Expand All @@ -26,8 +26,8 @@
>
</ion-input>
<ion-buttons slot="end">
<ion-note>{{driver.code || '#' + (id + 1)}}</ion-note>
<ion-button fill="clear" (click)="speak(id)">
<ion-note *ngIf="(orientation | async) == 'landscape'">{{driver.code || '#' + (id + 1)}}</ion-note>
<ion-button *ngIf="(orientation | async) == 'landscape'" fill="clear" (click)="speak(id)">
<ion-icon name="volume-high-sharp"></ion-icon>
</ion-button>
<ion-reorder slot="end"></ion-reorder>
Expand Down
8 changes: 7 additions & 1 deletion src/app/drivers/drivers.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { take } from 'rxjs/operators';

import { TranslateService } from '@ngx-translate/core';

import { Observable } from 'rxjs';

import { AppSettings, Driver } from '../app-settings';
import { LoggingService, SpeechService } from '../services';
import { AppService, LoggingService, SpeechService } from '../services';
import { ColorComponent } from './color.component';

@Component({
Expand All @@ -17,15 +19,19 @@ export class DriversPage implements OnDestroy, OnInit {

drivers: Driver[];

orientation: Observable<string>;

readonly placeholder = 'Driver {{number}}';

constructor(
private app: AppService,
private logger: LoggingService,
private settings: AppSettings,
private mc: ModalController,
private speech: SpeechService,
private translate: TranslateService)
{
this.orientation = app.orientation;
}

ngOnInit() {
Expand Down
13 changes: 13 additions & 0 deletions src/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ ion-input.right-align {
}
}

/* drivers menu items */
ion-item.driver {
ion-button {
margin-inline-end: 8px;
}
ion-buttons {
margin-left: 0;
ion-note {
width: 3em;
}
}
}

/* checkered flag blinking in title (only) */
@keyframes blink-checkered-flag {
0% { opacity: 0; }
Expand Down

0 comments on commit 923cfba

Please sign in to comment.