Почистил вилочкой

This commit is contained in:
IgorTimofeev 2024-01-15 14:26:06 +03:00
parent 29a13b30d0
commit d6f4bbeb0e
8 changed files with 467 additions and 434 deletions

View File

@ -1,25 +1,6 @@
local filesystem = require("Filesystem")
local GUI = require("GUI")
local paths = require("Paths")
local system = require("System")
local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...)
local localization = system.getSystemLocalization()
menu:addItem("💻", localization.setAsWallpaper).onTouch = function()
local userSettings = system.getUserSettings()
local staticPictureWallpaperPath = paths.system.wallpapers .. "Static picture.wlp"
if userSettings.interfaceWallpaperPath ~= staticPictureWallpaperPath then
userSettings.interfaceWallpaperPath = staticPictureWallpaperPath
system.updateWallpaper()
end
system.wallpaper.setPicture(icon.path)
workspace:draw()
system.saveUserSettings()
end
local workspace, icon, menu = table.unpack({...})
system.addSetAsWallpaperMenuItem(menu, icon.path)
system.addUploadToPastebinMenuItem(menu, icon.path)

View File

@ -1,25 +1,6 @@
local filesystem = require("Filesystem")
local GUI = require("GUI")
local paths = require("Paths")
local system = require("System")
local workspace, icon, menu = select(1, ...), select(2, ...), select(3, ...)
local localization = system.getSystemLocalization()
menu:addItem("💻", localization.setAsWallpaper).onTouch = function()
local userSettings = system.getUserSettings()
local staticPictureWallpaperPath = paths.system.wallpapers .. "Static picture.wlp"
if userSettings.interfaceWallpaperPath ~= staticPictureWallpaperPath then
userSettings.interfaceWallpaperPath = staticPictureWallpaperPath
system.updateWallpaper()
end
system.wallpaper.setPicture(icon.path)
workspace:draw()
system.saveUserSettings()
end
local workspace, icon, menu = table.unpack({...})
system.addSetAsWallpaperMenuItem(menu, icon.path)
system.addUploadToPastebinMenuItem(menu, icon.path)

View File

@ -1,65 +1,62 @@
local GUI = require("GUI")
local system = require("System")
local fs = require("Filesystem")
local filesystem = require("Filesystem")
local paths = require("Paths")
local module = {}
local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
--------------------------------------------------------------------------------
local wallpaperConfigurationControlsBegin, wallpaperConfigurationControlsEnd = nil, nil
local workspace, window, localization = table.unpack({...})
local userSettings = system.getUserSettings()
local configureFrom, configureTo
local function updateWallpaperConfigurationControls(layout)
local function configure()
-- Remove previously added controls from layout
if wallpaperConfigurationControlsBegin ~= nil then
layout:removeChildren(wallpaperConfigurationControlsBegin, wallpaperConfigurationControlsEnd)
wallpaperConfigurationControlsBegin, wallpaperConfigurationControlsEnd = nil, nil
if configureFrom then
window.contentLayout:removeChildren(configureFrom, configureTo)
configureFrom, configureTo = nil, nil
end
-- Add new controls if needed
if system.wallpaper and system.wallpaper.configure then
wallpaperConfigurationControlsBegin = #layout.children + 1
system.wallpaper.configure(layout)
wallpaperCOnfigurationControlsEnd = #layout.children
configureFrom = #window.contentLayout.children + 1
system.wallpaper.configure(window.contentLayout)
configureTo = #window.contentLayout.children
end
end
--------------------------------------------------------------------------------
module.name = localization.wallpaper
module.margin = 0
module.onTouch = function()
return {
name = localization.wallpaper,
margin = 0,
onTouch = function()
window.contentLayout:addChild(GUI.text(1, 1, 0x2D2D2D, localization.wallpaperWallpaper))
local comboBox = window.contentLayout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5))
for _, filename in pairs(fs.list(paths.system.wallpapers)) do
local path = paths.system.wallpapers .. filename
local files = filesystem.list(paths.system.wallpapers)
if fs.isDirectory(path) and fs.extension(path) == ".wlp" then
local item = comboBox:addItem(fs.hideExtension(filename))
for i = 1, #files do
local file = files[i]
local path = paths.system.wallpapers .. file
item.onTouch = function()
userSettings.interfaceWallpaperPath = path
system.updateWallpaper()
workspace:draw()
system.saveUserSettings()
updateWallpaperConfigurationControls(window.contentLayout)
end
if filesystem.isDirectory(path) and filesystem.extension(path) == ".wlp" then
comboBox:addItem(filesystem.hideExtension(file))
if userSettings.interfaceWallpaperPath == path then
comboBox.selectedItem = comboBox:count()
comboBox.selectedItem = i
end
end
end
updateWallpaperConfigurationControls(window.contentLayout)
comboBox.onItemSelected = function(index)
userSettings.interfaceWallpaperPath = paths.system.wallpapers .. files[index]
system.updateWallpaper()
configure(window.contentLayout)
workspace:draw()
system.saveUserSettings()
end
--------------------------------------------------------------------------------
return module
configure()
end
}

View File

@ -98,8 +98,6 @@ function system.getDefaultUserSettings()
interfaceBlurRadius = 3,
interfaceBlurTransparency = 0.6,
interfaceColorDesktopBackground = 0x1E1E1E,
filesShowExtension = false,
filesShowHidden = false,
filesShowApplicationIcon = true,
@ -477,6 +475,23 @@ function system.addUploadToPastebinMenuItem(menu, path)
end
end
function system.addSetAsWallpaperMenuItem(menu, path)
menu:addItem("💻", localization.setAsWallpaper).onTouch = function()
local userSettings = system.getUserSettings()
local wallpaperPath = paths.system.wallpapers .. "Static picture.wlp/"
if userSettings.interfaceWallpaperPath ~= wallpaperPath then
userSettings.interfaceWallpaperPath = wallpaperPath
system.updateWallpaper()
end
system.wallpaper.setPicture(path)
workspace:draw()
system.saveUserSettings()
end
end
function system.launchWithArguments(path)
local container = addBackgroundContainerWithInput("", localization.launchWithArguments)
@ -2375,14 +2390,17 @@ function system.execute(path, ...)
end
local function desktopBackgroundAmbientDraw()
screen.drawRectangle(1, desktopBackground.y, desktopBackground.width, desktopBackground.height, userSettings.interfaceColorDesktopBackground or 0x1E1E1E, 0, " ")
screen.drawRectangle(1, desktopBackground.y, desktopBackground.width, desktopBackground.height, 0x1E1E1E, 0, " ")
end
function system.updateWallpaper()
desktopBackground.draw = desktopBackgroundAmbientDraw
interfaceDrawInterval = 1
if userSettings.interfaceWallpaperPath then
if not userSettings.interfaceWallpaperPath then
return
end
local executable, reason = loadfile(userSettings.interfaceWallpaperPath .. "Main.lua")
if not executable then
GUI.alert(reason)
@ -2398,9 +2416,7 @@ function system.updateWallpaper()
if type(wallpaperOrError) ~= "table" then
GUI.alert("Wallpaper script didn't return table")
return
end
if type(wallpaperOrError.draw) ~= "function" then
elseif type(wallpaperOrError.draw) ~= "function" then
GUI.alert("Wallpaper does not contain proper draw function")
return
end
@ -2409,7 +2425,6 @@ function system.updateWallpaper()
desktopBackground.draw = system.wallpaper.draw
interfaceDrawInterval = 0.01
end
end
function system.updateScreen()
if userSettings.interfaceScreenAddress and userSettings.interfaceScreenAddress ~= screen.getScreenAddress() then
@ -2830,7 +2845,7 @@ function system.updateDesktop()
end
function system.updateColorScheme()
GUI.BACKGROUND_CONTAINER_PANEL_COLOR = userSettings.interfaceTransparencyEnabled and 0x0 or userSettings.interfaceColorDesktopBackground
GUI.BACKGROUND_CONTAINER_PANEL_COLOR = userSettings.interfaceTransparencyEnabled and 0x0 or 0x1E1E1E
GUI.BACKGROUND_CONTAINER_PANEL_TRANSPARENCY = userSettings.interfaceTransparencyEnabled and 0.3
end

View File

@ -1,82 +1,110 @@
local screen = require("Screen")
local fs = require("Filesystem")
local filesystem = require("Filesystem")
local system = require("System")
local GUI = require("GUI")
local wallpaper = {}
--------------------------------------------------------------------------------
local configPath = fs.path(system.getCurrentScript()) .. "Config.cfg"
local configPath = filesystem.path(system.getCurrentScript()) .. "Config.cfg"
local function saveConfig()
fs.writeTable(configPath, wallpaper.config)
end
if fs.exists(configPath) then
wallpaper.config = fs.readTable(configPath)
else
wallpaper.config = {
local config = {
backgroundColor = 0x161616,
lineCount = 10,
lineColor = 0xFFFFFF
}
if filesystem.exists(configPath) then
for key, value in pairs(filesystem.readTable(configPath)) do
config[key] = value
end
end
local function saveConfig()
filesystem.writeTable(configPath, config)
end
--------------------------------------------------------------------------------
local points = {}
local lastUptime = computer.uptime()
local function reset()
wallpaper.points = {}
points = {}
local resX, resY = screen.getResolution()
for i = 1, wallpaper.config.lineCount do
table.insert(wallpaper.points, {
for i = 1, config.lineCount do
table.insert(points, {
x = math.random(0, resX - 1),
y = math.random(0, resY-1),
y = math.random(0, (resY - 1) * 2),
vx = (2 * math.random() - 1) * 25,
vy = (2 * math.random() - 1) * 25
})
end
wallpaper.lastUpdateTime = computer.uptime()
lastUptime = computer.uptime()
end
reset(object)
function wallpaper.draw(object)
screen.drawRectangle(object.x, object.y, object.width, object.height, wallpaper.config.backgroundColor, 0, " ")
--------------------------------------------------------------------------------
return {
draw = function(object)
screen.drawRectangle(object.x, object.y, object.width, object.height, config.backgroundColor, 0, " ")
local point1, point2
for i = 1, config.lineCount - 1 do
point1, point2 = points[i], points[i + 1]
for i = 1, wallpaper.config.lineCount - 1 do
screen.drawSemiPixelLine(
math.floor(wallpaper.points[i ].x), math.floor(wallpaper.points[i ].y),
math.floor(wallpaper.points[i+1].x), math.floor(wallpaper.points[i+1].y),
wallpaper.config.lineColor
math.floor(object.x + point1.x),
math.floor(object.y * 2 - 1 + point1.y),
math.floor(object.x + point2.x),
math.floor(object.y * 2 - 1 + point2.y),
config.lineColor
)
screen.semiPixelSet(
math.floor(object.x + point1.x),
math.floor(object.y * 2 - 1 + point1.y),
0x880000
)
screen.semiPixelSet(
math.floor(object.x + point2.x),
math.floor(object.y * 2 - 1 + point2.y),
0x008800
)
end
local currentTime = computer.uptime()
local dt = currentTime - wallpaper.lastUpdateTime
wallpaper.lastUpdateTime = currentTime
local uptime = computer.uptime()
local deltaTime = uptime - lastUptime
lastUptime = uptime
for i = 1, wallpaper.config.lineCount do
local point = wallpaper.points[i]
for i = 1, config.lineCount do
point1 = points[i]
point.x = point.x + point.vx * dt
point.y = point.y + point.vy * dt
point1.x = point1.x + point1.vx * deltaTime
point1.y = point1.y + point1.vy * deltaTime
if point.x < 0 or point.x >= object.width then point.vx = -point.vx end
if point.y < 0 or point.y >= object.height then point.vy = -point.vy end
end
if point1.x < 0 or point1.x >= object.width then point1.vx = -point1.vx end
if point1.y < 0 or point1.y >= object.height * 2 then point1.vy = -point1.vy end
end
end,
function wallpaper.configure(layout)
layout:addChild(GUI.colorSelector(1, 1, 36, 3, wallpaper.config.backgroundColor, "Background color")).onColorSelected = function(_, object)
wallpaper.config.backgroundColor = object.color
configure = function(layout)
layout:addChild(GUI.colorSelector(1, 1, 36, 3, config.backgroundColor, "Background color")).onColorSelected = function(_, object)
config.backgroundColor = object.color
saveConfig()
end
layout:addChild(GUI.colorSelector(1, 1, 36, 3, wallpaper.config.lineColor, "Line color")).onColorSelected = function(_, object)
wallpaper.config.lineColor = object.color
layout:addChild(GUI.colorSelector(1, 1, 36, 3, config.lineColor, "Line color")).onColorSelected = function(_, object)
config.lineColor = object.color
saveConfig()
end
@ -89,7 +117,7 @@ function wallpaper.configure(layout)
0xFFFFFF,
0xA5A5A5,
1, 10,
wallpaper.config.lineCount,
config.lineCount,
false,
"Line count: "
)
@ -98,12 +126,9 @@ function wallpaper.configure(layout)
slider.roundValues = true
slider.onValueChanged = function(workspace, object)
wallpaper.config.lineCount = math.floor(object.value)
config.lineCount = math.floor(object.value)
saveConfig()
reset()
end
end
--------------------------------------------------------------------------------
return wallpaper
}

View File

@ -1,41 +1,37 @@
-- The simplest solid color wallpaper
local system = require("System")
local fs = require("Filesystem")
local filesystem = require("Filesystem")
local screen = require("Screen")
local GUI = require("GUI")
local wallpaper = {}
--------------------------------------------------------------------------------
local configPath = fs.path(system.getCurrentScript()) .. "/" .. "Config.cfg"
local configPath = filesystem.path(system.getCurrentScript()) .. "Config.cfg"
local function saveConfig()
fs.writeTable(configPath, wallpaper.config)
end
if fs.exists(configPath) then
wallpaper.config = fs.readTable(configPath)
else
wallpaper.config = {
local config = {
color = 0x161616
}
if filesystem.exists(configPath) then
for key, value in pairs(filesystem.readTable(configPath)) do
config[key] = value
end
end
local function saveConfig()
filesystem.writeTable(configPath, config)
end
--------------------------------------------------------------------------------
wallpaper.draw = function(object)
screen.drawRectangle(object.x, object.y, object.width, object.height, wallpaper.config.color, 0, ' ')
end
return {
draw = function(object)
screen.drawRectangle(object.x, object.y, object.width, object.height, config.color, 0, ' ')
end,
wallpaper.configure = function(layout)
layout:addChild(GUI.colorSelector(1, 1, 36, 3, wallpaper.config.color, "Color")).onColorSelected = function(_, object)
wallpaper.config.color = object.color
configure = function(layout)
layout:addChild(GUI.colorSelector(1, 1, 36, 3, config.color, "Color")).onColorSelected = function(_, object)
config.color = object.color
saveConfig()
end
end
--------------------------------------------------------------------------------
return wallpaper
}

View File

@ -1,48 +1,69 @@
local screen = require("Screen")
local fs = require("Filesystem")
local filesystem = require("Filesystem")
local GUI = require("GUI")
local system = require("System")
local color = require("Color")
--------------------------------------------------------------------------------
local braille1, braille2, braille3, braille4, braille5, braille6, braille7, braille8, braille9, braille10 = "", "", "", "", "", "", "", "", "", ""
local configPath = filesystem.path(system.getCurrentScript()) .. "Config.cfg"
local config = {
starAmount = 100,
backgroundColor = 0x0F0F0F,
starColor = 0xF0F0F0,
delay = 0.05,
offset = 0.01,
speed = 100
}
if filesystem.exists(configPath) then
for key, value in pairs(filesystem.readTable(configPath)) do
config[key] = value
end
end
local function saveConfig()
filesystem.writeTable(configPath, config)
end
--------------------------------------------------------------------------------
-- Faster access without tables indexing
local computerUptime, tableRemove, mathSin, mathCos, mathRandom, screenUpdate = computer.uptime, table.remove, math.sin, math.cos, math.random
--------------------------------------------------------------------------------
local wallpaper = {}
local configPath = fs.path(system.getCurrentScript()) .. "Config.cfg"
local function saveConfig()
fs.writeTable(configPath, wallpaper.config)
end
if fs.exists(configPath) then
wallpaper.config = fs.readTable(configPath)
else
wallpaper.config = {
starAmount = 100,
backgroundColor = 0x0F0F0F,
starColor = 0xFFFFFF,
delay = 0.05,
initialWay = 0.01,
speed = 100
}
end
--------------------------------------------------------------------------------
local braille1, braille2, braille3, braille4, braille5, braille6, braille7, braille8, braille9, braille10 = "", "", "", "", "", "", "", "", "", ""
local stars, deadline, colors
local function resetColors()
-- This case uses default OC palette, which is based & redpilled
if config.starColor >= 0xF0F0F0 then
colors = {
0x0F0F0F,
0x1E1E1E,
0x2D2D2D,
0x3C3C3C,
0x4B4B4B,
0x5A5A5A,
0x696969,
0x787878,
0x878787,
0x969696,
0xA5A5A5,
0xB4B4B4,
0xC3C3C3,
0xD2D2D2,
0xE1E1E1,
0xF0F0F0
}
-- Otherwise palette will be auto-generated
else
colors = {}
local colorCount = 16
for i = 1, colorCount do
table.insert(colors, color.transition(wallpaper.config.backgroundColor, wallpaper.config.starColor, (i - 1) / (colorCount - 1)))
colors[i] = color.transition(config.backgroundColor, config.starColor, (i - 1) / (colorCount - 1))
end
end
end
@ -54,29 +75,31 @@ end
resetColors()
resetStars()
function wallpaper.draw(object)
--------------------------------------------------------------------------------
return {
draw = function(object)
local hitsDeadline = computerUptime() >= deadline
-- Spawning stars
while #stars < wallpaper.config.starAmount do
while #stars < config.starAmount do
local rotationAngle = mathRandom(6265) / 1000
local targetX = mathCos(rotationAngle) * object.width * 0.75 + object.width / 2
local targetY = mathSin(rotationAngle) * object.width * 0.375 + object.height / 2
local startWay = mathRandom()
table.insert(stars, {
targetX = targetX,
targetY = targetY,
startX = (targetX - object.width / 2) * startWay + object.width / 2,
startY = (targetY - object.height / 2) * startWay + object.height / 2,
way = wallpaper.config.initialWay,
speed = (mathRandom(25, 75) / 1000 + 1) * (wallpaper.config.speed / 100)
startX = (targetX - object.width / 2) * config.offset + object.width / 2,
startY = (targetY - object.height / 2) * config.offset + object.height / 2,
way = 0.01,
speed = (mathRandom(25, 75) / 1000 + 1) * (config.speed / 100)
})
end
-- Clear background
screen.drawRectangle(object.x, object.y, object.width, object.height, wallpaper.config.backgroundColor, 0, " ")
screen.drawRectangle(object.x, object.y, object.width, object.height, config.backgroundColor, 0, " ")
-- Drawing stars
local i = 1
@ -119,7 +142,7 @@ function wallpaper.draw(object)
end
end
screen.set(x - x % 1, y - y % 1, wallpaper.config.backgroundColor, color, char)
screen.set(x - x % 1, y - y % 1, config.backgroundColor, color, char)
i = i + 1
if hitsDeadline then
@ -129,24 +152,24 @@ function wallpaper.draw(object)
end
if hitsDeadline then
deadline = computerUptime() + wallpaper.config.delay
end
deadline = computerUptime() + config.delay
end
end,
function wallpaper.configure(layout)
layout:addChild(GUI.colorSelector(1, 1, 36, 3, wallpaper.config.backgroundColor, "Background color")).onColorSelected = function(_, object)
wallpaper.config.backgroundColor = object.color
saveConfig()
configure = function(layout)
layout:addChild(GUI.colorSelector(1, 1, 36, 3, config.backgroundColor, "Background color")).onColorSelected = function(_, object)
config.backgroundColor = object.color
resetColors()
end
layout:addChild(GUI.colorSelector(1, 1, 36, 3, wallpaper.config.starColor, "Star color")).onColorSelected = function(_, object)
wallpaper.config.starColor = object.color
saveConfig()
resetColors()
end
local starAmountSlider = layout:addChild(
layout:addChild(GUI.colorSelector(1, 1, 36, 3, config.starColor, "Star color")).onColorSelected = function(_, object)
config.starColor = object.color
resetColors()
saveConfig()
end
local amountSlider = layout:addChild(
GUI.slider(
1, 1,
36,
@ -155,20 +178,19 @@ function wallpaper.configure(layout)
0xFFFFFF,
0xA5A5A5,
10, 200,
wallpaper.config.starAmount,
config.starAmount,
false,
"Star amount: "
)
)
starAmountSlider.roundValues = true
starAmountSlider.onValueChanged = function(workspace, object)
wallpaper.config.starAmount = math.floor(object.value)
amountSlider.roundValues = true
amountSlider.onValueChanged = function()
config.starAmount = math.floor(amountSlider.value)
saveConfig()
-- resetStars()
end
local starSpeedSlider = layout:addChild(GUI.slider(
local speedSlider = layout:addChild(GUI.slider(
1, 1,
36,
0x66DB80,
@ -176,20 +198,38 @@ function wallpaper.configure(layout)
0xFFFFFF,
0xA5A5A5,
100, 200,
wallpaper.config.speed,
config.speed,
false,
"Speed: ",
"%"
))
starSpeedSlider.roundValues = true
starSpeedSlider.onValueChanged = function(_, object)
wallpaper.config.speed = object.value
saveConfig()
speedSlider.roundValues = true
speedSlider.onValueChanged = function()
config.speed = speedSlider.value
resetStars()
end
saveConfig()
end
--------------------------------------------------------------------------------
local offsetSlider = layout:addChild(GUI.slider(
1, 1,
36,
0x66DB80,
0xE1E1E1,
0xFFFFFF,
0xA5A5A5,
0, 100,
config.offset * 100,
false,
"Offset: ",
"%"
))
return wallpaper
offsetSlider.roundValues = true
offsetSlider.onValueChanged = function()
config.offset = offsetSlider.value / 100
resetStars()
saveConfig()
end
end
}

View File

@ -1,30 +1,38 @@
local system = require("System")
local fs = require("Filesystem")
local filesystem = require("Filesystem")
local screen = require("Screen")
local GUI = require("GUI")
local image = require("Image")
local wallpaper = {}
--------------------------------------------------------------------------------
local configPath = fs.path(system.getCurrentScript()) .. "/" .. "Config.cfg"
local configPath = filesystem.path(system.getCurrentScript()) .. "Config.cfg"
local function loadPicture()
wallpaper.image, wallpaper.reason = image.load(wallpaper.config.path)
local config = {
path = filesystem.path(system.getCurrentScript()) .. "Pictures/Girl.pic"
}
if filesystem.exists(configPath) then
for key, value in pairs(filesystem.readTable(configPath)) do
config[key] = value
end
end
local function saveConfig()
fs.writeTable(configPath, wallpaper.config)
filesystem.writeTable(configPath, config)
end
if fs.exists(configPath) then
wallpaper.config = fs.readTable(configPath)
else
wallpaper.config = {
path = fs.path(system.getCurrentScript()) .. "Pictures/Girl.pic"
}
--------------------------------------------------------------------------------
local picture, reason
local function loadPicture()
picture, reason = image.load(config.path)
end
local function setPicture(path)
config.path = path
loadPicture()
saveConfig()
end
@ -32,34 +40,24 @@ loadPicture()
--------------------------------------------------------------------------------
wallpaper.draw = function(object)
if wallpaper.image then
screen.drawImage(object.x, object.y, wallpaper.image)
return {
draw = function(object)
if picture then
screen.drawImage(object.x, object.y, picture)
else
screen.drawRectangle(object.x, object.y, object.width, object.height, 0x161616, 0x000000, " ")
local text = wallpaper.reason
screen.drawText(math.floor(object.x + object.width / 2 - #text / 2), math.floor(object.y + object.height / 2), 0x646464, text)
end
local text = reason or "Unknown reason"
screen.drawText(math.floor(object.x + object.width / 2 - unicode.len(text) / 2), math.floor(object.y + object.height / 2), 0x646464, text)
end
end,
wallpaper.configure = function(layout)
local wallpaperChooser = layout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5, wallpaper.config.path, "Open", "Cancel", "Wallpaper path", "/"))
wallpaperChooser:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE)
wallpaperChooser:addExtensionFilter(".pic")
wallpaperChooser.onSubmit = function(path)
wallpaper.config.path = path
loadPicture()
saveConfig()
end
end
configure = function(layout)
local chooser = layout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x696969, 0xD2D2D2, 0xA5A5A5, config.path, "Open", "Cancel", "Wallpaper path", "/"))
chooser:setMode(GUI.IO_MODE_OPEN, GUI.IO_MODE_FILE)
chooser:addExtensionFilter(".pic")
chooser.onSubmit = setPicture
end,
wallpaper.setPicture = function(path)
wallpaper.config.path = path
saveConfig()
loadPicture()
end
--------------------------------------------------------------------------------
return wallpaper
setPicture = setPicture
}