new layout system, new UI state/styles system

This commit is contained in:
Eduardo Bart
2011-08-26 12:06:52 -03:00
parent d31d32bf82
commit 7359370251
57 changed files with 1097 additions and 1099 deletions

View File

@@ -8,12 +8,6 @@ Module
dependencies:
- core_fonts
onLoad: |
importStyles('buttons.otui')
importStyles('labels.otui')
importStyles('panels.otui')
importStyles('separators.otui')
importStyles('lineedits.otui')
importStyles('windows.otui')
importStyles('listboxes.otui')
require 'ui'
return true

View File

@@ -11,7 +11,7 @@ Button < UIButton
source: /core_ui/images/button_hover.png
border: 5
state.down:
state.pressed:
text-translate: 1 1
border-image:
source: /core_ui/images/button_down.png

View File

@@ -0,0 +1,5 @@
TextList < UIWidget
size: 200 200
border-image:
source: /core_ui/images/panel_flat.png
border: 4

View File

@@ -2,3 +2,4 @@ HorizontalSeparator < UIWidget
border-image:
source: /core_ui/images/horizontal_separator.png
border.top: 2
height: 2

View File

@@ -1,6 +1,8 @@
Window < UIWindow
font: helvetica-12px-bold
size: 200 200
opacity: 255
background-color: #ffffff
head:
height: 20
border-image:
@@ -17,5 +19,8 @@ Window < UIWindow
border: 4
border.top: 0
state.pressed:
opacity: 192
MainWindow < Window
anchors.centerIn: parent

30
modules/core_ui/ui.lua Normal file
View File

@@ -0,0 +1,30 @@
UI = { }
UI.root = getRootWidget()
function UI.loadAndDisplayLocked(otuiFile)
local widget = loadUI(otuiFile, UI.root)
UI.root:lockChild(widget)
return widget
end
function UI.loadAndDisplay(otuiFile)
local widget = loadUI(otuiFile, UI.root)
return widget
end
function UI.display(widget)
UI.root:addChild(widget)
end
function UI.displayLocked(widget)
UI.root:addChild(widget)
UI.root:lockChild(widget)
end
importStyles('styles/buttons.otui')
importStyles('styles/labels.otui')
importStyles('styles/panels.otui')
importStyles('styles/separators.otui')
importStyles('styles/lineedits.otui')
importStyles('styles/windows.otui')
importStyles('styles/listboxes.otui')