Repository navigation
Expand file tree
/
Copy pathsettings.go
More file actions
54 lines (46 loc) · 1.48 KB
/
Copy pathsettings.go
File metadata and controls
54 lines (46 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package tyde
import (
"strconv"
"strings"
"fyne.io/fyne/v2"
)
// DesktopName returns the name the user gave virtual desktop id, or its number
// counted from one when it has none.
func DesktopName(s DeskSettings, id int) string {
names := s.DesktopNames()
if id >= 0 && id < len(names) && strings.TrimSpace(names[id]) != "" {
return names[id]
}
return strconv.Itoa(id + 1)
}
// The types of computer that Tyde can be configured for.
const (
// ComputerDesktop is a machine with no battery and no touch screen.
ComputerDesktop = "Desktop"
// ComputerLaptop is a portable computer - it has a battery, but is driven
// with a keyboard and pointer.
ComputerLaptop = "Laptop"
// ComputerTablet is a mobile computer - a battery and a touch screen.
ComputerTablet = "Tablet"
)
// DeskSettings describes the configuration options available for Fyne desktop
type DeskSettings interface {
Background() string
BackgroundFill() string
BackgroundColor() string
IconTheme() string
BorderButtonPosition() string
ClockFormatting() string
ComputerType() string
DesktopCount() int // how many virtual desktops are offered
DesktopNames() []string // user-given desktop names, index by desktop; may be shorter than the count
NarrowWidgetPanel() bool
LauncherIcons() []string
LauncherDisableTaskbar() bool
KeyboardModifier() fyne.KeyModifier
ModuleNames() []string
ScreenSaverType() string
ScreenSaverClock() bool
ScreenSaverLabel() string
AddChangeListener(listener func(DeskSettings))
}