Browse Source

Added modal window title bar and added a slight fix for menu bar

BearishSun 10 years ago
parent
commit
808233c114

+ 1 - 0
BansheeEditor/Include/BsBuiltinEditorResources.h

@@ -214,6 +214,7 @@ namespace BansheeEngine
 		static const WString WindowFrameFocused;
 
 		static const WString TabBarBackgroundTex;
+		static const WString TitleBarBackgroundTex;
 
 		static const WString CloseButtonNormalTex;
 		static const WString CloseButtonHoverTex;

+ 15 - 6
BansheeEditor/Source/BsBuiltinEditorResources.cpp

@@ -161,6 +161,7 @@ namespace BansheeEngine
 	const WString BuiltinEditorResources::MaxButtonActiveTex = L"MaximizeButtonActive.png";
 
 	const WString BuiltinEditorResources::TabBarBackgroundTex = L"TabBarBackground.png";
+	const WString BuiltinEditorResources::TitleBarBackgroundTex = L"TitleBarBackground.png";
 
 	const WString BuiltinEditorResources::TabButtonNormalTex = L"TabButtonNormal.png";
 	const WString BuiltinEditorResources::TabButtonFocusedTex = L"TabButtonFocused.png";
@@ -528,13 +529,13 @@ namespace BansheeEngine
 
 		skin->setStyle("WindowBackground", windowBgStyle);
 
-		// Window title bar background
-		GUIElementStyle titleBarBgStyle;
-		titleBarBgStyle.normal.texture = getGUITexture(TabBarBackgroundTex);
-		titleBarBgStyle.fixedHeight = true;
-		titleBarBgStyle.height = 16;
+		// Window tab bar background
+		GUIElementStyle tabBarBgStyle;
+		tabBarBgStyle.normal.texture = getGUITexture(TabBarBackgroundTex);
+		tabBarBgStyle.fixedHeight = true;
+		tabBarBgStyle.height = 16;
 
-		skin->setStyle("TitleBarBackground", titleBarBgStyle);
+		skin->setStyle("TabBarBackground", tabBarBgStyle);
 
 		// Tabbed title bar tab button
 		GUIElementStyle tabbedBarButton;
@@ -577,6 +578,14 @@ namespace BansheeEngine
 
 		skin->setStyle("TabbedBarDropArea", tabbedBarDropButton);
 
+		// Window title bar background
+		GUIElementStyle titleBarBgStyle;
+		titleBarBgStyle.normal.texture = getGUITexture(TitleBarBackgroundTex);
+		titleBarBgStyle.fixedHeight = true;
+		titleBarBgStyle.height = 17;
+
+		skin->setStyle("TitleBarBackground", titleBarBgStyle);
+
 		// Window minimize button
 		GUIElementStyle winMinButtonStyle;
 		winMinButtonStyle.normal.texture = getGUITexture(MinButtonNormalTex);

+ 2 - 5
BansheeEditor/Source/BsGUIMenuBar.cpp

@@ -69,10 +69,6 @@ namespace BansheeEngine
 		mMainPanel->setWidth(1);
 		mMainPanel->setHeight(50);
 
-		mMainPanel = parent->getPanel()->addNewElement<GUIPanel>(std::numeric_limits<INT16>::min() + 15);
-		mMainPanel->setWidth(1);
-		mMainPanel->setHeight(50);
-
 		mBgPanel = parent->getPanel()->addNewElement<GUIPanel>(std::numeric_limits<INT16>::min() + 25);
 		mBgPanel->setWidth(1);
 		mBgPanel->setHeight(50);
@@ -97,7 +93,8 @@ namespace BansheeEngine
 		mMenuItemLayout = mainLayoutVert->addNewElement<GUILayoutX>();
 		mainLayoutVert->addElement(mSplitterLine);
 		mToolBarLayout = mainLayoutVert->addNewElement<GUILayoutX>();
-		
+		mainLayoutVert->addNewElement<GUIFlexibleSpace>();
+
 		mMenuItemLayout->addNewElement<GUIFlexibleSpace>();
 		mMenuItemLayout->addNewElement<GUIFixedSpace>(3);
 		mMenuItemLayout->addElement(mMinBtn);

+ 1 - 1
BansheeEditor/Source/BsGUITabbedTitleBar.cpp

@@ -31,7 +31,7 @@ namespace BansheeEngine
 		mTempDraggedTabIdx(0)
 	{
 		if(mBackgroundStyle == StringUtil::BLANK)
-			mBackgroundStyle = "TitleBarBackground";
+			mBackgroundStyle = "TabBarBackground";
 
 		if(mMaximizeBtnStyle == StringUtil::BLANK)
 			mMaximizeBtnStyle = "WinMaximizeBtn";