Selaa lähdekoodia

Skinning work

Josh Engebretson 10 vuotta sitten
vanhempi
sitoutus
53ed3dd644

+ 10 - 0
Data/AtomicEditor/Resources/EditorData/AtomicEditor/editor/skin/skin.tb.txt

@@ -133,3 +133,13 @@ elements
 	TextCode
 		background-color #23241f
 
+	InspectorTopLayout
+		background-color #333333
+
+	InspectorVectorAttrLayout
+		background-color #3a3a3a
+
+	InspectorTextAttrName
+		text-color #aaaaaa
+		min-width 140
+		max-width 140

BIN
Data/AtomicEditor/Resources/EditorData/AtomicEditor/resources/default_skin/arrow_left_dark.png


BIN
Data/AtomicEditor/Resources/EditorData/AtomicEditor/resources/default_skin/arrow_right_dark.png


BIN
Data/AtomicEditor/Resources/EditorData/AtomicEditor/resources/default_skin/checkbox_mark_grey.png


+ 20 - 1
Data/AtomicEditor/Resources/EditorData/AtomicEditor/resources/default_skin/skin.tb.txt

@@ -269,7 +269,7 @@ elements
 	TBEditField.selection
 		cut 2
 		bitmap selection.png
-	TBEditField
+	TBEditField		
 		bitmap editfield.png
 		cut 12
 		expand 4
@@ -290,6 +290,11 @@ elements
 		img-position-x 0
 		img-ofs-x 5
 
+	TBAttrEditorField
+		clone TBEditField
+		text-color #aaaaaa
+
+
 	# == TBWindow skin =================================================================================
 	TBWindow
 		bitmap window.png
@@ -358,6 +363,18 @@ elements
 	TBCheckBox.pressed
 		bitmap checkbox_pressed.png
 		type Image
+
+	TBGreyCheckBox
+		clone TBCheckBox
+		children
+			element TBGreyCheckBox.selected
+				state selected
+
+	TBGreyCheckBox.selected
+		bitmap checkbox_mark_grey.png
+		expand 7
+		type Image
+
 	TBRadioButton
 		bitmap radio.png
 		cut 19
@@ -479,6 +496,8 @@ elements
 
 	arrow.left: type: Image, bitmap: arrow_left.png, min-width: 5, min-height: 10
 	arrow.right: type: Image, bitmap: arrow_right.png, min-width: 5, min-height: 10
+	arrowdark.left: type: Image, bitmap: arrow_left_dark.png, min-width: 5, min-height: 10
+	arrowdark.right: type: Image, bitmap: arrow_right_dark.png, min-width: 5, min-height: 10	
 	arrow.up: type: Image, bitmap: arrow_up.png, min-width: 10, min-height: 5
 	arrow.down: type: Image, bitmap: arrow_down.png, min-width: 10, min-height: 5
 	generic_focus

+ 10 - 1
Source/AtomicEditor/Source/UI/UIInspectorDataBinding.cpp

@@ -265,19 +265,26 @@ InspectorDataBinding* InspectorDataBinding::Create(Serializable* object, const A
     if (attrInfo->type_ == VAR_BOOL)
     {
         TBCheckBox* box = new TBCheckBox();
+        box->SetSkinBg(TBIDC("TBGreyCheckBox"));
         widget = box;
     }
     else if (attrInfo->type_ == VAR_STRING)
     {
         TBEditField* field = new TBEditField();
-        field->SetTextAlign(TB_TEXT_ALIGN_CENTER);
+        field->SetTextAlign(TB_TEXT_ALIGN_LEFT);
+        field->SetSkinBg(TBIDC("TBAttrEditorField"));
         field->SetFontDescription(fd);
+        LayoutParams lp;
+        lp.SetWidth(140);
+        field->SetLayoutParams(lp);
+
         widget = field;
     }
     else if (attrInfo->type_ == VAR_FLOAT)
     {
         TBEditField* field = new TBEditField();
         field->SetTextAlign(TB_TEXT_ALIGN_CENTER);
+        field->SetSkinBg(TBIDC("TBAttrEditorField"));
         field->SetFontDescription(fd);
         widget = field;
     }
@@ -314,6 +321,7 @@ InspectorDataBinding* InspectorDataBinding::Create(Serializable* object, const A
             TBEditField* field = new TBEditField();
             field->SetTextAlign(TB_TEXT_ALIGN_CENTER);
             field->SetFontDescription(fd);
+            field->SetSkinBg(TBIDC("TBAttrEditorField"));
             widget = field;
         }
     }
@@ -331,6 +339,7 @@ InspectorDataBinding* InspectorDataBinding::Create(Serializable* object, const A
             TBInlineSelect* select = new TBInlineSelect();
             select->SetID(TBID(i + 1));
             select->SetFontDescription(fd);
+            select->SetSkinBg(TBIDC("InspectorTextAttrName"));
             select->SetLimits(-10000000, 10000000);
             select->SetLayoutParams(lp);
             layout->AddChild(select);

+ 24 - 0
Source/AtomicEditor/Source/UI/UIInspectorFrame.cpp

@@ -94,6 +94,8 @@ void InspectorFrame::InspectNode(Node* node)
         TBContainer* nodeContainer = new TBContainer();
         nodeContainer->SetGravity(WIDGET_GRAVITY_ALL);
 
+        nodeContainer->SetSkinBg("InspectorTopLayout");
+
         TBLayout* attrsVerticalLayout = new TBLayout(AXIS_Y);
         attrsVerticalLayout->SetGravity(WIDGET_GRAVITY_ALL);
         attrsVerticalLayout->SetLayoutPosition(LAYOUT_POSITION_LEFT_TOP);
@@ -113,8 +115,18 @@ void InspectorFrame::InspectNode(Node* node)
 
                 TBLayout* attrLayout = new TBLayout();
 
+                if (attr->type_ == VAR_VECTOR3 || attr->type_ == VAR_COLOR || attr->type_ == VAR_QUATERNION)
+                {
+                    attrLayout->SetAxis(AXIS_Y);
+                    attrLayout->SetLayoutPosition(LAYOUT_POSITION_LEFT_TOP);
+                    attrLayout->SetSkinBg("InspectorVectorAttrLayout");
+                }
+
                 attrLayout->SetLayoutDistribution(LAYOUT_DISTRIBUTION_GRAVITY);
+
                 TBTextField* name = new TBTextField();
+                name->SetTextAlign(TB_TEXT_ALIGN_LEFT);
+                name->SetSkinBg(TBIDC("InspectorTextAttrName"));
 
                 String bname = attr->name_;
                 if (bname == "Is Enabled")
@@ -140,6 +152,9 @@ void InspectorFrame::InspectNode(Node* node)
             Component* c = components[i];
 
             TBContainer* componentContainer = new TBContainer();
+
+            componentContainer->SetSkinBg("InspectorTopLayout");
+
             componentContainer->SetGravity(WIDGET_GRAVITY_ALL);
 
             TBLayout* attrsVerticalLayout = new TBLayout(AXIS_Y);
@@ -170,6 +185,13 @@ void InspectorFrame::InspectNode(Node* node)
 
                         attrLayout->SetLayoutDistribution(LAYOUT_DISTRIBUTION_GRAVITY);
 
+                        if (attr->type_ == VAR_VECTOR3 || attr->type_ == VAR_COLOR || attr->type_ == VAR_QUATERNION)
+                        {
+                            attrLayout->SetAxis(AXIS_Y);
+                            attrLayout->SetLayoutPosition(LAYOUT_POSITION_LEFT_TOP);
+                            attrLayout->SetSkinBg("InspectorVectorAttrLayout");
+                        }
+
                         TBTextField* name = new TBTextField();
                         String bname = attr->name_;
                         if (bname == "Is Enabled")
@@ -179,6 +201,8 @@ void InspectorFrame::InspectNode(Node* node)
                         name->SetText(bname.CString());
                         name->SetFontDescription(fd);
 
+                        name->SetSkinBg(TBIDC("InspectorTextAttrName"));
+
                         LayoutParams lp;
                         lp.SetWidth(140);
                         name->SetLayoutParams(lp);

+ 2 - 2
Source/ThirdParty/TurboBadger/tb_inline_select.cpp

@@ -29,8 +29,8 @@ TBInlineSelect::TBInlineSelect()
 	m_layout.SetSpacing(0);
 	m_buttons[0].SetSkinBg(TBIDC("TBButton.flat"));
 	m_buttons[1].SetSkinBg(TBIDC("TBButton.flat"));
-	m_buttons[0].GetContentRoot()->AddChild(new TBSkinImage(TBIDC("arrow.left")));
-	m_buttons[1].GetContentRoot()->AddChild(new TBSkinImage(TBIDC("arrow.right")));
+    m_buttons[0].GetContentRoot()->AddChild(new TBSkinImage(TBIDC("arrowdark.left")));
+    m_buttons[1].GetContentRoot()->AddChild(new TBSkinImage(TBIDC("arrowdark.right")));
 	m_buttons[0].SetIsFocusable(false);
 	m_buttons[1].SetIsFocusable(false);
 	m_buttons[0].SetID(TBIDC("dec"));