@@ -13,7 +13,7 @@ import {MatSidenavModule} from '@angular/material/sidenav';
13
13
import { MatListModule } from '@angular/material/list' ;
14
14
import { MatButtonModule } from '@angular/material/button' ;
15
15
import { RouterModule } from '@angular/router' ;
16
- import { MatIconModule } from '@angular/material/icon' ;
16
+ import { MatIconModule , MatIconRegistry } from '@angular/material/icon' ;
17
17
import { MatToolbarModule } from '@angular/material/toolbar' ;
18
18
import { MatTooltipModule } from '@angular/material/tooltip' ;
19
19
import { DevAppDirectionality } from './dev-app-directionality' ;
@@ -110,12 +110,14 @@ export class DevAppLayout {
110
110
@Inject ( Directionality ) private _dir : DevAppDirectionality ,
111
111
private _changeDetectorRef : ChangeDetectorRef ,
112
112
@Inject ( DOCUMENT ) private _document : Document ,
113
+ private _iconRegistry : MatIconRegistry ,
113
114
) {
114
115
this . toggleTheme ( this . state . darkTheme ) ;
115
116
this . toggleStrongFocus ( this . state . strongFocusEnabled ) ;
116
117
this . toggleDensity ( Math . max ( this . _densityScales . indexOf ( this . state . density ) , 0 ) ) ;
117
118
this . toggleRippleDisabled ( this . state . rippleDisabled ) ;
118
119
this . toggleDirection ( this . state . direction ) ;
120
+ this . toggleM3 ( this . state . m3Enabled ) ;
119
121
}
120
122
121
123
toggleTheme ( value = ! this . state . darkTheme ) {
@@ -168,9 +170,13 @@ export class DevAppLayout {
168
170
( document . getElementById ( 'theme-styles' ) as HTMLLinkElement ) . href = value
169
171
? 'theme-m3.css'
170
172
: 'theme.css' ;
171
- this . state . m3Enabled = value ;
172
- setAppState ( this . state ) ;
173
173
}
174
+
175
+ this . _iconRegistry . setDefaultFontSetClass (
176
+ value ? 'material-symbols-outlined' : 'material-icons' ,
177
+ ) ;
178
+ this . state . m3Enabled = value ;
179
+ setAppState ( this . state ) ;
174
180
}
175
181
176
182
getDensityClass ( ) {
0 commit comments