From 27eb4aa3c37c3bde44a4b61aa817d3d93356eea3 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 14 Oct 2023 11:02:55 +0200 Subject: [PATCH] fixed scroll speed --- src/core/Global.ttslua | 20 ++++++++++++-------- xml/Global/DownloadWindow.xml | 11 ++++------- xml/Global/OptionPanel.xml | 4 ++-- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index edf6f865..31dbb110 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -830,8 +830,6 @@ end function update_list(contentToShow) if not library then return end - local ui = UI.getXmlTable() - -- set title according to type local cleanName = { campaigns = "Campaigns", @@ -843,13 +841,10 @@ function update_list(contentToShow) UI.setValue("previewTitle", cleanName[contentToShow]) -- addition of list items according to library file - local update_height = find_tag_with_id(ui, 'ui_update_height') - local update_children = find_tag_with_id(update_height.children, 'ui_update_point') - update_children.children = {} - + local childrenTable = {} for i, v in ipairs(library[contentToShow]) do local key = contentToShow .. "_" .. i - table.insert(update_children.children, + table.insert(childrenTable, { tag = 'Text', value = v.name, @@ -861,7 +856,16 @@ function update_list(contentToShow) }) end - update_height.attributes.height = #(update_children.children) * 24 + local ui = UI.getXmlTable() + local update_point = find_tag_with_id(ui, 'ui_update_point') + update_point.children = { + tag = 'VerticalLayout', + attributes = { + padding = "10 10 0 0" + }, + children = childrenTable + } + update_point.attributes.height = #childrenTable * 24 UI.setXmlTable(ui) end diff --git a/xml/Global/DownloadWindow.xml b/xml/Global/DownloadWindow.xml index 816f9244..98becdaf 100644 --- a/xml/Global/DownloadWindow.xml +++ b/xml/Global/DownloadWindow.xml @@ -61,13 +61,10 @@ - - - Please refresh to see available items. - + flexibleHeight="100" + scrollSensitivity="24"> + + diff --git a/xml/Global/OptionPanel.xml b/xml/Global/OptionPanel.xml index 78881a7d..7534c85e 100644 --- a/xml/Global/OptionPanel.xml +++ b/xml/Global/OptionPanel.xml @@ -79,7 +79,6 @@ @@ -95,7 +94,8 @@ - +