Browse Source

Added "extends" support to themes.

Mark Sibly 9 năm trước cách đây
mục cha
commit
db320f344b

+ 43 - 11
modules/mojo/app/theme.monkey2

@@ -171,20 +171,11 @@ Class Theme
 	
 	Method Load:Bool( path:String,scale:Vec2f=New Vec2f( 1 ) )
 	
-		If Not ExtractRootDir( path ) path="theme::"+path
-		
-		If Not ExtractExt( path ) path+=".json"
-	
-		Local jobj:=JsonObject.Load( path )
-		If Not jobj
+		If Not LoadJson( path )
 			Print "Failed to load theme:"+path
 			return False
 		Endif
-		
-		_jcolors=jobj["colors"].ToObject()
-		_jfonts=jobj["fonts"].ToObject()
-		_jstyles=jobj["styles"].ToObject()
-		
+
 		_themeScale=scale
 		
 		Reload()
@@ -216,6 +207,47 @@ Class Theme
 	Field _styles:=New StringMap<Style>
 	Field _cstyles:=New StringMap<Style>
 	
+	Method LoadJson:Bool( path:String )
+
+		If Not ExtractRootDir( path ) path="theme::"+path
+		
+		If Not ExtractExt( path ) path+=".json"
+	
+		Local jobj:=JsonObject.Load( path )
+		If Not jobj Return False
+		
+		If jobj.Contains( "extends" ) 
+
+			If Not LoadJson( jobj.GetString( "extends" ) ) Return False
+			
+			If jobj.Contains( "colors" )
+				For Local it:=Eachin jobj["colors"].ToObject()
+					_jcolors[it.Key]=it.Value
+				Next
+			Endif
+			
+			If jobj.Contains( "fonts" )
+				For Local it:=Eachin jobj["fonts"].ToObject()
+					_jfonts[it.Key]=it.Value
+				Next
+			Endif
+			
+			If jobj.Contains( "styles" )
+				For Local it:=Eachin jobj["styles"].ToObject()
+					_jstyles[it.Key]=it.Value
+				Next
+			Endif
+			
+			Return True
+		Endif
+		
+		_jcolors=jobj["colors"].ToObject()
+		_jfonts=jobj["fonts"].ToObject()
+		_jstyles=jobj["styles"].ToObject()
+
+		Return True
+	End
+	
 	Method Unload()
 		_fonts.Clear()
 		_colors.Clear()

+ 2 - 1
modules/mojox/assets/themes/default.json

@@ -257,7 +257,8 @@
 		
 		"TreeView":{
 			"backgroundColor":"content",
-			"icons":"treeview_icons.png"
+			"icons":"treeview_icons.png",
+			"iconColor":"#8fff"
 		},
 		
 		"TreeViewContent":{

BIN
modules/mojox/assets/themes/treeview_icons.png


+ 0 - 349
src/ted2/assets/themes/default.json

@@ -1,349 +0,0 @@
-{
-	"colors":{
-
-		"clear": "#181818",
-		"gutter": "#262626",
-		"content": "#323232",
-		"panel": "#4c4c4c",
-		"knob": "#666666",
-		"hover": "#888888",
-		"active" : "#989898",
-		
-		"text-default": "#fff",
-		"text-highlight": "#ff0",
-		"text-disabled": "#888",
-		"text-background": "#888",
-		
-		"textview-cursor":"#08f",
-		"textview-selection":"#888",
-		
-		"textview-color0":"#0000",
-		"textview-color1":"#fff",
-		"textview-color2":"#ff0",
-		"textview-color3":"#0f8",
-		"textview-color4":"#0f8",
-		"textview-color5":"#0ff",
-		"textview-color6":"#fc0",
-		"textview-color7":"#fff",
-		
-		"windowClearColor":"clear"
-	},
-	
-	"fonts":{
-	
-		"normal":"DejaVuSans.ttf,16",
-		"fixedWidth":"DejaVuSansMono.ttf,16",
-		"small":"DejaVuSans.ttf,14"
-	},
-	
-	"styles":{
-
-		"default":{
-			"font":"normal",
-			"textColor":"text-default",
-			"iconColor":"#ffff",
-			"states":{
-				"disabled":{
-					"textColor":"text-disabled",
-					"iconColor":"#8fff"
-				}
-			}
-		},
-		
-		"Label":{
-			"padding":[8,4]
-		},
-		
-		"Button":{
-			"extends":"Label",
-			"padding":[4,2],
-			"skin":"button_skin.png",
-			"skinColor":"content",
-			
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				},
-				"selected":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"PushButton":{
-			"extends":"Button",
-			"margin":[4,4]
-		},
-		
-		"CheckButton":{
-			"extends":"Label"
-		},
-		
-		"CheckBox":{
-			"icons":"checkbox_icons.png",
-			"margin":[8,0,0,0]
-		},
-		
-		"ProgressBar":{
-			"icons":"progressbar_icons.png"
-		},
-		
-		"ScrollView":{
-		},
-		
-		"ScrollBar":{
-			"backgroundColor":"gutter"
-		},
-		
-		"ScrollKnob":{
-			"padding":[ 4 ],
-			"border":[ 1 ],
-			"borderColor":"#0000",
-			"skin":"button_skin.png",
-			"skinColor":"knob",
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"TextView":{
-			"font":"fixedWidth",
-			"backgroundColor":"content"
-		},
-		
-		"TextViewContent":{
-			"padding":[4]
-		},
-		
-		"TextField":{
-			"padding":[ 2 ],
-			"margin":[ 2 ],
-			"skin":"button_skin.png",
-			"skinColor":"content"
-		},
-		
-		"DockingView":{
-		},
-		
-		"DockedView":{
-		},
-		
-		"DockKnob":{
-			"padding":[ 3 ],
-			"backgroundColor":"knob",
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"ToolBar":{
-			"padding":[ 2 ],
-			"backgroundColor":"panel"
-		},
-		
-		"ToolButton":{
-			"extends":"Button",
-			"padding":[2,0],
-			"margin":[6,0]
-		},
-		
-		"Menu":{
-			
-			"padding":[ 0 ],
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"MenuButton":{
-			"extends":"Label",
-			"padding":[8,4],
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				},
-				"selected":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"MenuBar":{
-			"extends":"ToolBar",
-			"backgroundColor":"content"
-		},
-		
-		"MenuSeparator":{
-			"padding":[ 0,0,0,1 ],
-			"backgroundColor":"content",
-			"border":[ 8,8,7,7 ]
-		},
-
-		"TabView":{
-		},
-		
-		"TabBar":{
-			"extends":"ToolBar",
-			"padding":[ 0,2,4,0 ],
-			"backgroundColor":"clear"
-		},
-		
-		"TabButton":{
-			"extends":"Button",
-//			"font":"small",
-			"padding":[1],
-			"margin":[2,0],
-			"backgroundColor":"#0000",
-			"skin":"tabbutton_skin.png",
-			"skinColor":"gutter",
-			"textColor":"text-background",
-			
-			"states":{
-				"hover":{
-					"skinColor":"gutter"
-				},
-				"active":{
-					"skinColor":"content"
-				},
-				"selected":{
-					"skinColor":"content",
-					"textColor":"text-default"
-				}
-			}
-		},
-		
-		"TabClose":{
-			"margin":[ 4,0,0,0 ],
-			"icons":"tabclose_icons.png",
-			"iconColor":"#cfff",
-			"states":{
-				"hover":{
-					"iconColor":"#ffff"
-				},
-				"active":{
-					"iconColor":"#ffff"
-				}
-			}
-		},
-		
-		"TableView":{
-			"extends":"DockingView"
-		},
-		
-		"TableHeader":{
-			"extends":"Label",
-			"textColor":"text-highlight",
-			"border":[0,0,0,1],
-			"borderColor":"panel"
-		},
-		
-		"TableColumn":{
-		},
-		
-		"TreeView":{
-			"backgroundColor":"content",
-			"icons":"treeview_icons.png"
-		},
-		
-		"TreeViewContent":{
-			"padding":[2]
-		},
-
-		"TreeViewNode":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"ListView":{
-			"backgroundColor":"content"
-		},
-		
-		"ListViewContent":{
-			"padding":[2]
-		},
-		
-		"ListViewItem":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"FileBrowser":{
-			"extends":"TreeView"
-		},
-		
-		"HtmlView":{
-		},
-		
-		"Console":{
-			"backgroundColor":"content"
-		},
-		
-		"Dialog":{
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"DialogTitle":{
-			"extends":"Label",
-			"backgroundColor":"knob"
-		
-		},
-		
-		"DialogContent":{
-			"padding":[ 8,8,8,4 ]
-		},
-		
-		"DialogActions":{
-			"padding":[ 8,4,8,4 ]
-		},
-
-		// Ted2 specific stuff below...should really be 'extending' standard mojox theme here...
-		//
-		"GutterView":{
-			"extends":"TextView"
-		},
-		
-		"DebugToolBar":{
-			"extends":"ToolBar",
-			"border":[ 4 ],
-			"borderColor":"content",
-			"icons":"debug_icons.png"
-		},
-		
-		"HelpTextField":{
-			"extends":"TextField",
-			"skinColor":"panel"
-		}
-	}
-}

+ 23 - 0
src/ted2/assets/themes/ted2-default.json

@@ -0,0 +1,23 @@
+{
+	"extends":"default",
+	
+	"styles":{
+	
+		"GutterView":{
+			"extends":"TextView",
+			"textColor":"text-disabled"
+		},
+		
+		"DebugToolBar":{
+			"extends":"ToolBar",
+			"border":[ 4 ],
+			"borderColor":"content",
+			"icons":"debug_icons.png"
+		},
+		
+		"HelpTextField":{
+			"extends":"TextField",
+			"skinColor":"panel"
+		}
+	}
+}

+ 39 - 351
src/ted2/assets/themes/theme-Basic-Blue.json

@@ -1,351 +1,39 @@
-{
-	"colors":{
-
-		"content": "#005",
-		"clear": "#000",
-		"panel": "#00b",
-		"gutter": "#000",
-		
-		"knob": "#009",
-		"hover": "#09f",
-		"active" : "#009",
-
-		"text-default": "#fff",
-		"text-highlight": "#09f",
-		"text-disabled":  "#888",
-		"text-background": "#09f",
-		
-		"textview-cursor":"#fff",
-		"textview-selection":"#222",
-		
-		"textview-color0": "#0000",
-		"textview-color1": "#07e",	//identifiers
-		"textview-color2": "#ff0",	//keywords
-		"textview-color3": "#e0e",	//strings
-		"textview-color4": "#0f0",	//numbers
-		"textview-color5": "#fff",	//comment
-		"textview-color6": "#d82",	//preproc
-		"textview-color7": "#222",	//default
-		
-		"windowClearColor": "clear"
-	},
-	
-	"fonts":{
-	
-		"normal":"Verdana.ttf,16",
-		"fixedWidth":"Verdana.ttf,16",
-		"small":"Verdana.ttf,14"
-	},
-	
-	"styles":{
-
-		"default":{
-			"font":"normal",
-			"textColor":"text-default",
-			"iconColor":"#ffff",
-			"states":{
-				"disabled":{
-					"textColor":"text-disabled",
-					"iconColor":"#8fff"
-				}
-			}
-		},
-		
-		"Label":{
-			"padding":[8,4]
-		},
-		
-		"Button":{
-			"extends":"Label",
-			"padding":[4,2],
-			"skin":"button_skin.png",
-			"skinColor":"content",
-			
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				},
-				"selected":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"PushButton":{
-			"extends":"Button",
-			"margin":[4,4]
-		},
-		
-		"CheckButton":{
-			"extends":"Label"
-		},
-		
-		"CheckBox":{
-			"icons":"checkbox_icons.png",
-			"margin":[8,0,0,0]
-		},
-		
-		"ProgressBar":{
-			"icons":"progressbar_icons.png"
-		},
-		
-		"ScrollView":{
-		},
-		
-		"ScrollBar":{
-			"backgroundColor":"clear"
-		},
-		
-		"ScrollKnob":{
-			"padding":[ 4 ],
-			"border":[ 1 ],
-			"borderColor":"#0000",
-			"skin":"button_skin.png",
-			"skinColor":"hover",
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"TextView":{
-			"font":"fixedWidth",
-			"backgroundColor":"content"
-		},
-		
-		"TextViewContent":{
-			"padding":[4]
-		},
-		
-		"TextField":{
-			"padding":[ 2 ],
-			"margin":[ 2 ],
-			"skin":"button_skin.png",
-			"skinColor":"content"
-		},
-		
-		"DockingView":{
-		},
-		
-		"DockedView":{
-		},
-		
-		"DockKnob":{
-			"padding":[ 3 ],
-			"backgroundColor":"knob",
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"ToolBar":{
-			"padding":[ 2 ],
-			"backgroundColor":"clear"
-		},
-		
-		"ToolButton":{
-			"extends":"Button",
-			"padding":[2,0],
-			"margin":[6,0]
-		},
-		
-		"Menu":{
-			
-			"padding":[ 0 ],
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"MenuButton":{
-			"extends":"Label",
-			"padding":[8,4],
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				},
-				"selected":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"MenuBar":{
-			"extends":"ToolBar",
-			"backgroundColor":"content"
-		},
-		
-		"MenuSeparator":{
-			"padding":[ 0,0,0,1 ],
-			"backgroundColor":"content",
-			"border":[ 8,8,7,7 ]
-		},
-
-		"TabView":{
-		},
-		
-		"TabBar":{
-			"extends":"ToolBar",
-			"padding":[ 0,2,4,0 ],
-			"backgroundColor":"clear"
-		},
-		
-		"TabButton":{
-			"extends":"Button",
-//			"font":"small",
-			"padding":[1],
-			"margin":[2,0],
-			"backgroundColor":"#0000",
-			"skin":"tabbutton_skin.png",
-			"skinColor":"gutter",
-			"textColor":"text-background",
-			
-			"states":{
-				"hover":{
-					"skinColor":"gutter"
-				},
-				"active":{
-					"skinColor":"content"
-				},
-				"selected":{
-					"skinColor":"content",
-					"textColor":"text-default"
-				}
-			}
-		},
-		
-		"TabClose":{
-			"margin":[ 4,0,0,0 ],
-			"icons":"tabclose_icons.png",
-			"iconColor":"#cfff",
-			"states":{
-				"hover":{
-					"iconColor":"#ffff"
-				},
-				"active":{
-					"iconColor":"#ffff"
-				}
-			}
-		},
-		
-		"TableView":{
-			"extends":"DockingView"
-		},
-		
-		"TableHeader":{
-			"extends":"Label",
-			"textColor":"text-highlight",
-			"border":[0,0,0,1],
-			"borderColor":"panel"
-		},
-		
-		"TableColumn":{
-		},
-		
-		"TreeView":{
-			"backgroundColor":"content",
-			"icons":"treeview_icons.png"
-		},
-		
-		"TreeViewContent":{
-			"padding":[2]
-		},
-
-		"TreeViewNode":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"ListView":{
-			"backgroundColor":"content"
-		},
-		
-		"ListViewContent":{
-			"padding":[2]
-		},
-		
-		"ListViewItem":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"FileBrowser":{
-			"extends":"TreeView"
-		},
-		
-		"HtmlView":{
-			//"backgroundColor":"clear"
-		},
-		
-		"Console":{
-			"backgroundColor":"content"
-		},
-		
-		"Dialog":{
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"DialogTitle":{
-			"extends":"Label",
-			"backgroundColor":"knob"
-		},
-		
-		"DialogContent":{
-			"padding":[ 8,8,8,4 ]
-		},
-		
-		"DialogActions":{
-			"padding":[ 8,4,8,4 ]
-		},
-
-		// Ted2 specific stuff below...should really be 'extending' standard mojox theme here...
-		//
-		"GutterView":{
-			"extends":"TextView",
-			"textColor":"text-disabled"
-		},
-		
-		"DebugToolBar":{
-			"extends":"ToolBar",
-			"border":[ 4 ],
-			"borderColor":"content",
-			"icons":"debug_icons.png"
-		},
-		
-		"HelpTextField":{
-			"extends":"TextField",
-			"skinColor":"clear"
-		}
-	}
-}
+{
+	"extends":"ted2-default",
+	
+	"colors":{
+
+		"content": "#005",
+		"clear": "#000",
+		"panel": "#00b",
+		"gutter": "#000",
+		
+		"knob": "#009",
+		"hover": "#09f",
+		"active" : "#009",
+
+		"text-default": "#fff",
+		"text-highlight": "#09f",
+		"text-disabled":  "#888",
+		"text-background": "#09f",
+		
+		"textview-cursor":"#fff",
+		"textview-selection":"#222",
+		
+		"textview-color0": "#0000",
+		"textview-color1": "#07e",	//identifiers
+		"textview-color2": "#ff0",	//keywords
+		"textview-color3": "#e0e",	//strings
+		"textview-color4": "#0f0",	//numbers
+		"textview-color5": "#fff",	//comment
+		"textview-color6": "#d82",	//preproc
+		"textview-color7": "#222"	//default
+	},
+	
+	"fonts":{
+	
+		"normal":"Verdana.ttf,16",
+		"fixedWidth":"Verdana.ttf,16",
+		"small":"Verdana.ttf,14"
+	}
+}

+ 3 - 321
src/ted2/assets/themes/theme-blitzed.json

@@ -1,4 +1,6 @@
 {
+	"extends":"ted2-default",
+	
 	"colors":{
 
 		"content": "#345",
@@ -25,326 +27,6 @@
 		"textview-color4":"#0f8",
 		"textview-color5":"#0ff",
 		"textview-color6":"#fc0",
-		"textview-color7":"#fff",
-		
-		"windowClearColor": "clear"
-	},
-	
-	"fonts":{
-	
-		"normal":"DejaVuSans.ttf,16",
-		"fixedWidth":"DejaVuSansMono.ttf,16",
-		"small":"DejaVuSans.ttf,14"
-	},
-	
-	"styles":{
-
-		"default":{
-			"font":"normal",
-			"textColor":"text-default",
-			"iconColor":"#ffff",
-			"states":{
-				"disabled":{
-					"textColor":"text-disabled",
-					"iconColor":"#8fff"
-				}
-			}
-		},
-		
-		"Label":{
-			"padding":[8,4]
-		},
-		
-		"Button":{
-			"extends":"Label",
-			"padding":[4,2],
-			"skin":"button_skin.png",
-			"skinColor":"content",
-			
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				},
-				"selected":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"PushButton":{
-			"extends":"Button",
-			"margin":[4,4]
-		},
-		
-		"CheckButton":{
-			"extends":"Label"
-		},
-		
-		"CheckBox":{
-			"icons":"checkbox_icons.png",
-			"margin":[8,0,0,0]
-		},
-		
-		"ProgressBar":{
-			"icons":"progressbar_icons.png"
-		},
-		
-		"ScrollView":{
-		},
-		
-		"ScrollBar":{
-			"backgroundColor":"gutter"
-		},
-		
-		"ScrollKnob":{
-			"padding":[ 4 ],
-			"border":[ 1 ],
-			"borderColor":"#0000",
-			"skin":"button_skin.png",
-			"skinColor":"knob",
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"TextView":{
-			"font":"fixedWidth",
-			"backgroundColor":"content"
-		},
-		
-		"TextViewContent":{
-			"padding":[4]
-		},
-		
-		"TextField":{
-			"padding":[ 2 ],
-			"margin":[ 2 ],
-			"skin":"button_skin.png",
-			"skinColor":"content"
-		},
-		
-		"DockingView":{
-		},
-		
-		"DockedView":{
-		},
-		
-		"DockKnob":{
-			"padding":[ 3 ],
-			"backgroundColor":"knob",
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"ToolBar":{
-			"padding":[ 2 ],
-			"backgroundColor":"panel"
-		},
-		
-		"ToolButton":{
-			"extends":"Button",
-			"padding":[2,0],
-			"margin":[6,0]
-		},
-		
-		"Menu":{
-			
-			"padding":[ 0 ],
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"MenuButton":{
-			"extends":"Label",
-			"padding":[8,4],
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				},
-				"selected":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"MenuBar":{
-			"extends":"ToolBar",
-			"backgroundColor":"content"
-		},
-		
-		"MenuSeparator":{
-			"padding":[ 0,0,0,1 ],
-			"backgroundColor":"content",
-			"border":[ 8,8,7,7 ]
-		},
-
-		"TabView":{
-		},
-		
-		"TabBar":{
-			"extends":"ToolBar",
-			"padding":[ 0,2,4,0 ],
-			"backgroundColor":"clear"
-		},
-		
-		"TabButton":{
-			"extends":"Button",
-//			"font":"small",
-			"padding":[1],
-			"margin":[2,0],
-			"backgroundColor":"#0000",
-			"skin":"tabbutton_skin.png",
-			"skinColor":"gutter",
-			"textColor":"text-background",
-			
-			"states":{
-				"hover":{
-					"skinColor":"gutter"
-				},
-				"active":{
-					"skinColor":"content"
-				},
-				"selected":{
-					"skinColor":"content",
-					"textColor":"text-default"
-				}
-			}
-		},
-		
-		"TabClose":{
-			"margin":[ 4,0,0,0 ],
-			"icons":"tabclose_icons.png",
-			"iconColor":"#cfff",
-			"states":{
-				"hover":{
-					"iconColor":"#ffff"
-				},
-				"active":{
-					"iconColor":"#ffff"
-				}
-			}
-		},
-		
-		"TableView":{
-			"extends":"DockingView"
-		},
-		
-		"TableHeader":{
-			"extends":"Label",
-			"textColor":"text-highlight",
-			"border":[0,0,0,1],
-			"borderColor":"panel"
-		},
-		
-		"TableColumn":{
-		},
-		
-		"TreeView":{
-			"backgroundColor":"content",
-			"icons":"treeview_icons.png"
-		},
-		
-		"TreeViewContent":{
-			"padding":[2]
-		},
-
-		"TreeViewNode":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"ListView":{
-			"backgroundColor":"content"
-		},
-		
-		"ListViewContent":{
-			"padding":[2]
-		},
-		
-		"ListViewItem":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"FileBrowser":{
-			"extends":"TreeView"
-		},
-		
-		"HtmlView":{
-		},
-		
-		"Console":{
-			"backgroundColor":"content"
-		},
-		
-		"Dialog":{
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"DialogTitle":{
-			"extends":"Label",
-			"backgroundColor":"knob"
-		},
-		
-		"DialogContent":{
-			"padding":[ 8,8,8,4 ]
-		},
-		
-		"DialogActions":{
-			"padding":[ 8,4,8,4 ]
-		},
-
-		// Ted2 specific stuff below...should really be 'extending' standard mojox theme here...
-		//
-		"GutterView":{
-			"extends":"TextView",
-			"textColor":"text-disabled"
-		},
-		
-		"DebugToolBar":{
-			"extends":"ToolBar",
-			"border":[ 4 ],
-			"borderColor":"content",
-			"icons":"debug_icons.png"
-		},
-		
-		"HelpTextField":{
-			"extends":"TextField",
-			"skinColor":"panel"
-		}
+		"textview-color7":"#fff"
 	}
 }

+ 4 - 322
src/ted2/assets/themes/theme-classic-dark.json

@@ -1,10 +1,13 @@
 {
+	"extends":"ted2-default",
+
 	"colors":{
 
 		"clear": "#181818",
 		"gutter": "#262626",
 		"content": "#323232",
 		"panel": "#4c4c4c",
+		
 		"knob": "#666666",
 		"hover": "#888888",
 		"active" : "#989898",
@@ -24,327 +27,6 @@
 		"textview-color4":"#0f8",
 		"textview-color5":"#0ff",
 		"textview-color6":"#fc0",
-		"textview-color7":"#fff",
-		
-		"windowClearColor":"clear"
-	},
-	
-	"fonts":{
-	
-		"normal":"DejaVuSans.ttf,16",
-		"fixedWidth":"DejaVuSansMono.ttf,16",
-		"small":"DejaVuSans.ttf,14"
-	},
-	
-	"styles":{
-
-		"default":{
-			"font":"normal",
-			"textColor":"text-default",
-			"iconColor":"#ffff",
-			"states":{
-				"disabled":{
-					"textColor":"text-disabled",
-					"iconColor":"#8fff"
-				}
-			}
-		},
-		
-		"Label":{
-			"padding":[8,4]
-		},
-		
-		"Button":{
-			"extends":"Label",
-			"padding":[4,2],
-			"skin":"button_skin.png",
-			"skinColor":"content",
-			
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				},
-				"selected":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"PushButton":{
-			"extends":"Button",
-			"margin":[4,4]
-		},
-		
-		"CheckButton":{
-			"extends":"Label"
-		},
-		
-		"CheckBox":{
-			"icons":"checkbox_icons.png",
-			"margin":[8,0,0,0]
-		},
-		
-		"ProgressBar":{
-			"icons":"progressbar_icons.png"
-		},
-		
-		"ScrollView":{
-		},
-		
-		"ScrollBar":{
-			"backgroundColor":"gutter"
-		},
-		
-		"ScrollKnob":{
-			"padding":[ 4 ],
-			"border":[ 1 ],
-			"borderColor":"#0000",
-			"skin":"button_skin.png",
-			"skinColor":"knob",
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"TextView":{
-			"font":"fixedWidth",
-			"backgroundColor":"content"
-		},
-		
-		"TextViewContent":{
-			"padding":[4]
-		},
-		
-		"TextField":{
-			"padding":[ 2 ],
-			"margin":[ 2 ],
-			"skin":"button_skin.png",
-			"skinColor":"content"
-		},
-		
-		"DockingView":{
-		},
-		
-		"DockedView":{
-		},
-		
-		"DockKnob":{
-			"padding":[ 3 ],
-			"backgroundColor":"knob",
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"ToolBar":{
-			"padding":[ 2 ],
-			"backgroundColor":"panel"
-		},
-		
-		"ToolButton":{
-			"extends":"Button",
-			"padding":[2,0],
-			"margin":[6,0]
-		},
-		
-		"Menu":{
-			
-			"padding":[ 0 ],
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"MenuButton":{
-			"extends":"Label",
-			"padding":[8,4],
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				},
-				"selected":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"MenuBar":{
-			"extends":"ToolBar",
-			"backgroundColor":"content"
-		},
-		
-		"MenuSeparator":{
-			"padding":[ 0,0,0,1 ],
-			"backgroundColor":"content",
-			"border":[ 8,8,7,7 ]
-		},
-
-		"TabView":{
-		},
-		
-		"TabBar":{
-			"extends":"ToolBar",
-			"padding":[ 0,2,4,0 ],
-			"backgroundColor":"clear"
-		},
-		
-		"TabButton":{
-			"extends":"Button",
-//			"font":"small",
-			"padding":[1],
-			"margin":[2,0],
-			"backgroundColor":"#0000",
-			"skin":"tabbutton_skin.png",
-			"skinColor":"gutter",
-			"textColor":"text-background",
-			
-			"states":{
-				"hover":{
-					"skinColor":"gutter"
-				},
-				"active":{
-					"skinColor":"content"
-				},
-				"selected":{
-					"skinColor":"content",
-					"textColor":"text-default"
-				}
-			}
-		},
-		
-		"TabClose":{
-			"margin":[ 4,0,0,0 ],
-			"icons":"tabclose_icons.png",
-			"iconColor":"#cfff",
-			"states":{
-				"hover":{
-					"iconColor":"#ffff"
-				},
-				"active":{
-					"iconColor":"#ffff"
-				}
-			}
-		},
-		
-		"TableView":{
-			"extends":"DockingView"
-		},
-		
-		"TableHeader":{
-			"extends":"Label",
-			"textColor":"text-highlight",
-			"border":[0,0,0,1],
-			"borderColor":"panel"
-		},
-		
-		"TableColumn":{
-		},
-		
-		"TreeView":{
-			"backgroundColor":"content",
-			"icons":"treeview_icons.png"
-		},
-		
-		"TreeViewContent":{
-			"padding":[2]
-		},
-
-		"TreeViewNode":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"ListView":{
-			"backgroundColor":"content"
-		},
-		
-		"ListViewContent":{
-			"padding":[2]
-		},
-		
-		"ListViewItem":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"FileBrowser":{
-			"extends":"TreeView"
-		},
-		
-		"HtmlView":{
-		},
-		
-		"Console":{
-			"backgroundColor":"content"
-		},
-		
-		"Dialog":{
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"DialogTitle":{
-			"extends":"Label",
-			"backgroundColor":"knob"
-		
-		},
-		
-		"DialogContent":{
-			"padding":[ 8,8,8,4 ]
-		},
-		
-		"DialogActions":{
-			"padding":[ 8,4,8,4 ]
-		},
-
-		// Ted2 specific stuff below...should really be 'extending' standard mojox theme here...
-		//
-		"GutterView":{
-			"extends":"TextView",
-			"textColor":"text-disabled"
-		},
-		
-		"DebugToolBar":{
-			"extends":"ToolBar",
-			"border":[ 4 ],
-			"borderColor":"content",
-			"icons":"debug_icons.png"
-		},
-		
-		"HelpTextField":{
-			"extends":"TextField",
-			"skinColor":"panel"
-		}
+		"textview-color7":"#fff"
 	}
 }

+ 7 - 316
src/ted2/assets/themes/theme-monkey1.json

@@ -1,4 +1,6 @@
 {
+	"extends":"ted2-default",
+
 	"colors":{
 
 		"content": "#ffffff",
@@ -25,326 +27,15 @@
 		"textview-color4": "#228",	//numbers
 		"textview-color5": "#288",	//comment
 		"textview-color6": "#828",	//preproc
-		"textview-color7": "#222",	//default
-		
-		"windowClearColor": "clear"
+		"textview-color7": "#222"	//default
 	},
-	
-	"fonts":{
-	
-		"normal":"DejaVuSans.ttf,16",
-		"fixedWidth":"DejaVuSansMono.ttf,16",
-		"small":"DejaVuSans.ttf,14"
-	},
-	
-	"styles":{
-
-		"default":{
-			"font":"normal",
-			"textColor":"text-default",
-			"iconColor":"#ffff",
-			"states":{
-				"disabled":{
-					"textColor":"text-disabled",
-					"iconColor":"#8fff"
-				}
-			}
-		},
-		
-		"Label":{
-			"padding":[8,4]
-		},
-		
-		"Button":{
-			"extends":"Label",
-			"padding":[4,2],
-			"skin":"button_skin.png",
-			"skinColor":"content",
-			
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				},
-				"selected":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"PushButton":{
-			"extends":"Button",
-			"margin":[4,4]
-		},
-		
-		"CheckButton":{
-			"extends":"Label"
-		},
-		
-		"CheckBox":{
-			"icons":"checkbox_icons.png",
-			"margin":[8,0,0,0]
-		},
-		
-		"ProgressBar":{
-			"icons":"progressbar_icons.png"
-		},
-		
-		"ScrollView":{
-		},
-		
-		"ScrollBar":{
-			"backgroundColor":"gutter"
-		},
-		
-		"ScrollKnob":{
-			"padding":[ 4 ],
-			"border":[ 1 ],
-			"borderColor":"#0000",
-			"skin":"button_skin.png",
-			"skinColor":"knob",
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"TextView":{
-			"font":"fixedWidth",
-			"backgroundColor":"content"
-		},
-		
-		"TextViewContent":{
-			"padding":[4]
-		},
-		
-		"TextField":{
-			"padding":[ 2 ],
-			"margin":[ 2 ],
-			"skin":"button_skin.png",
-			"skinColor":"content"
-		},
-		
-		"DockingView":{
-		},
-		
-		"DockedView":{
-		},
-		
-		"DockKnob":{
-			"padding":[ 3 ],
-			"backgroundColor":"knob",
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"ToolBar":{
-			"padding":[ 2 ],
-			"backgroundColor":"panel"
-		},
-		
-		"ToolButton":{
-			"extends":"Button",
-			"padding":[2,0],
-			"margin":[6,0]
-		},
-		
-		"Menu":{
-			
-			"padding":[ 0 ],
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"MenuButton":{
-			"extends":"Label",
-			"padding":[8,4],
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				},
-				"selected":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"MenuBar":{
-			"extends":"ToolBar",
-			"backgroundColor":"content"
-		},
-		
-		"MenuSeparator":{
-			"padding":[ 0,0,0,1 ],
-			"backgroundColor":"content",
-			"border":[ 8,8,7,7 ]
-		},
 
-		"TabView":{
-		},
-		
-		"TabBar":{
-			"extends":"ToolBar",
-			"padding":[ 0,2,4,0 ],
-			"backgroundColor":"clear"
-		},
-		
-		"TabButton":{
-			"extends":"Button",
-//			"font":"small",
-			"padding":[1],
-			"margin":[2,0],
-			"backgroundColor":"#0000",
-			"skin":"tabbutton_skin.png",
-			"skinColor":"gutter",
-			"textColor":"text-background",
-			
-			"states":{
-				"hover":{
-					"skinColor":"gutter"
-				},
-				"active":{
-					"skinColor":"content"
-				},
-				"selected":{
-					"skinColor":"content",
-					"textColor":"text-default"
-				}
-			}
-		},
-		
-		"TabClose":{
-			"margin":[ 4,0,0,0 ],
-			"icons":"tabclose_icons.png",
-			"iconColor":"#cfff",
-			"states":{
-				"hover":{
-					"iconColor":"#ffff"
-				},
-				"active":{
-					"iconColor":"#ffff"
-				}
-			}
-		},
-		
-		"TableView":{
-			"extends":"DockingView"
-		},
-		
-		"TableHeader":{
-			"extends":"Label",
-			"textColor":"text-highlight",
-			"border":[0,0,0,1],
-			"borderColor":"panel"
-		},
-		
-		"TableColumn":{
-		},
-		
+	"styles":{
+	
 		"TreeView":{
 			"backgroundColor":"content",
-			"icons":"treeview_icons.png"
-		},
-		
-		"TreeViewContent":{
-			"padding":[2]
-		},
-
-		"TreeViewNode":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"ListView":{
-			"backgroundColor":"content"
-		},
-		
-		"ListViewContent":{
-			"padding":[2]
-		},
-		
-		"ListViewItem":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"FileBrowser":{
-			"extends":"TreeView"
-		},
-		
-		"HtmlView":{
-		},
-		
-		"Console":{
-			"backgroundColor":"content"
-		},
-		
-		"Dialog":{
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"DialogTitle":{
-			"extends":"Label",
-			"backgroundColor":"knob"
-		},
-		
-		"DialogContent":{
-			"padding":[ 8,8,8,4 ]
-		},
-		
-		"DialogActions":{
-			"padding":[ 8,4,8,4 ]
-		},
-
-		// Ted2 specific stuff below...should really be 'extending' standard mojox theme here...
-		//
-		"GutterView":{
-			"extends":"TextView",
-			"textColor":"text-disabled"
-		},
-		
-		"DebugToolBar":{
-			"extends":"ToolBar",
-			"border":[ 4 ],
-			"borderColor":"content",
-			"icons":"debug_icons.png"
-		},
-		
-		"HelpTextField":{
-			"extends":"TextField",
-			"skinColor":"panel"
+			"icons":"treeview_icons.png",
+			"iconColor":"#aaa"
 		}
 	}
 }

+ 3 - 321
src/ted2/assets/themes/theme-overcast.json

@@ -1,4 +1,6 @@
 {
+	"extends":"ted2-default",
+	
 	"colors":{
 
 		"clear": "#989898",
@@ -25,326 +27,6 @@
 		"textview-color4":"#080",
 		"textview-color5":"#808",
 		"textview-color6":"#840",
-		"textview-color7":"#000",
-		
-		"windowClearColor":"clear"
-	},
-	
-	"fonts":{
-	
-		"normal":"DejaVuSans.ttf,16",
-		"fixedWidth":"DejaVuSansMono.ttf,16",
-		"small":"DejaVuSans.ttf,14"
-	},
-	
-	"styles":{
-
-		"default":{
-			"font":"normal",
-			"textColor":"text-default",
-			"iconColor":"#ffff",
-			"states":{
-				"disabled":{
-					"textColor":"text-disabled",
-					"iconColor":"#8fff"
-				}
-			}
-		},
-		
-		"Label":{
-			"padding":[8,4]
-		},
-		
-		"Button":{
-			"extends":"Label",
-			"padding":[4,2],
-			"skin":"button_skin.png",
-			"skinColor":"content",
-			
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				},
-				"selected":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"PushButton":{
-			"extends":"Button",
-			"margin":[4,4]
-		},
-		
-		"CheckButton":{
-			"extends":"Label"
-		},
-		
-		"CheckBox":{
-			"icons":"checkbox_icons.png",
-			"margin":[8,0,0,0]
-		},
-		
-		"ProgressBar":{
-			"icons":"progressbar_icons.png"
-		},
-		
-		"ScrollView":{
-		},
-		
-		"ScrollBar":{
-			"backgroundColor":"gutter"
-		},
-		
-		"ScrollKnob":{
-			"padding":[ 4 ],
-			"border":[ 1 ],
-			"borderColor":"#0000",
-			"skin":"button_skin.png",
-			"skinColor":"knob",
-			"states":{
-				"hover":{
-					"skinColor":"hover"
-				},
-				"active":{
-					"skinColor":"active"
-				}
-			}
-		},
-		
-		"TextView":{
-			"font":"fixedWidth",
-			"backgroundColor":"content"
-		},
-		
-		"TextViewContent":{
-			"padding":[4]
-		},
-		
-		"TextField":{
-			"padding":[ 2 ],
-			"margin":[ 2 ],
-			"skin":"button_skin.png",
-			"skinColor":"content"
-		},
-		
-		"DockingView":{
-		},
-		
-		"DockedView":{
-		},
-		
-		"DockKnob":{
-			"padding":[ 3 ],
-			"backgroundColor":"knob",
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"ToolBar":{
-			"padding":[ 2 ],
-			"backgroundColor":"panel"
-		},
-		
-		"ToolButton":{
-			"extends":"Button",
-			"padding":[2,0],
-			"margin":[6,0]
-		},
-		
-		"Menu":{
-			
-			"padding":[ 0 ],
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"MenuButton":{
-			"extends":"Label",
-			"padding":[8,4],
-			"states":{
-				"hover":{
-					"backgroundColor":"hover"
-				},
-				"active":{
-					"backgroundColor":"active"
-				},
-				"selected":{
-					"backgroundColor":"active"
-				}
-			}
-		},
-		
-		"MenuBar":{
-			"extends":"ToolBar",
-			"backgroundColor":"content"
-		},
-		
-		"MenuSeparator":{
-			"padding":[ 0,0,0,1 ],
-			"backgroundColor":"content",
-			"border":[ 8,8,7,7 ]
-		},
-
-		"TabView":{
-		},
-		
-		"TabBar":{
-			"extends":"ToolBar",
-			"padding":[ 0,2,4,0 ],
-			"backgroundColor":"clear"
-		},
-		
-		"TabButton":{
-			"extends":"Button",
-//			"font":"small",
-			"padding":[1],
-			"margin":[2,0],
-			"backgroundColor":"#0000",
-			"skin":"tabbutton_skin.png",
-			"skinColor":"gutter",
-			"textColor":"text-background",
-			
-			"states":{
-				"hover":{
-					"skinColor":"gutter"
-				},
-				"active":{
-					"skinColor":"content"
-				},
-				"selected":{
-					"skinColor":"content",
-					"textColor":"text-default"
-				}
-			}
-		},
-		
-		"TabClose":{
-			"margin":[ 4,0,0,0 ],
-			"icons":"tabclose_icons.png",
-			"iconColor":"#cfff",
-			"states":{
-				"hover":{
-					"iconColor":"#ffff"
-				},
-				"active":{
-					"iconColor":"#ffff"
-				}
-			}
-		},
-		
-		"TableView":{
-			"extends":"DockingView"
-		},
-		
-		"TableHeader":{
-			"extends":"Label",
-			"textColor":"text-highlight",
-			"border":[0,0,0,1],
-			"borderColor":"panel"
-		},
-		
-		"TableColumn":{
-		},
-		
-		"TreeView":{
-			"backgroundColor":"content",
-			"icons":"treeview_icons.png"
-		},
-		
-		"TreeViewContent":{
-			"padding":[2]
-		},
-
-		"TreeViewNode":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"ListView":{
-			"backgroundColor":"content"
-		},
-		
-		"ListViewContent":{
-			"padding":[2]
-		},
-		
-		"ListViewItem":{
-			"padding":[1],
-			"states":{
-				"hover":{
-					"backgroundColor":"panel"
-				},
-				"selected":{
-					"backgroundColor":"panel",
-					"textColor":"text-highlight"
-				}
-			}
-		},
-		
-		"FileBrowser":{
-			"extends":"TreeView"
-		},
-		
-		"HtmlView":{
-		},
-		
-		"Console":{
-			"backgroundColor":"content"
-		},
-		
-		"Dialog":{
-			"skin":"dialog_skin.png",
-			"skinColor":"panel"
-		},
-		
-		"DialogTitle":{
-			"extends":"Label",
-			"backgroundColor":"knob"
-		},
-		
-		"DialogContent":{
-			"padding":[ 8,8,8,4 ]
-		},
-		
-		"DialogActions":{
-			"padding":[ 8,4,8,4 ]
-		},
-
-		// Ted2 specific stuff below...should really be 'extending' standard mojox theme here...
-		//
-		"GutterView":{
-			"extends":"TextView",
-			"textColor":"text-disabled"
-		},
-		
-		"DebugToolBar":{
-			"extends":"ToolBar",
-			"border":[ 4 ],
-			"borderColor":"content",
-			"icons":"debug_icons.png"
-		},
-		
-		"HelpTextField":{
-			"extends":"TextField",
-			"skinColor":"panel"
-		}
+		"textview-color7":"#000"
 	}
 }