From 4af500bec08a6ff98ecae2adb4cf4ff5c135a828 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 4 Aug 2024 18:17:32 -0400 Subject: [PATCH] [opt] large textures loading --- CHANGELOG.md | 6 ++++++ .../LoadingIndicator/LoadingIndicator.bs | 12 ++++++++---- .../src/components/ChannelView/ChannelView.xml | 3 +++ .../components/QrCodePoster/QrCodePoster.bs | 18 ++++++++++-------- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07a0c9e3..7693273b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Few optimizations with texture loading to improve memory usage + ## [0.25.1] - 2024-08-03 ### Added diff --git a/playlet-app/src/components/LoadingIndicator/LoadingIndicator.bs b/playlet-app/src/components/LoadingIndicator/LoadingIndicator.bs index 860d7fd4..356a2d60 100644 --- a/playlet-app/src/components/LoadingIndicator/LoadingIndicator.bs +++ b/playlet-app/src/components/LoadingIndicator/LoadingIndicator.bs @@ -1,10 +1,14 @@ function Init() m.busySpinner = m.top.findNode("busySpinner") - m.busyspinner.poster.width = 150 - m.busyspinner.poster.height = 150 + poster = m.busyspinner.poster + poster.width = 150 + poster.height = 150 + poster.loadWidth = 150 + poster.loadHeight = 150 + poster.loadDisplayMode = "limitSize" ' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK - m.busyspinner.poster.observeField("loadStatus", "PositionSpinner") - m.busySpinner.poster.uri = "pkg:/images/spinner.png" + poster.observeField("loadStatus", "PositionSpinner") + poster.uri = "pkg:/images/spinner.png" ' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK m.top.observeField("visible", "OnVisibleChange") end function diff --git a/playlet-lib/src/components/ChannelView/ChannelView.xml b/playlet-lib/src/components/ChannelView/ChannelView.xml index 1ce40e90..d37ae070 100644 --- a/playlet-lib/src/components/ChannelView/ChannelView.xml +++ b/playlet-lib/src/components/ChannelView/ChannelView.xml @@ -17,6 +17,9 @@