@@ -254,13 +254,9 @@ export class DeviceModeToolbar {
254254 this . elementInternal . classList . add ( 'device-mode-toolbar' ) ;
255255 this . elementInternal . setAttribute ( 'jslog' , `${ VisualLogging . toolbar ( 'device-mode' ) . track ( { resize : true } ) } ` ) ;
256256
257- const leftContainer = this . elementInternal . createChild ( 'div' , 'device-mode-toolbar-spacer' ) ;
258- leftContainer . createChild ( 'div' , 'device-mode-toolbar-spacer' ) ;
259- const leftToolbar = leftContainer . createChild ( 'devtools-toolbar' ) ;
260- this . fillLeftToolbar ( leftToolbar ) ;
257+ const mainToolbar = this . elementInternal . createChild ( 'devtools-toolbar' , 'main-toolbar' ) ;
258+ this . appendDeviceSelectMenu ( mainToolbar ) ;
261259
262- const mainToolbar = this . elementInternal . createChild ( 'devtools-toolbar' ) ;
263- mainToolbar . wrappable = true ;
264260 this . widthInput = new EmulationComponents . DeviceSizeInputElement . SizeInputElement (
265261 i18nString ( UIStrings . width ) , { jslogContext : 'width' } ) ;
266262 this . widthInput . addEventListener ( 'sizechanged' , ( { size : width } ) => {
@@ -279,17 +275,11 @@ export class DeviceModeToolbar {
279275 this . model . setHeight ( height ) ;
280276 }
281277 } ) ;
282- this . fillMainToolbar ( mainToolbar ) ;
283-
284- const rightContainer = this . elementInternal . createChild ( 'div' , 'device-mode-toolbar-spacer' ) ;
285- const rightToolbar = rightContainer . createChild ( 'devtools-toolbar' , 'device-mode-toolbar-fixed-size' ) ;
286- rightToolbar . wrappable = true ;
287- this . fillRightToolbar ( rightToolbar ) ;
288- const modeToolbar = rightContainer . createChild ( 'devtools-toolbar' , 'device-mode-toolbar-fixed-size' ) ;
289- modeToolbar . wrappable = true ;
290- this . fillModeToolbar ( modeToolbar ) ;
291- rightContainer . createChild ( 'div' , 'device-mode-toolbar-spacer' ) ;
292- const optionsToolbar = rightContainer . createChild ( 'devtools-toolbar' , 'device-mode-toolbar-options' ) ;
278+ this . appendDimensionInputs ( mainToolbar ) ;
279+
280+ this . appendDisplaySettings ( mainToolbar ) ;
281+ this . appendDevicePositionItems ( mainToolbar ) ;
282+ const optionsToolbar = this . elementInternal . createChild ( 'devtools-toolbar' , 'device-mode-toolbar-options' ) ;
293283 optionsToolbar . wrappable = true ;
294284 this . fillOptionsToolbar ( optionsToolbar ) ;
295285
@@ -307,10 +297,7 @@ export class DeviceModeToolbar {
307297
308298 function updateToolbarsEnabled ( ) : void {
309299 const enabled = model . toolbarControlsEnabledSetting ( ) . get ( ) ;
310- leftToolbar . setEnabled ( enabled ) ;
311300 mainToolbar . setEnabled ( enabled ) ;
312- rightToolbar . setEnabled ( enabled ) ;
313- modeToolbar . setEnabled ( enabled ) ;
314301 optionsToolbar . setEnabled ( enabled ) ;
315302 }
316303 }
@@ -321,7 +308,7 @@ export class DeviceModeToolbar {
321308 return element ;
322309 }
323310
324- private fillLeftToolbar ( toolbar : UI . Toolbar . Toolbar ) : void {
311+ private appendDeviceSelectMenu ( toolbar : UI . Toolbar . Toolbar ) : void {
325312 toolbar . appendToolbarItem ( this . wrapToolbarItem ( this . createEmptyToolbarElement ( ) ) ) ;
326313 this . deviceSelectItem =
327314 new UI . Toolbar . ToolbarMenuButton ( this . appendDeviceMenuItems . bind ( this ) , undefined , undefined , 'device' ) ;
@@ -330,7 +317,7 @@ export class DeviceModeToolbar {
330317 toolbar . appendToolbarItem ( this . deviceSelectItem ) ;
331318 }
332319
333- private fillMainToolbar ( toolbar : UI . Toolbar . Toolbar ) : void {
320+ private appendDimensionInputs ( toolbar : UI . Toolbar . Toolbar ) : void {
334321 toolbar . appendToolbarItem ( new UI . Toolbar . ToolbarItem ( this . widthInput ) ) ;
335322
336323 const xElement = document . createElement ( 'div' ) ;
@@ -342,18 +329,20 @@ export class DeviceModeToolbar {
342329 toolbar . appendToolbarItem ( new UI . Toolbar . ToolbarItem ( this . heightInput ) ) ;
343330 }
344331
345- private fillRightToolbar ( toolbar : UI . Toolbar . Toolbar ) : void {
332+ private appendDisplaySettings ( toolbar : UI . Toolbar . Toolbar ) : void {
346333 toolbar . appendToolbarItem ( this . wrapToolbarItem ( this . createEmptyToolbarElement ( ) ) ) ;
347334 this . scaleItem =
348335 new UI . Toolbar . ToolbarMenuButton ( this . appendScaleMenuItems . bind ( this ) , undefined , undefined , 'scale' ) ;
349336 setTitleForButton ( this . scaleItem , i18nString ( UIStrings . zoom ) ) ;
337+ this . scaleItem . turnShrinkable ( ) ;
350338 this . scaleItem . setDarkText ( ) ;
351339 toolbar . appendToolbarItem ( this . scaleItem ) ;
352340
353341 toolbar . appendToolbarItem ( this . wrapToolbarItem ( this . createEmptyToolbarElement ( ) ) ) ;
354342
355343 this . deviceScaleItem = new UI . Toolbar . ToolbarMenuButton (
356344 this . appendDeviceScaleMenuItems . bind ( this ) , undefined , undefined , 'device-pixel-ratio' ) ;
345+ this . deviceScaleItem . turnShrinkable ( ) ;
357346 this . deviceScaleItem . setVisible ( this . showDeviceScaleFactorSetting . get ( ) ) ;
358347 setTitleForButton ( this . deviceScaleItem , i18nString ( UIStrings . devicePixelRatio ) ) ;
359348 this . deviceScaleItem . setDarkText ( ) ;
@@ -362,17 +351,19 @@ export class DeviceModeToolbar {
362351 toolbar . appendToolbarItem ( this . wrapToolbarItem ( this . createEmptyToolbarElement ( ) ) ) ;
363352 this . uaItem =
364353 new UI . Toolbar . ToolbarMenuButton ( this . appendUserAgentMenuItems . bind ( this ) , undefined , undefined , 'device-type' ) ;
354+ this . uaItem . turnShrinkable ( ) ;
365355 this . uaItem . setVisible ( this . showUserAgentTypeSetting . get ( ) ) ;
366356 setTitleForButton ( this . uaItem , i18nString ( UIStrings . deviceType ) ) ;
367357 this . uaItem . setDarkText ( ) ;
368358 toolbar . appendToolbarItem ( this . uaItem ) ;
369359
370360 this . throttlingConditionsItem =
371361 MobileThrottling . ThrottlingManager . throttlingManager ( ) . createMobileThrottlingButton ( ) ;
362+ this . throttlingConditionsItem . turnShrinkable ( ) ;
372363 toolbar . appendToolbarItem ( this . throttlingConditionsItem ) ;
373364 }
374365
375- private fillModeToolbar ( toolbar : UI . Toolbar . Toolbar ) : void {
366+ private appendDevicePositionItems ( toolbar : UI . Toolbar . Toolbar ) : void {
376367 toolbar . appendToolbarItem ( this . wrapToolbarItem ( this . createEmptyToolbarElement ( ) ) ) ;
377368 this . modeButton = new UI . Toolbar . ToolbarButton ( '' , 'screen-rotation' , undefined , 'screen-rotation' ) ;
378369 this . modeButton . addEventListener ( UI . Toolbar . ToolbarButton . Events . CLICK , this . modeMenuClicked , this ) ;
@@ -387,6 +378,7 @@ export class DeviceModeToolbar {
387378 toolbar . appendToolbarItem ( this . wrapToolbarItem ( this . createEmptyToolbarElement ( ) ) ) ;
388379 this . postureItem = new UI . Toolbar . ToolbarMenuButton (
389380 this . appendDevicePostureItems . bind ( this ) , undefined , undefined , 'device-posture' ) ;
381+ this . postureItem . turnShrinkable ( ) ;
390382 this . postureItem . setDarkText ( ) ;
391383 setTitleForButton ( this . postureItem , i18nString ( UIStrings . devicePosture ) ) ;
392384 toolbar . appendToolbarItem ( this . postureItem ) ;
0 commit comments