mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2026-03-19 10:22:41 +01:00
Reunicon icons from ~/apps/Menu/
This commit is contained in:
@@ -54,7 +54,7 @@ type IconItemInterface interface {
|
||||
|
||||
GetCmdInvoke() PluginInterface
|
||||
|
||||
|
||||
GetFileName() string
|
||||
Draw()
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ type IconItem struct {
|
||||
Label LabelInterface
|
||||
Align int
|
||||
AnimationTime int
|
||||
FileName string
|
||||
}
|
||||
|
||||
|
||||
@@ -240,6 +241,9 @@ func (self *IconItem) GetCmdInvoke() PluginInterface {
|
||||
return self.CmdInvoke
|
||||
}
|
||||
|
||||
func (self *IconItem) GetFileName() string {
|
||||
return self.FileName
|
||||
}
|
||||
func (self *IconItem) Draw() {
|
||||
if self.Parent == nil {
|
||||
fmt.Println("Error: IconItem Draw Parent nil")
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"log"
|
||||
//"encoding/json"
|
||||
//"path/filepath"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/veandco/go-sdl2/sdl"
|
||||
"github.com/veandco/go-sdl2/ttf"
|
||||
@@ -264,6 +264,27 @@ func (self *MainScreen) ExtraName(name string) string {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ExecPackage is all-in-one folder ,Name.sh,Name.png,etc
|
||||
func (self *MainScreen) IsExecPackage(dirname string ) bool {
|
||||
files,err := ioutil.ReadDir(dirname)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return false
|
||||
}
|
||||
|
||||
bname := filepath.Base(dirname)
|
||||
bname = self.ExtraName(bname)
|
||||
|
||||
for _,v := range files {
|
||||
if v.Name() == bname+".sh" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (self *MainScreen) IsPluginPackage(dirname string ) bool {
|
||||
ret := false
|
||||
files,err := ioutil.ReadDir(dirname)
|
||||
|
||||
Reference in New Issue
Block a user