НУ, ЗНАЯ ФЕДЮ

This commit is contained in:
IgorTimofeev 2023-10-08 22:20:04 +03:00
parent 52efbbcc81
commit 1f4d264090
5 changed files with 34 additions and 12 deletions

View File

@ -96,7 +96,15 @@ local updateFileList, editPublication, messagesItem
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
local workspace, window = system.addWindow(GUI.filledWindow(1, 1, 127, 33, 0xF0F0F0)) local windowsContainer = system.getWindowsContainer()
local workspace, window, menu = system.addWindow(GUI.filledWindow(
1,
1,
math.min(127, windowsContainer.width),
math.min(33, windowsContainer.height),
0xF0F0F0
))
local leftListPanel = system.addBlurredOrDefaultPanel(window, 1, 1, 23, 1) local leftListPanel = system.addBlurredOrDefaultPanel(window, 1, 1, 23, 1)
@ -428,7 +436,9 @@ local function checkForUnreadMessages()
for _, dialog in pairs(dialogs) do for _, dialog in pairs(dialogs) do
if dialog.last_message_user_id ~= user.id and dialog.last_message_is_read == 0 then if dialog.last_message_user_id ~= user.id and dialog.last_message_is_read == 0 then
messagesItem.has_unread_messages = true messagesItem.has_unread_messages = true
break workspace:draw()
return
end end
end end
end end
@ -1082,6 +1092,7 @@ end
local function dialogGUI(to_user_name) local function dialogGUI(to_user_name)
local messages local messages
if to_user_name then if to_user_name then
local result = fieldAPIRequest("result", "messages", { local result = fieldAPIRequest("result", "messages", {
token = user.token, token = user.token,
@ -2051,9 +2062,6 @@ end
loadConfig() loadConfig()
-- Рисуем синюю писечку если надо
checkForUnreadMessages()
lastMethod = loadCategory lastMethod = loadCategory
if select(1, ...) == "updates" then if select(1, ...) == "updates" then
@ -2065,3 +2073,6 @@ else
end end
window:resize(window.width, window.height) window:resize(window.width, window.height)
-- Рисуем синюю писечку если надо
checkForUnreadMessages()

View File

@ -43,7 +43,15 @@ local pathHistoryCurrent = 0
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 100, 26, 0xF0F0F0)) local windowsContainer = system.getWindowsContainer()
local workspace, window, menu = system.addWindow(GUI.filledWindow(
1,
1,
math.min(100, windowsContainer.width),
math.min(26, windowsContainer.height),
0xF0F0F0
))
local titlePanel = window:addChild(GUI.panel(1, 1, 1, 3, 0x3C3C3C)) local titlePanel = window:addChild(GUI.panel(1, 1, 1, 3, 0x3C3C3C))

View File

@ -90,7 +90,7 @@ module.onTouch = function()
local maxWidth, maxHeight = screen.getMaxResolution() local maxWidth, maxHeight = screen.getMaxResolution()
local limit = maxWidth * maxHeight local limit = maxWidth * maxHeight
local lowerLimit = 30 local lowerLimit = 25
local cykaTextBox = window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x880000, {string.format(localization.screenInvalidResolution, lowerLimit, limit)}, 1, 0, 0, true, true)) local cykaTextBox = window.contentLayout:addChild(GUI.textBox(1, 1, 36, 1, nil, 0x880000, {string.format(localization.screenInvalidResolution, lowerLimit, limit)}, 1, 0, 0, true, true))
local autoscalingSwtich = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.screenAutoScale .. ":", userSettings.interfaceScreenAutoScale)).switch local autoscalingSwtich = window.contentLayout:addChild(GUI.switchAndLabel(1, 1, 36, 8, 0x66DB80, 0xE1E1E1, 0xFFFFFF, 0xA5A5A5, localization.screenAutoScale .. ":", userSettings.interfaceScreenAutoScale)).switch
@ -111,8 +111,8 @@ module.onTouch = function()
width width
and height and height
and width * height <= limit and width * height <= limit
and width > lowerLimit and width >= lowerLimit
and height > lowerLimit and height >= lowerLimit
return width, height return width, height
end end

View File

@ -4156,8 +4156,11 @@ function GUI.dropDownMenu(x, y, width, maximumHeight, itemHeight, backgroundColo
menu.scrollSpeed = 1 menu.scrollSpeed = 1
menu.itemsContainer = menu:addChild(GUI.container(1, 1, menu.width, menu.height)) menu.itemsContainer = menu:addChild(GUI.container(1, 1, menu.width, menu.height))
menu.prevButton = menu:addChild(GUI.button(1, 1, menu.width, 1, backgroundColor, textColor, backgroundPressedColor, textPressedColor, ""))
menu.nextButton = menu:addChild(GUI.button(1, 1, menu.width, 1, backgroundColor, textColor, backgroundPressedColor, textPressedColor, "")) -- RIP ▲▼
-- ⬆⬇
menu.prevButton = menu:addChild(GUI.button(1, 1, menu.width, 1, backgroundColor, textColor, backgroundPressedColor, textPressedColor, ""))
menu.nextButton = menu:addChild(GUI.button(1, 1, menu.width, 1, backgroundColor, textColor, backgroundPressedColor, textPressedColor, ""))
menu.prevButton.colors.transparency, menu.nextButton.colors.transparency = backgroundTransparency, backgroundTransparency menu.prevButton.colors.transparency, menu.nextButton.colors.transparency = backgroundTransparency, backgroundTransparency
menu.prevButton.onTouch = dropDownMenuPrevButtonOnTouch menu.prevButton.onTouch = dropDownMenuPrevButtonOnTouch
menu.nextButton.onTouch = dropDownMenuNextButtonOnTouch menu.nextButton.onTouch = dropDownMenuNextButtonOnTouch

View File

@ -2467,7 +2467,7 @@ function system.updateDesktop()
end end
dockContainer.width = #dockContainer.children * (userSettings.iconWidth + userSettings.iconHorizontalSpace) - userSettings.iconHorizontalSpace + 6 dockContainer.width = #dockContainer.children * (userSettings.iconWidth + userSettings.iconHorizontalSpace) - userSettings.iconHorizontalSpace + 6
dockContainer.localX = math.floor(workspace.width / 2 - dockContainer.width / 2) dockContainer.localX = math.floor(workspace.width / 2 - dockContainer.width / 2 + 0.5)
end end
dockContainer.updateIcons = function() dockContainer.updateIcons = function()