mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 11:09:21 +01:00
Interface blurring option
This commit is contained in:
parent
55452b840b
commit
43e3bd75dc
@ -86,8 +86,9 @@ local updateFileList, editPublication, messagesItem
|
||||
|
||||
local workspace, window = system.addWindow(GUI.filledWindow(1, 1, 127, 33, 0xF0F0F0))
|
||||
|
||||
local leftListPanel = window:addChild(GUI.panel(1, 1, 23, 3, 0x2D2D2D))
|
||||
local leftList = window:addChild(GUI.list(1, 4, leftListPanel.width, 1, 3, 0, 0x2D2D2D, 0x787878, 0x2D2D2D, 0x787878, 0xF0F0F0, 0x2D2D2D, false))
|
||||
local leftListPanel = system.addBlurredOrDefaultPanel(window, 1, 1, 23, 1)
|
||||
|
||||
local leftList = window:addChild(GUI.list(1, 4, leftListPanel.width, 1, 3, 0, nil, 0x787878, nil, 0x787878, 0xF0F0F0, 0x2D2D2D, false))
|
||||
|
||||
local contentContainer = window:addChild(GUI.container(1, 1, 1, 1))
|
||||
|
||||
@ -1925,7 +1926,8 @@ messagesItem.onTouch = dialogs
|
||||
leftList:addItem(localization.settings).onTouch = settings
|
||||
|
||||
window.onResize = function(width, height)
|
||||
leftList.height = height - leftListPanel.height
|
||||
leftListPanel.height = height
|
||||
leftList.height = height - 3
|
||||
|
||||
window.backgroundPanel.localX = leftList.width + 1
|
||||
window.backgroundPanel.width = width - leftList.width
|
||||
|
||||
@ -62,10 +62,8 @@ local modeList = window:addChild(GUI.list(FTPButton.localX + FTPButton.width + 2
|
||||
modeList:setDirection(GUI.DIRECTION_HORIZONTAL)
|
||||
|
||||
local sidebarContainer = window:addChild(GUI.container(1, 4, config.sidebarWidth, 1))
|
||||
local sidebarPanel = sidebarContainer:addChild(GUI.object(1, 1, 1, 1, 0xFFFFFF))
|
||||
sidebarPanel.draw = function(object)
|
||||
screen.drawRectangle(object.x, object.y, object.width, object.height, 0x2D2D2D, sidebarItemColor, " ")
|
||||
end
|
||||
|
||||
local sidebarPanel = system.addBlurredOrDefaultPanel(sidebarContainer, 1, 1, 1, 1)
|
||||
|
||||
local itemsLayout = sidebarContainer:addChild(GUI.layout(1, 1, 1, 1, 1, 1))
|
||||
itemsLayout:setAlignment(1, 1, GUI.ALIGNMENT_HORIZONTAL_LEFT, GUI.ALIGNMENT_VERTICAL_TOP)
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "桌面背景",
|
||||
appearanceDock = "Dock背景",
|
||||
appearanceMenu = "目录背景",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "界面透明度",
|
||||
appearanceTransparencyInfo = "禁用最后两个选项将显著减少对CPU/GPU的直接调用次数并提高性能.",
|
||||
appearanceDropDownDefaultBackground = "下拉菜单背景",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "Bureaubladachtergrond",
|
||||
appearanceDock = "Taakbalk achtergrond",
|
||||
appearanceMenu = "Menu achtergrond",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "Interface transparantie",
|
||||
appearanceTransparencyInfo = "Het uitschakelen van de laatste twee opties zal het aantal directe oproepen naar de CPU / GPU aanzienlijk verminderen en de prestaties verbeteren",
|
||||
appearanceDropDownDefaultBackground = "Vervolgkeuzemenu-achtergrond",
|
||||
|
||||
@ -37,8 +37,9 @@
|
||||
appearanceDesktopBackground = "Desktop background",
|
||||
appearanceDock = "Dock background",
|
||||
appearanceMenu = "Menu background",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "Interface transparency",
|
||||
appearanceTransparencyInfo = "Disabling the last two options will significantly reduce the number of direct calls to the CPU / GPU and increase performance",
|
||||
appearanceTransparencyInfo = "Disabling the last three options will significantly reduce the number of direct calls to the CPU / GPU and increase performance",
|
||||
appearanceDropDownDefaultBackground = "Drop down menu background",
|
||||
appearanceDropDownDefaultText = "Drop down menu text",
|
||||
appearanceDropDownSeparator = "Drop down menu separator",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "Fond d'écran",
|
||||
appearanceDock = "Dock de couleur",
|
||||
appearanceMenu = "Couleur du menu",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "Transparence de l'interface",
|
||||
appearanceTransparencyInfo = "La désactivation des deux dernières options réduira considérablement le nombre d'appels directs au processeur / processeur graphique et augmentera les performances.",
|
||||
appearanceDropDownDefaultBackground = "Menu déroulant arrière-plan",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "Desktophintergrund",
|
||||
appearanceDock = "Dock Farbe",
|
||||
appearanceMenu = "Menü",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "Interface Transparenz",
|
||||
appearanceTransparencyInfo = "Das deaktivieren der letzten beiden Optionen reduziert die Anzahl der direkten Aufrufe an die CPU / GPU erheblich und erhöht die Leistung",
|
||||
appearanceDropDownDefaultBackground = "Dropdown-Menü hintergrund",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "Sfondo Desktop",
|
||||
appearanceDock = "Colore aggancio",
|
||||
appearanceMenu = "Menu",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "Trasparenza interfaccia",
|
||||
appearanceTransparencyInfo = "Disabilitare le ultime due opzioni ridurrà significativamente il numero di chiamate dirette alla CPU / GPU e aumenterà le prestazioni",
|
||||
appearanceDropDownDefaultBackground = "Sfondo menu a discesa",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "デスクトップの背景",
|
||||
appearanceDock = "Dockの背景",
|
||||
appearanceMenu = "Menuの背景",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "インターフェースの透明度",
|
||||
appearanceTransparencyInfo = "最後の2つのオプションを無効にすると、CPU / GPUへのアクセス数が大幅に減り、パフォーマンスが向上します。",
|
||||
appearanceDropDownDefaultBackground = "ドロップダウンメニューの背景",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "Фон рабочего стола",
|
||||
appearanceDock = "Цвет Dock",
|
||||
appearanceMenu = "Цвет меню",
|
||||
appearanceBlurEnabled = "Размытие интерфейса",
|
||||
appearanceTransparencyEnabled = "Прозрачность интерфейса",
|
||||
appearanceTransparencyInfo = "Отключение последних двух опций существенно снизит количество прямых обращений к CPU/GPU и увеличит производительность",
|
||||
appearanceDropDownDefaultBackground = "Фон контекстного меню",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "Fondo de Escritorio",
|
||||
appearanceDock = "Fondo del Dock",
|
||||
appearanceMenu = "Fondo del Menu",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "Transparecia de la Interfaz",
|
||||
appearanceTransparencyInfo = "Desactivar las Ultimas dos opciones va a reducir significativamenteel numero de llamadas directas a la CPU/GPU y incrementara el rendimiento",
|
||||
appearanceDropDownDefaultBackground = "Fondo del menú desplegable",
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
appearanceDesktopBackground = "Фон робочого столу",
|
||||
appearanceDock = "Колір Dock",
|
||||
appearanceMenu = "Колір меню",
|
||||
appearanceBlurEnabled = "Interface blurring",
|
||||
appearanceTransparencyEnabled = "Прозорість інтерфейсу",
|
||||
appearanceTransparencyInfo = "Відключення останніх двох опцій істотно знизить кількість прямих звернень до CPU / GPU і збільшить продуктивність",
|
||||
appearanceDropDownDefaultBackground = "Фон випадаючого меню",
|
||||
|
||||
@ -18,8 +18,9 @@ local scrollSpeed = 2
|
||||
|
||||
local workspace, window = system.addWindow(GUI.filledWindow(1, 1, 100, 29, 0xF0F0F0))
|
||||
|
||||
local leftPanel = window:addChild(GUI.panel(1, 1, 1, 1, 0x2D2D2D))
|
||||
window.actionButtons.localY = 2
|
||||
local leftPanel = system.addBlurredOrDefaultPanel(window, 1, 1, 1, 1)
|
||||
|
||||
window.actionButtons.localX, window.actionButtons.localY = 3, 2
|
||||
window.actionButtons:moveToFront()
|
||||
|
||||
local modulesLayout = window:addChild(GUI.layout(1, 3, 1, 1, 1, 1))
|
||||
|
||||
@ -18,7 +18,8 @@ module.onTouch = function()
|
||||
local showExtensionSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceExtensions .. ":", userSettings.filesShowExtension)).switch
|
||||
local showHiddenFilesSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceHidden .. ":", userSettings.filesShowHidden)).switch
|
||||
local showApplicationIconsSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceApplications .. ":", userSettings.filesShowApplicationIcon)).switch
|
||||
local transparencySwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceTransparencyEnabled .. ":", userSettings.interfaceTransparencyEnabled)).switch
|
||||
local transparencySwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0xFF4940, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceTransparencyEnabled .. ":", userSettings.interfaceTransparencyEnabled)).switch
|
||||
local blurSwitch = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0xFF4940, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.appearanceBlurEnabled .. ":", userSettings.interfaceBlurEnabled)).switch
|
||||
|
||||
window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0xA5A5A5, {localization.appearanceTransparencyInfo}, 1, 0, 0, true, true))
|
||||
|
||||
@ -80,12 +81,15 @@ module.onTouch = function()
|
||||
userSettings.filesShowHidden = showHiddenFilesSwitch.state
|
||||
userSettings.filesShowApplicationIcon = showApplicationIconsSwitch.state
|
||||
userSettings.interfaceTransparencyEnabled = transparencySwitch.state
|
||||
userSettings.interfaceBlurEnabled = blurSwitch.state
|
||||
|
||||
system.updateColorScheme()
|
||||
system.saveUserSettings()
|
||||
|
||||
computer.pushSignal("system", "updateFileList")
|
||||
end
|
||||
showHiddenFilesSwitch.onStateChanged, showApplicationIconsSwitch.onStateChanged, transparencySwitch.onStateChanged = showExtensionSwitch.onStateChanged, showExtensionSwitch.onStateChanged, showExtensionSwitch.onStateChanged
|
||||
|
||||
showHiddenFilesSwitch.onStateChanged, showApplicationIconsSwitch.onStateChanged, transparencySwitch.onStateChanged, blurSwitch.onStateChanged = showExtensionSwitch.onStateChanged, showExtensionSwitch.onStateChanged, showExtensionSwitch.onStateChanged, showExtensionSwitch.onStateChanged
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -543,6 +543,7 @@ local function pressableDraw(pressable)
|
||||
if background then
|
||||
screen.drawRectangle(pressable.x, pressable.y, pressable.width, pressable.height, background, text, " ")
|
||||
end
|
||||
|
||||
screen.drawText(math.floor(pressable.x + pressable.width / 2 - unicode.len(pressable.text) / 2), math.floor(pressable.y + pressable.height / 2), text, pressable.text)
|
||||
end
|
||||
|
||||
@ -3574,6 +3575,7 @@ end
|
||||
|
||||
local function listUpdate(list)
|
||||
local step, child = false
|
||||
|
||||
for i = 1, #list.children do
|
||||
child = list.children[i]
|
||||
-- Жмяканье пизды
|
||||
@ -3585,6 +3587,7 @@ local function listUpdate(list)
|
||||
else
|
||||
child.colors.default = list.colors.default
|
||||
end
|
||||
|
||||
child.colors.pressed, step = list.colors.selected, not step
|
||||
|
||||
-- Размеры хуйни
|
||||
@ -3673,7 +3676,10 @@ local function listCount(list)
|
||||
end
|
||||
|
||||
local function listDraw(list)
|
||||
screen.drawRectangle(list.x, list.y, list.width, list.height, list.colors.default.background, list.colors.default.text, " ")
|
||||
if list.colors.default.background then
|
||||
screen.drawRectangle(list.x, list.y, list.width, list.height, list.colors.default.background, list.colors.default.text, " ")
|
||||
end
|
||||
|
||||
layoutDraw(list)
|
||||
end
|
||||
|
||||
|
||||
@ -98,6 +98,9 @@ function system.getDefaultUserSettings()
|
||||
interfaceTransparencyDock = 0.4,
|
||||
interfaceTransparencyMenu = 0.2,
|
||||
interfaceTransparencyContextMenu = 0.2,
|
||||
interfaceBlurEnabled = false,
|
||||
interfaceBlurRadius = 3,
|
||||
interfaceBlurTransparency = 0.6,
|
||||
|
||||
interfaceColorDesktopBackground = 0x1E1E1E,
|
||||
interfaceColorDock = 0xE1E1E1,
|
||||
@ -2888,6 +2891,10 @@ function system.getDockContainer()
|
||||
return dockContainer
|
||||
end
|
||||
|
||||
function system.addBlurredOrDefaultPanel(container, x, y, width, height)
|
||||
return container:addChild(userSettings.interfaceBlurEnabled and GUI.blurredPanel(x, y, width, height, userSettings.interfaceBlurRadius, 0x0, userSettings.interfaceBlurTransparency) or GUI.panel(x, y, width, height, 0x2D2D2D))
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- Keeping temporary file's last modified timestamp as boot timestamp
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user