add tab bar

This commit is contained in:
Xuan Sang LE
2018-01-27 03:16:06 +01:00
parent 33f7f1a681
commit ea074d9690
17 changed files with 176 additions and 27 deletions

View File

@ -76,10 +76,17 @@ class DummyApp extends this.OS.GUI.BaseApplication
{text:"some thing"},
{text:"some thing"}
]
list.set "items",ldata
#list.set "items",ldata
list.set "onlistselect", (e)->
console.log e
tabs = @find "mytabs"
tabdatas = [
{text:"file1.txt"},
{text:"file2.cpp"}
]
tabs.set "items", tabdatas
@scheme.set "apptitle", "AntOS feature showcase"
@scheme.contextmenuHandler = (e, m) ->

View File

@ -1,5 +1,6 @@
<afx-app-window apptitle="Preview" width="650" height="500">
<afx-vbox>
<afx-tab-container data-id="mytabs" closable = true></afx-tab-container>
<afx-tree-view data-id="mytree"> </afx-tree-view>
<afx-hbox>
<afx-button data-height="30" text="Read more" iconclass="fa fa-camera-retro fa-lg" id="button"></afx-button>

View File

@ -48,7 +48,10 @@ class Files extends this.OS.GUI.BaseApplication
@setting.nav = true if @setting.nav is undefined
@setting.showhidden = false if @setting.showhidden is undefined
@favo.set "items", $.extend true, {}, @setting.favorite
el.selected = false for el, i in @setting.favorite
@favo.set "items", @setting.favorite
#@favo.set "selected", -1
@applySetting()
@chdir null

View File

@ -70,14 +70,28 @@ class NotePad extends this.OS.GUI.BaseApplication
{ text: "Desktop", path: 'home:///.desktop', iconclass: "fa fa-desktop" },
]
@open @currfile if @currfile
@tabarea = @find "tabarea"
#@tabarea.set "closable", true
@open @currfile
open: (file) ->
#find table
@newtab "undefined".asFileHandler() unless file
return @newtab "undefined".asFileHandler() unless file
me = @
file.read (d) ->
return unless d
me.scheme.set "apptitle", file.basename
me.editor.setValue d, -1
file.cache = d
me.newtab file
newtab: (file) ->
file.text = if file.basename then file.basename else "undefined"
file.cache = "" unless file.cache
cnt = @tabarea.get "count"
@tabarea.push file, true
@tabarea.set "selected", cnt
@editor.setValue file.cache, -1
chdir: (p) ->
me = @

View File

@ -16,4 +16,26 @@ afx-app-window[data-id="notepad"] afx-vbox[data-id="bottom-vbox"]{
}
afx-app-window[data-id="notepad"] .afx-window-content {
background-color: #f6F6F6;
}
afx-tab-container[data-id="tabarea"] afx-list-view li {
background-color: #dfdfdf;
color:#272822;
border: 0;
border-top: 1px solid #a6a6a6;
border-right: 1px solid #a6a6a6;
border-radius: 0;
}
afx-tab-container[data-id="tabarea"] afx-list-view{
padding:0;
margin: 0;
border-left: 1px solid #a6a6a6;
border-bottom: 1px solid #a6a6a6;
}
/*afx-tab-container[data-id="tabarea"] afx-list-view i.closable:before{
color: white;
}*/
afx-tab-container[data-id="tabarea"] afx-list-view li.selected {
background-color: #f6F6F6;
border-radius: 0;
}

View File

@ -5,6 +5,7 @@
<afx-file-view data-id = "fileview" view='tree' status = false></afx-file-view>
</afx-hbox>
<afx-hbox>
<afx-tab-container data-id="tabarea" data-height="26" closable = true></afx-tab-container>
<div data-id="datarea"></div>
<afx-vbox data-height="30" data-id="bottom-vbox">
<div ><span data-id = "editorstat"></span></div>