Skip to content

Commit bbe4e85

Browse files
committed
build: change icons in dev app based on state (#28188)
Minor UX improvement to the dev app that makes it so the icons in the toolbar change depending on the state. This makes it easier to tell when the value has changed. (cherry picked from commit 950f1b7)
1 parent 950ca90 commit bbe4e85

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

src/dev-app/dev-app/dev-app-layout.html

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,37 +55,61 @@ <h1>Angular Material Demos</h1>
5555
mat-icon-button
5656
(click)="toggleM3()"
5757
[matTooltip]="state.m3Enabled ? 'Use M2 theme' : 'Use M3 theme'">
58-
<mat-icon>brush</mat-icon>
58+
@if (state.m3Enabled) {
59+
<mat-icon>invert_colors_off</mat-icon>
60+
} @else {
61+
<mat-icon>invert_colors</mat-icon>
62+
}
5963
</button>
6064
<button
6165
mat-icon-button
6266
(click)="toggleAnimations()"
6367
[matTooltip]="state.animations ? 'Disable animations' : 'Enable animations'">
64-
<mat-icon>animation</mat-icon>
68+
@if (state.animations) {
69+
<mat-icon>pause_circle</mat-icon>
70+
} @else {
71+
<mat-icon>animation</mat-icon>
72+
}
6573
</button>
6674
<button
6775
mat-icon-button
6876
(click)="toggleTheme()"
6977
[matTooltip]="state.darkTheme ? 'Switch to light theme' : 'Switch to dark theme'">
70-
<mat-icon>dark_mode</mat-icon>
78+
@if (state.darkTheme) {
79+
<mat-icon>light_mode</mat-icon>
80+
} @else {
81+
<mat-icon>dark_mode</mat-icon>
82+
}
7183
</button>
7284
<button
7385
mat-icon-button
7486
(click)="toggleRippleDisabled()"
7587
[matTooltip]="state.rippleDisabled ? 'Enable ripples' : 'Disable ripples'">
76-
<mat-icon>waves</mat-icon>
88+
@if (state.rippleDisabled) {
89+
<mat-icon>waves</mat-icon>
90+
} @else {
91+
<mat-icon>water</mat-icon>
92+
}
7793
</button>
7894
<button
7995
mat-icon-button
8096
(click)="toggleStrongFocus()"
8197
[matTooltip]="state.strongFocusEnabled ? 'Disable strong focus' : 'Enable strong focus'">
82-
<mat-icon>accessibility</mat-icon>
98+
@if (state.strongFocusEnabled) {
99+
<mat-icon>not_accessible</mat-icon>
100+
} @else {
101+
<mat-icon>accessibility</mat-icon>
102+
}
83103
</button>
84104
<button
85105
mat-icon-button
86106
(click)="toggleDirection()"
87107
[matTooltip]="state.direction === 'rtl' ? 'Switch to LTR' : 'Switch to RTL'">
88-
<mat-icon>keyboard_tab_rtl</mat-icon>
108+
@if (state.direction === 'rtl') {
109+
<mat-icon>west</mat-icon>
110+
} @else {
111+
<mat-icon>east</mat-icon>
112+
}
89113
</button>
90114
<button
91115
mat-icon-button

0 commit comments

Comments
 (0)