From 38d61027684787fe1c953b7f8dc553ccbeca908f Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 14 Jun 2022 10:22:16 -0700 Subject: [PATCH] better handle long firmware names (#252) --- src/components/ewt-button.ts | 3 +++ src/install-dialog.ts | 48 +++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/components/ewt-button.ts b/src/components/ewt-button.ts index 7c16f3d..046fe5c 100644 --- a/src/components/ewt-button.ts +++ b/src/components/ewt-button.ts @@ -15,6 +15,9 @@ export class EwtButton extends ButtonBase { .mdc-button { min-width: initial; } + :host([text-left]) .mdc-button__label { + text-align: left; + } `, ]; } diff --git a/src/install-dialog.ts b/src/install-dialog.ts index ec2c0bb..086a024 100644 --- a/src/install-dialog.ts +++ b/src/install-dialog.ts @@ -164,24 +164,23 @@ export class EwtInstallDialog extends LitElement { let allowClosing = true; content = html` - - - - - - - - - -
${firmwareIcon}${this._info!.firmware} ${this._info!.version}
${chipIcon}${this._info!.chipFamily}
+
+ ${firmwareIcon} +
${this._info!.firmware} ${this._info!.version}
+
+
+ ${chipIcon} +
${this._info!.chipFamily}
+
${!this._isSameVersion ? html`
{ if (this._isSameFirmware) { this._startInstall(false); @@ -291,6 +290,7 @@ export class EwtInstallDialog extends LitElement {
{ if (this._manifest.new_install_prompt_erase) { @@ -523,9 +523,7 @@ export class EwtInstallDialog extends LitElement { } _renderInstall(): [string | undefined, TemplateResult, boolean, boolean] { - let heading: string | undefined = `${ - this._installConfirmed ? "Installing" : "Install" - } ${this._manifest!.name}`; + let heading: string | undefined; let content: TemplateResult; let hideActions = false; const allowClosing = false; @@ -545,6 +543,7 @@ export class EwtInstallDialog extends LitElement { > `; } else if (!this._installConfirmed) { + heading = "Confirm Installation"; const action = isUpdate ? "update to" : "install"; content = html` ${isUpdate @@ -552,9 +551,9 @@ export class EwtInstallDialog extends LitElement { ${this._info!.firmware} ${this._info!.version}.

` : ""} Do you want to ${action} - ${this._manifest!.name} ${this._manifest!.version}? + ${this._manifest.name} ${this._manifest.version}? ${this._installErase - ? "All existing data will be erased from your device." + ? html`

All data on the device will be erased.` : ""} `; } else if (this._installState.state === FlashStateType.ERROR) { + heading = "Installation failed"; content = html`