mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-06 19:22:40 +01:00
Поддержка кастомного расстояния между иконками
This commit is contained in:
parent
0b2436599e
commit
48391eac3c
@ -4,7 +4,7 @@
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/OS.lua",
|
||||
type="Script",
|
||||
forceDownload=true,
|
||||
version=3.96,
|
||||
version=3.97,
|
||||
},
|
||||
{
|
||||
path="/MineOS/Pictures/MoonTouch.pic",
|
||||
@ -65,14 +65,14 @@
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Localization/Russian.lang",
|
||||
type="Script",
|
||||
forceDownload=true,
|
||||
version=1.33,
|
||||
version=1.34,
|
||||
},
|
||||
{
|
||||
path="/MineOS/System/Localization/English.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Localization/English.lang",
|
||||
type="Script",
|
||||
forceDownload=true,
|
||||
version=1.33,
|
||||
version=1.34,
|
||||
},
|
||||
----------------------------------------------------- Ассоциация говна --------------------------------------------------------------------------
|
||||
{
|
||||
@ -229,7 +229,7 @@
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/MineOSCore.lua",
|
||||
type="Library",
|
||||
preloadFile=true,
|
||||
version=1.90,
|
||||
version=1.91,
|
||||
},
|
||||
{
|
||||
path="/lib/MineOSNetwork.lua",
|
||||
@ -241,7 +241,7 @@
|
||||
path="/lib/MineOSInterface.lua",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/MineOSInterface.lua",
|
||||
type="Library",
|
||||
version=1.09,
|
||||
version=1.10,
|
||||
},
|
||||
{
|
||||
path="/lib/MineOSPaths.lua",
|
||||
@ -308,7 +308,7 @@
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/GUI.lua",
|
||||
type="Library",
|
||||
preloadFile=true,
|
||||
version=1.92,
|
||||
version=1.93,
|
||||
},
|
||||
{
|
||||
path="/lib/rayEngine.lua",
|
||||
@ -603,7 +603,7 @@
|
||||
type="Application",
|
||||
icon="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Finder/Icon.pic",
|
||||
forceDownload=true,
|
||||
version=1.26,
|
||||
version=1.27,
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Weather",
|
||||
|
||||
@ -174,7 +174,7 @@ window.sidebarContainer.itemsContainer = window.sidebarContainer:addChild(GUI.co
|
||||
|
||||
window.iconField = window:addChild(
|
||||
MineOSInterface.iconField(
|
||||
1, 4, 1, 1, 1, 1, 2, 2, 0x3C3C3C, 0x3C3C3C,
|
||||
1, 4, 1, 1, 2, 2, 0x3C3C3C, 0x3C3C3C,
|
||||
MineOSPaths.desktop
|
||||
)
|
||||
)
|
||||
|
||||
@ -123,7 +123,10 @@
|
||||
mineOSCreatorUsedMasterPassword = "The creator of this operating system has used Master-Password",
|
||||
loginToSystem = "Login",
|
||||
|
||||
colorScheme = "Color scheme",
|
||||
colorScheme = "Appearance",
|
||||
spaceBetweenIcons = "Space bewteen icons",
|
||||
byHorizontal = "Horizontal",
|
||||
byVertical = "Vertical",
|
||||
wallpaper = "Wallpaper",
|
||||
wallpaperPath = "Path to wallpaper",
|
||||
iconPath = "Path to icon",
|
||||
|
||||
@ -123,7 +123,10 @@
|
||||
mineOSCreatorUsedMasterPassword = "Создатель операционной системы использовал мастер-ключ",
|
||||
loginToSystem = "Вход в систему",
|
||||
|
||||
colorScheme = "Цветовая схема",
|
||||
colorScheme = "Внешний вид",
|
||||
spaceBetweenIcons = "Расстояние между иконками",
|
||||
byHorizontal = "По горизонтали",
|
||||
byVertical = "По вертикали",
|
||||
wallpaper = "Обои",
|
||||
wallpaperPath = "Путь к обоям",
|
||||
iconPath = "Путь к иконке",
|
||||
|
||||
67
OS.lua
67
OS.lua
@ -58,7 +58,7 @@ local function biometry(creatingNew)
|
||||
|
||||
local fingerImage = container.layout:addChild(GUI.image(1, 1, image.fromString([[180E0000FF 0000FF 0000FF 0000FF 0000FF 00FFFF▄00FFFF▄00FFFF▄00FFFF▄FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀00FFFF▄00FFFF▄00FFFF▄0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 00FFFF▄FFFF00▄FFFFFF▀0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF FFFFFF▀FFFFFF▀FFFF00▄00FFFF▄0000FF 0000FF 0000FF 0000FF 0000FF FFFF00▄FFFFFF▀0000FF 0000FF 0000FF 00FFFF▄00FFFF▄FFFF00▄FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀FFFF00▄00FFFF▄0000FF 0000FF FFFFFF▀FFFF00▄00FFFF▄0000FF 0000FF FFFF00▄FFFFFF▀0000FF 0000FF 00FFFF▄FFFF00▄FFFFFF▀0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF FFFF00▄00FFFF▄0000FF 0000FF FFFF00▄0000FF 00FFFF▄FFFF00▄0000FF 0000FF 00FFFF▄FFFF00▄0000FF 0000FF 0000FF 00FFFF▄00FFFF▄FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀FFFFFF▀00FFFF▄0000FF FFFF00▄00FFFF▄0000FF FFFFFF▀FFFF00▄FFFF00▄0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF 0000FF 00FFFF▄00FFFF▄00FFFF▄0000FF 0000FF FFFF00▄0000FF 0000FF FFFF00▄0000FF 0000FF FFFF00▄FFFF00▄0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF 00FFFF▄FFFFFF▀0000FF 0000FF 0000FF 0000FF 00FFFF▄FFFF00▄0000FF 0000FF FFFF00▄0000FF 0000FF FFFF00▄0000FF 0000FF FFFF00▄FFFF00▄0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF FFFF00▄0000FF 0000FF 0000FF 0000FF 00FFFF▄FFFF00▄0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF FFFF00▄0000FF 00FFFF▄FFFF00▄FFFF00▄00FFFF▄0000FF 0000FF FFFF00▄00FFFF▄0000FF FFFFFF▀FFFF00▄0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF FFFF00▄FFFFFF▀0000FF FFFF00▄0000FF 0000FF FFFF00▄0000FF 0000FF 0000FF FFFF00▄00FFFF▄0000FF FFFFFF▀FFFF00▄0000FF 0000FF 0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF 00FFFF▄FFFF00▄0000FF 00FFFF▄FFFFFF▀0000FF 0000FF FFFF00▄00FFFF▄0000FF 0000FF 0000FF FFFF00▄00FFFF▄0000FF FFFF00▄00FFFF▄0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF 00FFFF▄FFFFFF▀0000FF 0000FF FFFF00▄0000FF 0000FF 0000FF 0000FF FFFF00▄00FFFF▄0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF FFFF00▄FFFFFF▀0000FF 0000FF FFFF00▄FFFFFF▀0000FF 0000FF 0000FF 0000FF 0000FF FFFF00▄0000FF 0000FF 0000FF FFFFFF▀FFFF00▄00FFFF▄0000FF 0000FF 0000FF 0000FF 00FFFF▄FFFFFF▀0000FF 0000FF 0000FF 00FFFF▄FFFF00▄0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF FFFF00▄00FFFF▄0000FF 0000FF 0000FF FFFFFF▀0000FF 0000FF 0000FF 0000FF FFFFFF▀0000FF 0000FF 00FFFF▄FFFF00▄FFFFFF▀0000FF 0000FF 0000FF 0000FF ]])))
|
||||
local text = creatingNew and MineOSCore.localization.putFingerToRegister or MineOSCore.localization.putFingerToVerify
|
||||
local label = container.layout:addChild(GUI.label(1, 1, container.width, 1, 0xEEEEEE, text):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top))
|
||||
local label = container.layout:addChild(GUI.label(1, 1, container.width, 1, 0xE1E1E1, text):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top))
|
||||
|
||||
local scanLine = container:addChild(GUI.label(1, 1, container.width, 1, 0xFFFFFF, string.rep("─", image.getWidth(fingerImage.image) + 6)):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top))
|
||||
local fingerImageHeight = image.getHeight(fingerImage.image) + 1
|
||||
@ -127,7 +127,7 @@ end
|
||||
|
||||
local function checkPassword()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.inputPassword)
|
||||
local inputField = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, nil, nil, true, "*"))
|
||||
local inputField = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x666666, 0x666666, 0xE1E1E1, 0x2D2D2D, nil, nil, true, "*"))
|
||||
local label = container.layout:addChild(GUI.label(1, 1, 36, 1, 0xFF4940, MineOSCore.localization.incorrectPassword)):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top)
|
||||
label.hidden = true
|
||||
|
||||
@ -150,8 +150,8 @@ end
|
||||
|
||||
local function setPassword()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.passwordProtection)
|
||||
local inputField1 = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, nil, MineOSCore.localization.inputPassword, true, "*"))
|
||||
local inputField2 = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, nil, MineOSCore.localization.confirmInputPassword, true, "*"))
|
||||
local inputField1 = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x666666, 0x666666, 0xE1E1E1, 0x2D2D2D, nil, MineOSCore.localization.inputPassword, true, "*"))
|
||||
local inputField2 = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x666666, 0x666666, 0xE1E1E1, 0x2D2D2D, nil, MineOSCore.localization.confirmInputPassword, true, "*"))
|
||||
local label = container.layout:addChild(GUI.label(1, 1, 36, 1, 0x6340FF, MineOSCore.localization.passwordsAreDifferent)):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top)
|
||||
label.hidden = true
|
||||
|
||||
@ -183,7 +183,7 @@ end
|
||||
local function setProtectionMethod()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.protectYourComputer)
|
||||
|
||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xEEEEEE, 0x262626, 0x444444, 0x999999))
|
||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x444444, 0x999999))
|
||||
comboBox:addItem(MineOSCore.localization.biometricProtection)
|
||||
comboBox:addItem(MineOSCore.localization.passwordProtection)
|
||||
comboBox:addItem(MineOSCore.localization.withoutProtection)
|
||||
@ -278,7 +278,7 @@ local function createOSWindow()
|
||||
|
||||
MineOSInterface.mainContainer.iconField = MineOSInterface.mainContainer:addChild(
|
||||
MineOSInterface.iconField(
|
||||
1, 2, 1, 1, 2, 1, 3, 2,
|
||||
1, 2, 1, 1, 3, 2,
|
||||
0xFFFFFF,
|
||||
0xFFFFFF,
|
||||
MineOSPaths.desktop
|
||||
@ -307,13 +307,13 @@ local function createOSWindow()
|
||||
MineOSCore.saveProperties()
|
||||
end
|
||||
MineOSInterface.mainContainer.dockContainer.sort = function()
|
||||
local x = 1
|
||||
local x, spaceBetweenIcons = 1, MineOSCore.properties.horizontalSpaceBetweenIcons or 1
|
||||
for i = 1, #MineOSInterface.mainContainer.dockContainer.children do
|
||||
MineOSInterface.mainContainer.dockContainer.children[i].localPosition.x = x
|
||||
x = x + MineOSInterface.iconWidth + MineOSInterface.mainContainer.iconField.spaceBetweenIcons.horizontal
|
||||
x = x + MineOSInterface.iconWidth + spaceBetweenIcons
|
||||
end
|
||||
|
||||
MineOSInterface.mainContainer.dockContainer.width = (#MineOSInterface.mainContainer.dockContainer.children) * (MineOSInterface.iconWidth + MineOSInterface.mainContainer.iconField.spaceBetweenIcons.horizontal) - MineOSInterface.mainContainer.iconField.spaceBetweenIcons.horizontal
|
||||
MineOSInterface.mainContainer.dockContainer.width = #MineOSInterface.mainContainer.dockContainer.children * (MineOSInterface.iconWidth + spaceBetweenIcons) - spaceBetweenIcons
|
||||
MineOSInterface.mainContainer.dockContainer.localPosition.x = math.floor(MineOSInterface.mainContainer.width / 2 - MineOSInterface.mainContainer.dockContainer.width / 2)
|
||||
end
|
||||
|
||||
@ -334,7 +334,7 @@ local function createOSWindow()
|
||||
end
|
||||
|
||||
MineOSInterface.mainContainer.dockContainer.addIcon = function(path, window)
|
||||
local icon = MineOSInterface.mainContainer.dockContainer:addChild(MineOSInterface.icon(1, 1, path, 0x262626, 0xFFFFFF))
|
||||
local icon = MineOSInterface.mainContainer.dockContainer:addChild(MineOSInterface.icon(1, 1, path, 0x2D2D2D, 0xFFFFFF))
|
||||
icon:analyseExtension()
|
||||
icon:moveBackward()
|
||||
|
||||
@ -424,7 +424,7 @@ local function createOSWindow()
|
||||
menu:addItem(MineOSCore.localization.emptyTrash).onTouch = function()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.areYouSure)
|
||||
|
||||
container.layout:addChild(GUI.button(1, 1, 30, 1, 0xEEEEEE, 0x262626, 0xA, 0x262626, "OK")).onTouch = function()
|
||||
container.layout:addChild(GUI.button(1, 1, 30, 1, 0xE1E1E1, 0x2D2D2D, 0xA, 0x2D2D2D, "OK")).onTouch = function()
|
||||
for file in fs.list(MineOSPaths.trash) do
|
||||
fs.remove(MineOSPaths.trash .. file)
|
||||
end
|
||||
@ -447,6 +447,7 @@ local function createOSWindow()
|
||||
MineOSInterface.mainContainer.dockContainer.addIcon(MineOSCore.properties.dockShortcuts[i]).keepInDock = true
|
||||
end
|
||||
|
||||
-- Draw dock drawDock dockDraw cyka заебался искать, блядь
|
||||
MineOSInterface.mainContainer.dockContainer.draw = function(dockContainer)
|
||||
local color, currentDockTransparency, currentDockWidth, xPos, yPos = MineOSCore.properties.dockColor or 0xFFFFFF, dockTransparency, dockContainer.width + 6, dockContainer.x - 3, dockContainer.y + dockContainer.height - 1
|
||||
|
||||
@ -529,7 +530,7 @@ local function createOSWindow()
|
||||
menu:addItem(MineOSCore.localization.networkName).onTouch = function()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.networkName)
|
||||
|
||||
local textBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, MineOSCore.properties.network.name, nil))
|
||||
local textBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x666666, 0x666666, 0xE1E1E1, 0x2D2D2D, MineOSCore.properties.network.name, nil))
|
||||
textBox.onInputFinished = function()
|
||||
if textBox.text then
|
||||
MineOSNetwork.broadcastComputerState(false)
|
||||
@ -579,7 +580,7 @@ local function createOSWindow()
|
||||
subMenu:addItem(MineOSCore.localization.networkSendMessage).onTouch = function()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.networkSendMessage)
|
||||
|
||||
local textBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, nil, nil, true))
|
||||
local textBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x666666, 0x666666, 0xE1E1E1, 0x2D2D2D, nil, nil, true))
|
||||
textBox.onInputFinished = function()
|
||||
if textBox.text then
|
||||
MineOSNetwork.sendMessage(proxy.address, "MineOSNetwork", "message", textBox.text)
|
||||
@ -609,13 +610,13 @@ local function createOSWindow()
|
||||
menu:addItem(MineOSCore.localization.screenResolution).onTouch = function()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.screenResolution)
|
||||
|
||||
local widthTextBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, tostring(MineOSCore.properties.resolution and MineOSCore.properties.resolution[1] or 160), "Width", true))
|
||||
local widthTextBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x666666, 0x666666, 0xE1E1E1, 0x2D2D2D, tostring(MineOSCore.properties.resolution and MineOSCore.properties.resolution[1] or 160), "Width", true))
|
||||
widthTextBox.validator = function(text)
|
||||
local number = tonumber(text)
|
||||
if number then return number >= 1 and number <= 160 end
|
||||
end
|
||||
|
||||
local heightTextBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xEEEEEE, 0x666666, 0x666666, 0xEEEEEE, 0x262626, tostring(MineOSCore.properties.resolution and MineOSCore.properties.resolution[2] or 50), "Height", true))
|
||||
local heightTextBox = container.layout:addChild(GUI.input(1, 1, 36, 3, 0xE1E1E1, 0x666666, 0x666666, 0xE1E1E1, 0x2D2D2D, tostring(MineOSCore.properties.resolution and MineOSCore.properties.resolution[2] or 50), "Height", true))
|
||||
heightTextBox.validator = function(text)
|
||||
local number = tonumber(text)
|
||||
if number then return number >= 1 and number <= 50 end
|
||||
@ -638,7 +639,7 @@ local function createOSWindow()
|
||||
menu:addItem(MineOSCore.localization.wallpaper).onTouch = function()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.wallpaper)
|
||||
|
||||
local filesystemChooser = container.layout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xEEEEEE, 0x262626, 0x444444, 0x999999, MineOSCore.properties.wallpaper, MineOSCore.localization.open, MineOSCore.localization.cancel, MineOSCore.localization.wallpaperPath, "/"))
|
||||
local filesystemChooser = container.layout:addChild(GUI.filesystemChooser(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x444444, 0x999999, MineOSCore.properties.wallpaper, MineOSCore.localization.open, MineOSCore.localization.cancel, MineOSCore.localization.wallpaperPath, "/"))
|
||||
filesystemChooser:addExtensionFilter(".pic")
|
||||
filesystemChooser.onSubmit = function(path)
|
||||
MineOSCore.properties.wallpaper = path
|
||||
@ -648,12 +649,12 @@ local function createOSWindow()
|
||||
MineOSInterface.OSDraw()
|
||||
end
|
||||
|
||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xEEEEEE, 0x262626, 0x444444, 0x999999))
|
||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x444444, 0x999999))
|
||||
comboBox.selectedItem = MineOSCore.properties.wallpaperMode or 1
|
||||
comboBox:addItem(MineOSCore.localization.wallpaperModeStretch)
|
||||
comboBox:addItem(MineOSCore.localization.wallpaperModeCenter)
|
||||
|
||||
local switch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x1E1E1E, 0xEEEEEE, 0xBBBBBB, MineOSCore.localization.wallpaperEnabled .. ":", MineOSCore.properties.wallpaperEnabled)).switch
|
||||
local switch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x1E1E1E, 0xE1E1E1, 0xBBBBBB, MineOSCore.localization.wallpaperEnabled .. ":", MineOSCore.properties.wallpaperEnabled)).switch
|
||||
container.layout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x555555, {MineOSCore.localization.wallpaperSwitchInfo}, 1, 0, 0, true, true))
|
||||
|
||||
switch.onStateChanged = function()
|
||||
@ -675,7 +676,7 @@ local function createOSWindow()
|
||||
menu:addItem(MineOSCore.localization.screensaver).onTouch = function()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.screensaver)
|
||||
|
||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xEEEEEE, 0x262626, 0x444444, 0x999999))
|
||||
local comboBox = container.layout:addChild(GUI.comboBox(1, 1, 36, 3, 0xE1E1E1, 0x2D2D2D, 0x444444, 0x999999))
|
||||
local fileList = fs.sortedList(screensaversPath, "name", false)
|
||||
for i = 1, #fileList do
|
||||
comboBox:addItem(fs.hideExtension(fileList[i]))
|
||||
@ -683,8 +684,8 @@ local function createOSWindow()
|
||||
comboBox.selectedItem = i
|
||||
end
|
||||
end
|
||||
local switch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x1E1E1E, 0xEEEEEE, 0xBBBBBB, MineOSCore.localization.screensaverEnabled .. ":", MineOSCore.properties.screensaverEnabled)).switch
|
||||
local slider = container.layout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0x2D2D2D, 0xEEEEEE, 0xBBBBBB, 1, 100, MineOSCore.properties.screensaverDelay or 20, false, MineOSCore.localization.screensaverDelay .. ": ", ""))
|
||||
local switch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x1E1E1E, 0xE1E1E1, 0xBBBBBB, MineOSCore.localization.screensaverEnabled .. ":", MineOSCore.properties.screensaverEnabled)).switch
|
||||
local slider = container.layout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0x1E1E1E, 0xE1E1E1, 0xBBBBBB, 1, 80, MineOSCore.properties.screensaverDelay, false, MineOSCore.localization.screensaverDelay .. ": ", ""))
|
||||
|
||||
container.panel.eventHandler = function(mainContainer, object, eventData)
|
||||
if eventData[1] == "touch" then
|
||||
@ -705,11 +706,14 @@ local function createOSWindow()
|
||||
menu:addItem(MineOSCore.localization.colorScheme).onTouch = function()
|
||||
local container = MineOSInterface.addUniversalContainer(MineOSInterface.mainContainer, MineOSCore.localization.colorScheme)
|
||||
|
||||
|
||||
|
||||
|
||||
local backgroundColorSelector = container.layout:addChild(GUI.colorSelector(1, 1, 36, 3, MineOSCore.properties.backgroundColor or 0x0F0F0F, MineOSCore.localization.backgroundColor))
|
||||
local menuColorSelector = container.layout:addChild(GUI.colorSelector(1, 1, 36, 3, MineOSCore.properties.menuColor or 0xFFFFFF, MineOSCore.localization.menuColor))
|
||||
local dockColorSelector = container.layout:addChild(GUI.colorSelector(1, 1, 36, 3, MineOSCore.properties.dockColor or 0xFFFFFF, MineOSCore.localization.dockColor))
|
||||
|
||||
local switch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x1E1E1E, 0xEEEEEE, 0xEEEEEE, MineOSCore.localization.transparencyEnabled .. ":", MineOSCore.properties.transparencyEnabled)).switch
|
||||
local switch = container.layout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0x1E1E1E, 0xE1E1E1, 0xE1E1E1, MineOSCore.localization.transparencyEnabled .. ":", MineOSCore.properties.transparencyEnabled)).switch
|
||||
switch.onStateChanged = function()
|
||||
MineOSCore.properties.transparencyEnabled = switch.state
|
||||
MineOSCore.saveProperties()
|
||||
@ -721,6 +725,25 @@ local function createOSWindow()
|
||||
end
|
||||
container.layout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x555555, {MineOSCore.localization.transparencySwitchInfo}, 1, 0, 0, true, true))
|
||||
|
||||
-- container.layout:addChild(GUI.object(1, 1, 1, 1))
|
||||
container.layout:addChild(GUI.label(1, 1, container.width, 1, 0xE1E1E1, MineOSCore.localization.spaceBetweenIcons):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top))
|
||||
|
||||
local horizontalSpaceBetweenIconsSlider = container.layout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0x1E1E1E, 0xE1E1E1, 0xBBBBBB, 0, 5, MineOSCore.properties.horizontalSpaceBetweenIcons, false, MineOSCore.localization.byHorizontal .. ": ", ""))
|
||||
local verticalSpaceBetweenIconsSlider = container.layout:addChild(GUI.slider(1, 1, 36, 0x66DB80, 0x1E1E1E, 0xE1E1E1, 0xBBBBBB, 0, 5, MineOSCore.properties.verticalSpaceBetweenIcons, false, MineOSCore.localization.byVertical .. ": ", ""))
|
||||
horizontalSpaceBetweenIconsSlider.roundValues, verticalSpaceBetweenIconsSlider.roundValues = true, true
|
||||
|
||||
horizontalSpaceBetweenIconsSlider.onValueChanged = function()
|
||||
MineOSCore.properties.horizontalSpaceBetweenIcons = math.floor(horizontalSpaceBetweenIconsSlider.value)
|
||||
MineOSInterface.mainContainer.iconField:deleteIconConfig()
|
||||
MineOSInterface.mainContainer.dockContainer.sort()
|
||||
|
||||
computer.pushSignal("MineOSCore", "updateFileList")
|
||||
end
|
||||
|
||||
verticalSpaceBetweenIconsSlider.onValueChanged = function()
|
||||
GUI.error(verticalSpaceBetweenIconsSlider.value)
|
||||
end
|
||||
|
||||
-- Шоб рисовалось в реальном времени
|
||||
backgroundColorSelector.onTouch = function()
|
||||
MineOSCore.properties.backgroundColor = backgroundColorSelector.color
|
||||
|
||||
@ -1312,6 +1312,7 @@ function GUI.titledWindow(x, y, width, height, title, addTitlePanel)
|
||||
window.backgroundPanel.localPosition.y, window.backgroundPanel.height = 2, window.height - 1
|
||||
end
|
||||
window.titleLabel = window:addChild(GUI.label(1, 1, width, height, GUI.colors.windows.title.text, title)):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top)
|
||||
window.actionButtons.localPosition.y = 1
|
||||
window.actionButtons:moveToFront()
|
||||
|
||||
return window
|
||||
|
||||
@ -58,32 +58,12 @@ function MineOSCore.saveProperties()
|
||||
end
|
||||
|
||||
function MineOSCore.loadPropeties()
|
||||
local saveLater = false
|
||||
|
||||
if filesystem.exists(MineOSPaths.properties) then
|
||||
MineOSCore.properties = table.fromFile(MineOSPaths.properties)
|
||||
else
|
||||
MineOSCore.properties = {
|
||||
language = "Russian",
|
||||
transparencyEnabled = true,
|
||||
showApplicationIcons = true,
|
||||
wallpaper = MineOSPaths.pictures .. "TyanSunset.pic",
|
||||
screensaver = "Matrix",
|
||||
screensaverDelay = 20,
|
||||
showHelpOnApplicationStart = true,
|
||||
dockShortcuts = {
|
||||
MineOSPaths.applications .. "AppMarket.app/",
|
||||
MineOSPaths.applications .. "MineCode IDE.app/",
|
||||
MineOSPaths.applications .. "Finder.app/",
|
||||
MineOSPaths.applications .. "Photoshop.app/",
|
||||
MineOSPaths.applications .. "Control.app/",
|
||||
},
|
||||
backgroundColor = 0x1E1E1E,
|
||||
network = {
|
||||
users = {},
|
||||
enabled = true,
|
||||
signalStrength = 512,
|
||||
},
|
||||
extensionAssociations = {},
|
||||
}
|
||||
MineOSCore.properties = {}
|
||||
|
||||
MineOSCore.associateExtension(".pic", MineOSPaths.applications .. "/Photoshop.app/Main.lua", MineOSPaths.icons .. "/Image.pic", MineOSPaths.extensionAssociations .. "Pic/ContextMenu.lua")
|
||||
MineOSCore.associateExtension(".txt", MineOSPaths.editor, MineOSPaths.icons .. "/Text.pic")
|
||||
@ -94,6 +74,45 @@ function MineOSCore.loadPropeties()
|
||||
MineOSCore.associateExtension(".lua", MineOSPaths.extensionAssociations .. "Lua/Launcher.lua", MineOSPaths.icons .. "/Lua.pic", MineOSPaths.extensionAssociations .. "Lua/ContextMenu.lua")
|
||||
MineOSCore.associateExtension(".pkg", MineOSPaths.extensionAssociations .. "Pkg/Launcher.lua", MineOSPaths.icons .. "/Archive.pic")
|
||||
|
||||
saveLater = true
|
||||
end
|
||||
|
||||
local defaultValues = {
|
||||
language = "Russian",
|
||||
showHelpOnApplicationStart = true,
|
||||
transparencyEnabled = true,
|
||||
showApplicationIcons = true,
|
||||
horizontalSpaceBetweenIcons = 1,
|
||||
verticalSpaceBetweenIcons = 1,
|
||||
showExtension = false,
|
||||
backgroundColor = 0x1E1E1E,
|
||||
wallpaper = MineOSPaths.pictures .. "TyanSunset.pic",
|
||||
wallpaperMode = 1,
|
||||
screensaver = "Matrix",
|
||||
screensaverDelay = 20,
|
||||
timezone = 3,
|
||||
dockShortcuts = {
|
||||
MineOSPaths.applications .. "AppMarket.app/",
|
||||
MineOSPaths.applications .. "MineCode IDE.app/",
|
||||
MineOSPaths.applications .. "Finder.app/",
|
||||
MineOSPaths.applications .. "Photoshop.app/",
|
||||
MineOSPaths.applications .. "Control.app/",
|
||||
},
|
||||
network = {
|
||||
users = {},
|
||||
enabled = true,
|
||||
signalStrength = 512,
|
||||
},
|
||||
}
|
||||
|
||||
for key, value in pairs(defaultValues) do
|
||||
if not MineOSCore.properties[key] then
|
||||
MineOSCore.properties[key] = value
|
||||
saveLater = true
|
||||
end
|
||||
end
|
||||
|
||||
if saveLater then
|
||||
MineOSCore.saveProperties()
|
||||
end
|
||||
end
|
||||
@ -101,6 +120,7 @@ end
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function MineOSCore.associateExtensionLauncher(extension, pathToLauncher)
|
||||
MineOSCore.properties.extensionAssociations = MineOSCore.properties.extensionAssociations or {}
|
||||
MineOSCore.properties.extensionAssociations[extension] = MineOSCore.properties.extensionAssociations[extension] or {}
|
||||
MineOSCore.properties.extensionAssociations[extension].launcher = pathToLauncher
|
||||
end
|
||||
|
||||
@ -237,8 +237,8 @@ local function iconFieldUpdate(iconField)
|
||||
iconField.backgroundObject.width, iconField.backgroundObject.height = iconField.width, iconField.height
|
||||
iconField.iconsContainer.width, iconField.iconsContainer.height = iconField.width, iconField.height
|
||||
|
||||
iconField.iconCount.horizontal = math.floor((iconField.width - iconField.xOffset) / (MineOSInterface.iconWidth + iconField.spaceBetweenIcons.horizontal))
|
||||
iconField.iconCount.vertical = math.floor((iconField.height - iconField.yOffset) / (MineOSInterface.iconHeight + iconField.spaceBetweenIcons.vertical))
|
||||
iconField.iconCount.horizontal = math.floor((iconField.width - iconField.xOffset) / (MineOSInterface.iconWidth + MineOSCore.properties.horizontalSpaceBetweenIcons))
|
||||
iconField.iconCount.vertical = math.floor((iconField.height - iconField.yOffset) / (MineOSInterface.iconHeight + MineOSCore.properties.verticalSpaceBetweenIcons))
|
||||
iconField.iconCount.total = iconField.iconCount.horizontal * iconField.iconCount.vertical
|
||||
|
||||
return iconField
|
||||
@ -321,9 +321,9 @@ local function getCykaIconPosition(iconField)
|
||||
end
|
||||
end
|
||||
|
||||
x = x + MineOSInterface.iconWidth + iconField.spaceBetweenIcons.horizontal
|
||||
if x + MineOSInterface.iconWidth + iconField.spaceBetweenIcons.horizontal > iconField.iconsContainer.width then
|
||||
x, y = iconField.xOffset, y + MineOSInterface.iconHeight + iconField.spaceBetweenIcons.vertical
|
||||
x = x + MineOSInterface.iconWidth + MineOSCore.properties.horizontalSpaceBetweenIcons
|
||||
if x + MineOSInterface.iconWidth + MineOSCore.properties.horizontalSpaceBetweenIcons > iconField.iconsContainer.width then
|
||||
x, y = iconField.xOffset, y + MineOSInterface.iconHeight + MineOSCore.properties.verticalSpaceBetweenIcons
|
||||
end
|
||||
|
||||
return x, y
|
||||
@ -394,9 +394,9 @@ local function iconFieldUpdateFileList(iconField)
|
||||
icon.launchers = iconField.launchers
|
||||
icon:analyseExtension()
|
||||
|
||||
x = x + MineOSInterface.iconWidth + iconField.spaceBetweenIcons.horizontal
|
||||
if x + MineOSInterface.iconWidth + iconField.spaceBetweenIcons.horizontal - 1 > iconField.iconsContainer.width then
|
||||
x, y = iconField.xOffset, y + MineOSInterface.iconHeight + iconField.spaceBetweenIcons.vertical
|
||||
x = x + MineOSInterface.iconWidth + MineOSCore.properties.horizontalSpaceBetweenIcons
|
||||
if x + MineOSInterface.iconWidth + MineOSCore.properties.horizontalSpaceBetweenIcons - 1 > iconField.iconsContainer.width then
|
||||
x, y = iconField.xOffset, y + MineOSInterface.iconHeight + MineOSCore.properties.verticalSpaceBetweenIcons
|
||||
end
|
||||
end
|
||||
|
||||
@ -594,7 +594,7 @@ local function iconFieldSetWorkpath(iconField, path)
|
||||
return iconField
|
||||
end
|
||||
|
||||
function MineOSInterface.iconField(x, y, width, height, xSpaceBetweenIcons, ySpaceBetweenIcons, xOffset, yOffset, textColor, selectionColor, workpath)
|
||||
function MineOSInterface.iconField(x, y, width, height, xOffset, yOffset, textColor, selectionColor, workpath)
|
||||
local iconField = GUI.container(x, y, width, height)
|
||||
|
||||
iconField.colors = {
|
||||
@ -602,11 +602,6 @@ function MineOSInterface.iconField(x, y, width, height, xSpaceBetweenIcons, ySpa
|
||||
selection = selectionColor
|
||||
}
|
||||
|
||||
iconField.spaceBetweenIcons = {
|
||||
horizontal = xSpaceBetweenIcons,
|
||||
vertical = ySpaceBetweenIcons
|
||||
}
|
||||
|
||||
iconField.iconConfig = {}
|
||||
iconField.iconCount = {}
|
||||
iconField.fileList = {}
|
||||
@ -1204,7 +1199,7 @@ end
|
||||
function MineOSInterface.propertiesWindow(x, y, width, icon)
|
||||
local mainContainer, window = MineOSInterface.addWindow(GUI.titledWindow(x, y, width, 1, package.loaded.MineOSCore.localization.properties))
|
||||
|
||||
-- window.backgroundPanel.colors.transparency = 0.25
|
||||
window.backgroundPanel.colors.transparency = 0.2
|
||||
window:addChild(GUI.image(2, 3, icon.image))
|
||||
|
||||
local x, y = 11, 3
|
||||
@ -1214,12 +1209,15 @@ function MineOSInterface.propertiesWindow(x, y, width, icon)
|
||||
addKeyAndValue(window, x, y, package.loaded.MineOSCore.localization.path, " ")
|
||||
|
||||
local textBox = window:addChild(GUI.textBox(17, y, window.width - 18, 1, nil, 0x555555, {icon.path}, 1, 0, 0, true, true))
|
||||
window.onResize = function(width, height)
|
||||
window.backgroundPanel.width, window.backgroundPanel.height = width, height
|
||||
end
|
||||
window:resize(window.width, textBox.y + textBox.height)
|
||||
textBox.eventHandler = nil
|
||||
|
||||
window.actionButtons.minimize:delete()
|
||||
window.actionButtons.maximize:delete()
|
||||
|
||||
window.height = textBox.y + textBox.height
|
||||
window.backgroundPanel.width = window.width
|
||||
window.backgroundPanel.height = textBox.y + textBox.height
|
||||
|
||||
mainContainer:draw()
|
||||
buffer.draw()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user