fixed scroll speed

This commit is contained in:
Chr1Z93 2023-10-14 11:02:55 +02:00
parent dea47d6b36
commit 27eb4aa3c3
3 changed files with 18 additions and 17 deletions

View File

@ -830,8 +830,6 @@ end
function update_list(contentToShow) function update_list(contentToShow)
if not library then return end if not library then return end
local ui = UI.getXmlTable()
-- set title according to type -- set title according to type
local cleanName = { local cleanName = {
campaigns = "Campaigns", campaigns = "Campaigns",
@ -843,13 +841,10 @@ function update_list(contentToShow)
UI.setValue("previewTitle", cleanName[contentToShow]) UI.setValue("previewTitle", cleanName[contentToShow])
-- addition of list items according to library file -- addition of list items according to library file
local update_height = find_tag_with_id(ui, 'ui_update_height') local childrenTable = {}
local update_children = find_tag_with_id(update_height.children, 'ui_update_point')
update_children.children = {}
for i, v in ipairs(library[contentToShow]) do for i, v in ipairs(library[contentToShow]) do
local key = contentToShow .. "_" .. i local key = contentToShow .. "_" .. i
table.insert(update_children.children, table.insert(childrenTable,
{ {
tag = 'Text', tag = 'Text',
value = v.name, value = v.name,
@ -861,7 +856,16 @@ function update_list(contentToShow)
}) })
end 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) UI.setXmlTable(ui)
end end

View File

@ -61,13 +61,10 @@
<!-- content list --> <!-- content list -->
<VerticalScrollView color="transparent" <VerticalScrollView color="transparent"
minHeight="100" minHeight="100"
flexibleHeight="100"> flexibleHeight="100"
<Panel id="ui_update_height" scrollSensitivity="24">
height="24"> <Panel id="ui_update_point">
<VerticalLayout id="ui_update_point" <!-- this will be filled via scripting -->
padding="10">
<Text>Please refresh to see available items.</Text>
</VerticalLayout>
</Panel> </Panel>
</VerticalScrollView> </VerticalScrollView>

View File

@ -79,7 +79,6 @@
<!-- Option Panel --> <!-- Option Panel -->
<TableLayout id="optionPanel" <TableLayout id="optionPanel"
class="window" class="window"
active="false"
rectAlignment="LowerRight" rectAlignment="LowerRight"
offsetXY="-50 80"> offsetXY="-50 80">
<!-- Header: Options --> <!-- Header: Options -->
@ -95,7 +94,8 @@
<!-- Scrollable part with options --> <!-- Scrollable part with options -->
<Row> <Row>
<Cell> <Cell>
<VerticalScrollView horizontalScrollbarVisibility="AutohideAndExpandViewport"> <VerticalScrollView horizontalScrollbarVisibility="AutohideAndExpandViewport"
scrollSensitivity="30">
<TableLayout columnWidths="0 100 75" <TableLayout columnWidths="0 100 75"
autoCalculateHeight="1" autoCalculateHeight="1"
cellPadding="10 5 5 5"> cellPadding="10 5 5 5">