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

@ -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>