Browse Source

shows h scroll only if needed (#28491)

ycw 1 year ago
parent
commit
55cc12459f
2 changed files with 11 additions and 5 deletions
  1. 0 4
      editor/css/main.css
  2. 11 1
      editor/js/Sidebar.js

+ 0 - 4
editor/css/main.css

@@ -101,10 +101,6 @@ textarea, input { outline: none; } /* osx */
 		text-transform: uppercase;
 	}
 
-	.TabbedPanel .Tabs .Tab:last-child {
-		margin-right: 22px;
-	}
-
 	.TabbedPanel .Panels {
 		position: absolute;
 		top: 40px;

+ 11 - 1
editor/js/Sidebar.js

@@ -12,9 +12,11 @@ function Sidebar( editor ) {
 	const container = new UITabbedPanel();
 	container.setId( 'sidebar' );
 
+	const sidebarProperties = new SidebarProperties( editor );
+
 	const scene = new UISpan().add(
 		new SidebarScene( editor ),
-		new SidebarProperties( editor )
+		sidebarProperties
 	);
 	const project = new SidebarProject( editor );
 	const settings = new SidebarSettings( editor );
@@ -24,6 +26,14 @@ function Sidebar( editor ) {
 	container.addTab( 'settings', strings.getKey( 'sidebar/settings' ), settings );
 	container.select( 'scene' );
 
+	const sidebarPropertiesResizeObserver = new ResizeObserver( function () {
+
+		sidebarProperties.tabsDiv.setWidth( getComputedStyle( container.dom ).width );
+
+	} );
+
+	sidebarPropertiesResizeObserver.observe( container.tabsDiv.dom );
+
 	return container;
 
 }