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