add appearance setting

This commit is contained in:
Xuan Sang LE
2018-03-12 00:42:14 +01:00
parent 8fef0c5e96
commit 07bb58b7eb
12 changed files with 131 additions and 28 deletions

View File

@ -217,7 +217,7 @@ self.OS.GUI =
wp = _OS.setting.appearance.wp
$("body").css("background-image", "url(#{_API.handler.get}/#{wp.url})" )
.css("background-size", wp.size)
.css("ackground-repeat", wp.repeat)
.css("background-repeat", wp.repeat)
initDM: ->
($ document).on 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', ()->

View File

@ -3,7 +3,7 @@
_OS.setting.applications = conf.applications if conf.applications
_OS.setting.appearance = conf.appearance if conf.appearance
_OS.setting.appearance.wp = {
url: "os://resources/themes/system/wp/wp2.png",
url: "os://resources/themes/system/wp/wp2.jpg",
size: "cover",
repeat: "repeat"
} unless _OS.setting.appearance.wp

View File

@ -1,6 +1,6 @@
<afx-list-view class = {dropdown: opts.dropdown == "true"}>
<div class = "list-container" ref = "container">
<div if = {opts.dropdown == "true"} ref = "current" style = {opts.width?"min-width:" + opts.width + "px;":"min-width:150px;"} onclick = {show_list}>
<div if = {opts.dropdown == "true"} ref = "current" style = {opts.width?"min-width:" + opts.width + "px;":""} onclick = {show_list}>
</div>
<ul ref = "mlist">
<li each={item,i in items } class={selected: parent._autoselect(item,i)} ondblclick = {parent._dbclick} onclick = {parent._select} oncontextmenu = {parent._select}>
@ -113,8 +113,12 @@
this.on("mount", function(){
self.root.observable = opts.observable || (self.parent && self.parent.root && self.parent.root.observable) || riot.observable()
if(opts.dropdown == "true")
{
self.root.observable.on("calibrate", function(){
$(self.refs.container).css("width", $(self.root).width() + "px" )
})
$(document).click(function(event) {
if(!$(event.target).closest(self.refs.container).length) {
$(self.refs.mlist).hide()

View File

@ -32,7 +32,7 @@
$(this).hide()
})
$(e.data.scheme).show()
e.data.f()
e.data.handler.render()
calibrate()
})
self.root.observable.on("resize", function(){
@ -46,7 +46,9 @@
el.scheme = sch
riot.mount(sch, {observable: self.root.observable})
$(sch).hide()
el.f()
el.handler = el.handler(sch[0])
//console.log(el.handler)
//el.handler.render()
self.root.observable.trigger("tabrendered")
//self.root.observable.trigger("calibrate")
}