Skip to content

Commit

Permalink
fix long press on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Jan 24, 2025
1 parent 0ce2493 commit 4e8289a
Show file tree
Hide file tree
Showing 17 changed files with 81 additions and 65 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Plugin developers:
- fix plugin config/bridge screens for certain plugins
- add lighting mode option for terminal and log widgets
- only available when the UI is already in light mode
- fix long press on mobile devices

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ <h5>
>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(0)"
[style.opacity]="targetMode === 0 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 0, 'btn-elegant': targetMode !== 0 }"
>
{{ 'accessories.control.off' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(1)"
[style.opacity]="targetMode === 1 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 1, 'btn-elegant': targetMode !== 1 }"
>
{{ 'accessories.control.on' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NgClass } from '@angular/common'
import { Component, inject, Input, OnInit } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
Expand All @@ -17,6 +18,7 @@ import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces'
FormsModule,
NouisliderComponent,
TranslatePipe,
NgClass,
],
})
export class AirpurifierManageComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ <h5>
<div class="btn-group-vertical d-flex justify-content-center mb-4 p-0" role="group" aria-label="Fan Mode Control">
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(false)"
[style.opacity]="!targetMode ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': !targetMode, 'btn-elegant': targetMode }"
>
{{ 'accessories.control.off' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(true)"
[style.opacity]="targetMode ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode, 'btn-elegant': !targetMode }"
>
{{ 'accessories.control.on' | translate }}
</button>
Expand Down
2 changes: 2 additions & 0 deletions ui/src/app/core/accessories/types/fan/fan.manage.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NgClass } from '@angular/common'
import { Component, inject, Input, OnInit } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
Expand All @@ -16,6 +17,7 @@ import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces'
FormsModule,
NouisliderComponent,
TranslatePipe,
NgClass,
],
})
export class FanManageComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ <h5>
<div class="btn-group-vertical d-flex justify-content-center mb-4 p-0" role="group" aria-label="Fan Mode Control">
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(0)"
[style.opacity]="targetMode === 0 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 0, 'btn-elegant': targetMode !== 0 }"
>
{{ 'accessories.control.off' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(1)"
[style.opacity]="targetMode === 1 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 1, 'btn-elegant': targetMode !== 1 }"
>
{{ 'accessories.control.on' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NgClass } from '@angular/common'
import { Component, inject, Input, OnInit } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
Expand All @@ -16,6 +17,7 @@ import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces'
FormsModule,
NouisliderComponent,
TranslatePipe,
NgClass,
],
})
export class Fanv2ManageComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@ <h5 class="modal-title" [innerText]="service.customName || service.serviceName">
>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(0)"
[style.opacity]="targetMode === 0 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 0, 'btn-elegant': targetMode !== 0 }"
>
{{ 'accessories.control.auto' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(1)"
[style.opacity]="targetMode === 1 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 1, 'btn-elegant': targetMode !== 1 }"
>
{{ 'accessories.control.heat' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(2)"
[style.opacity]="targetMode === 2 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 2, 'btn-elegant': targetMode !== 2 }"
>
{{ 'accessories.control.cool' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode('off')"
[style.opacity]="targetMode === 'off' ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 'off', 'btn-elegant': targetMode !== 'off' }"
>
{{ 'accessories.control.off' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@ <h5 class="modal-title" [innerText]="service.customName || service.serviceName">
>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(0)"
[style.opacity]="targetMode === 0 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 0, 'btn-elegant': targetMode !== 0 }"
>
{{ 'accessories.control.auto' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(1)"
[style.opacity]="targetMode === 1 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 1, 'btn-elegant': targetMode !== 1 }"
>
{{ 'accessories.control.humidifying' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(2)"
[style.opacity]="targetMode === 2 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 2, 'btn-elegant': targetMode !== 2 }"
>
{{ 'accessories.control.dehumidifying' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode('off')"
[style.opacity]="targetMode === 'off' ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 'off', 'btn-elegant': targetMode !== 'off' }"
>
{{ 'accessories.control.off' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ <h5>
>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(false)"
[style.opacity]="!targetMode ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': !targetMode, 'btn-elegant': targetMode }"
>
{{ 'accessories.control.off' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(true)"
[style.opacity]="targetMode ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode, 'btn-elegant': !targetMode }"
>
{{ 'accessories.control.on' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NgClass } from '@angular/common'
import { Component, inject, Input, OnInit } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
Expand All @@ -16,6 +17,7 @@ import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces'
FormsModule,
NouisliderComponent,
TranslatePipe,
NgClass,
],
})
export class LightbulbManageComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ <h5 class="modal-title" [innerText]="service.customName || service.serviceName">
>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(0)"
[style.opacity]="targetMode === 0 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 0, 'btn-elegant': targetMode !== 0 }"
>
{{ 'accessories.control.home' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(1)"
[style.opacity]="targetMode === 1 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 1, 'btn-elegant': targetMode !== 1 }"
>
{{ 'accessories.control.away' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(2)"
[style.opacity]="targetMode === 2 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 2, 'btn-elegant': targetMode !== 2 }"
>
{{ 'accessories.control.night' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(3)"
[style.opacity]="targetMode === 3 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 3, 'btn-elegant': targetMode !== 3 }"
>
{{ 'accessories.control.off' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NgClass } from '@angular/common'
import { Component, inject, Input, OnInit } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
Expand All @@ -9,7 +10,7 @@ import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces'
selector: 'app-securitysystem.manage',
templateUrl: './securitysystem.manage.component.html',
standalone: true,
imports: [FormsModule, TranslatePipe],
imports: [FormsModule, TranslatePipe, NgClass],
})
export class SecuritysystemManageComponent implements OnInit {
$activeModal = inject(NgbActiveModal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ <h5>
>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(false)"
[style.opacity]="!targetMode ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': !targetMode, 'btn-elegant': targetMode }"
>
{{ 'accessories.control.not_mute' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(true)"
[style.opacity]="targetMode ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode, 'btn-elegant': !targetMode }"
>
{{ 'accessories.control.mute' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NgClass } from '@angular/common'
import { Component, inject, Input, OnInit } from '@angular/core'
import { FormsModule } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
Expand All @@ -16,6 +17,7 @@ import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces'
FormsModule,
NouisliderComponent,
TranslatePipe,
NgClass,
],
})
export class SpeakerManageComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@ <h5 class="modal-title" [innerText]="service.customName || service.serviceName">
>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(0)"
[style.opacity]="targetMode === 0 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 0, 'btn-elegant': targetMode !== 0 }"
>
{{ 'accessories.control.off' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(1)"
[style.opacity]="targetMode === 1 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 1, 'btn-elegant': targetMode !== 1 }"
>
{{ 'accessories.control.heat' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(2)"
[style.opacity]="targetMode === 2 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 2, 'btn-elegant': targetMode !== 2 }"
>
{{ 'accessories.control.cool' | translate }}
</button>
<button
type="button"
class="btn btn-primary mb-0 mx-0 px-0 py-2"
class="btn mb-0 mx-0 px-0 py-3"
(click)="setTargetMode(3)"
[style.opacity]="targetMode === 3 ? '1' : '0.75'"
[ngClass]="{ 'btn-primary': targetMode === 3, 'btn-elegant': targetMode !== 3 }"
>
{{ 'accessories.control.auto' | translate }}
</button>
Expand Down
Loading

0 comments on commit 4e8289a

Please sign in to comment.