Skip to content

Conversation

@moWerk
Copy link
Member

@moWerk moWerk commented Jul 26, 2025

Needed for the general renaming of quickSettings to quickPanel

moWerk added a commit to moWerk/asteroid-settings that referenced this pull request Jul 26, 2025
moWerk added a commit to moWerk/asteroid-settings that referenced this pull request Jul 26, 2025
beroset pushed a commit to AsteroidOS/asteroid-settings that referenced this pull request Nov 23, 2025
…QuickPanelPage (#100)

* Add initial version of the QuickSettingsPage

* Add quicksettings component and listitem to main.qml

* Add QuickSettingsPage.qml to resources.qrc

* Add drag-and-drop sorting to QuickSettingsOrder.qml

Implemented drag-and-drop reordering for quick settings toggles in a vertical
ListView, allowing users to sort 9 slots (3 top, 6 main) with a long press (500ms).
Added auto-scroll near edges, 150ms displaced animations for smooth transitions,
and immediate ConfigurationValue storage (/desktop/asteroid/quicksettings/[top|main]/slotX)
after each drop to persist order in QuickSettings.qml. Prevents duplicates within
top/main slots and includes a drag proxy for natural UX. Styled to match
QuickSettingsToggle and UnitsPage.qml layout.

* Enhance QuickSettingsPage.qml with transparent pill-shaped rows and full-screen ListView

- Redesigned rows to use 0.2 opacity for backgrounds, matching untoggled QuickSettingsToggle,
with #222222 color and 0.7 opacity icon backgrounds like toggled state. Made rows pill-shaped
with dynamic widths based on content (icon + label + equal padding), ensuring consistent
left/right spacing. Increased row height and content size by 20% for better legibility.
Extended ListView to the screen bottom to maximize scrollable area, removing bottom spacing.
Removed static separator line between top/main slots for cleaner design.
Doubled left/right padding in rows to prevent labels touching pill ends, set icon and label
to solid 1.0 opacity above background, increased only row height by 20% while keeping
content size original, and renamed file to QuickSettingsPage.qml.
Adjusted row height to 16 units with slimmer 14-unit pills, increased icon size to 10 units,
label to 8 units, and tightened spacing to 2 units for compact rows. Reduced top margin to
20 units, shortened animation duration to 120ms, and lowered long press to 400ms for faster
interaction. Changed page title to Quick Settings via qsTrId. Styled drag proxy with
semi-transparent #AA222222 background and 1-unit #222222 border for distinct dragging.

* Added translation support by extracting 11 new qsTrId strings (page title, empty slot, and
9 toggles) to i18n/*.ts files using lupdate-qt5 for localization.

* Refactor QuickSettingsPage.qml to use array-based configuration

Replaced 9 individual ConfigurationValue objects with two array-based ones for top and main
toggle rows, stored at /desktop/asteroid/quicksettings/top and /desktop/asteroid/quicksettings/main.
Enabled dynamic toggle counts by sizing ListModel based on array lengths, maintaining
drag-and-drop reordering, duplicate prevention, and immediate storage. Used new configuration
keys for a clean start while preserving pill-shaped rows, animations, translations, and
full-screen ListView design.

* Add toggle enable/disable option in QuickSettingsPage.qml

Introduced a toggleEnabled ConfigurationValue at /desktop/asteroid/quicksettings/enabled to
store per-toggle enabled states. Added a checkmark per row to toggle the enabled state,
clearing the slot to empty when disabled and dimming the row for visual feedback. Preserved
drag-and-drop functionality for disabled toggles, ensuring seamless reordering and
persistence across sessions.

* Change Quick Settings icon to ios-quicksettings.svg

* Refine QuickSettingsPage.qml UI for better visual consistency

Removed pill-shaped slotRect backgrounds, keeping only circular icon backgrounds to align
with AsteroidOS style. Updated dragProxy to a full-width, borderless Rectangle (#222222,
0.7 opacity) for dragged items. Set Row.spacing to Dims.l(2), removed extra spacers between
icon, label, and checkmark for tight alignment. Dropped custom font size in Label to match
PageHeader’s default, ensuring title text consistency with main settings page. Moved
checkmark to left of icon (Dims.l(2) spacing), outside Row, restoring clickable MouseArea
by separating it from dragArea, which now covers only icon and label. Shifted all row
content left by Dims.l(10) for round watch layout, anchoring checkmark to left margin.
Replaced displaced item preview with invisible Rectangle (same rowHeight) to eliminate
glitchy visuals during drag, ensuring clean dragProxy appearance. Restored ListView.displaced
animation (200ms, InOutQuad) to smoothly push rows during drag, testing slower timing for
fluid feel.

* Add Fixed Row and Sliding Row labels to QuickSettingsPage.qml

Introduced 'Fixed Row' label at index 0 to mark the two topToggles slots (index 1-2) and
'Sliding Row' label at index 3 to indicate mainToggles (index 4+) for the slider in
QuickSettings.qml. Labels are centered, use font.pixelSize: Dims.l(5), height: rowHeight * 0.75,
and scroll with the ListView. Blocked dragging labels and dropping items at index 0 or 3 to
enforce structure. Added mechanism to keep Sliding Row at index 3 after any drag-drop by
moving it back if displaced to index 2 or 4. Updated slotModel with type: 'label'/'toggle' to
avoid binding errors, ensuring discrete items and clean configuration updates.

Add config validation to QuickSettingsPage.qml to prevent empty UI

Added checks in slotModel Component.onCompleted to validate topToggles, mainToggles, and
toggleEnabled configurations. Resets topToggles mainToggles and toggleEnabled to all true if empty, undefined, or
invalid. Filters out invalid toggle IDs and pads topToggles to ensure two slots. Ensures
slotModel always populates 10 items (2 labels + 2 topToggles + 6 mainToggles), preventing
empty UI after config errors. Preserves Fixed Row (index 0), Sliding Row (index 3), and all
drag-drop functionality.

Polish QuickSettingsPage.qml UI with design tweaks

Set Fixed Row and Sliding Row labels to italic (font.italic: true) for visual distinction.
Reduced label row height to rowHeight * 0.5 (~8px) from 0.75 for compact look, keeping
font.pixelSize: Dims.l(5). Lowered dragProxy opacity to 0.5 from 0.7 for lighter dragged
item appearance. Added fake press highlight (Rectangle, #222222, 0.2 opacity) on toggle
items during dragArea press, fading in/out over 200ms (InOutQuad), visible only before
drag starts (400ms) or if scrolling list. Added Weblate translation comments  in slotModel
for proper i18n source text. Preserved config validation, drag rules, and all functionality.

* Add Battery Meter alignment toggle to QuickSettingsPage.qml

Added 'Battery Meter aligned to bottom?' config option (ConfigurationValue,
/desktop/asteroid/quicksettings/batteryBottom, default true) to let users choose
battery meter position in QuickSettings.qml. Implemented as a dynamic bottom label
in slotModel (type: config, appended last) with word-wrapped Text (left-aligned to
toggle checkmarks, Dims.l(10)), default font size, and right-aligned checkmark
(ios-checkmark-circle-outline/ios-circle-outline, Dims.l(10) margin). Prevents
dragging toggles to the last two indices (spacer at count-2, config at count-1), adding
~16px spacer item (type: spacer) before config and ~24px (rowHeight * 1.5) footer after
to ease bottom item manipulation and checkmark access on round screens. Entire page (list +
spacer + label) scrolls in ListView, avoiding MouseArea conflicts. Reduced fake press
highlight transition to 100ms (from 200ms) for snappier toggle tap feedback. Made config
label dynamic to support future toggle additions. Preserved all drag rules, config
validation, and UI styles.

* Implement quicksettings icon change based on batteryBottom value to reflect the orientation of the quicksettings batteryMeter in the main.qml quicksettings settings icon

* Reorder QuickSettings item to 4th position in main.qml settings page

- Moved QuickSettings item from 7th place (below launcher items) to 4th place, below Sound settings item.
- Improved visual harmony by aligning round QuickSettings icon after squarish icons for a cohesive look.
- Enhanced UX by placing QuickSettings in the top 4 spots, ensuring it’s always visible on settings app startup.

* Remove empty-slot logic and fix console errors in QuickSettingsPage

- Eliminated empty-slot logic and qsTrId('id-empty-slot') from QuickSettingsPage.qml.
- Fixed TypeError: Cannot read property 'toggleId' of undefined by ensuring only valid toggleIds are used.
- Updated slotModel to prevent appending empty toggleIds and enforce two valid toggles in top row.
- Corrected typo in property declaration from 'rowspan' to 'rowHeight' to fix layout issues and ReferenceError.
- Resolved TypeError in dragCheckmark by adding checks for valid draggedItemIndex and model access.
- Updated dragArea to reset draggedItemIndex before hiding dragProxy, preventing stale index errors.
- Added onContentYChanged and onMovementStarted handlers to abort drag on invalid scroll states.
- Enhanced scrollTimer with state validation, safeGet, and try-catch for robust drag handling.
- Improved dragArea with error handling for startDrag and onPositionChanged to prevent invalid drags.
- Added abortDrag function to centralize drag cleanup with error handling.
- Added safeGet utility to safely access object properties with fallback values.

Layout Regresson fixes

- Removed Column layout to prevent clipping and incorrect top spacing of ListView.
- Anchored ListView to screen top to allow scrolling under transparent PageHeader.
- Added ListView header to offset id-fixed-row below PageHeader initially, ensuring visibility.
- Moved PageHeader below ListView in code for rendering clarity, relying on default self-anchoring.
- Updated id-fixed-row and id-sliding-row translations to include 'Content'.
- Set ListView header height to title.height for minimal id-fixed-row spacing, blending seamlessly with PageHeader's fade.

Refactor Nomenclature

- Rename topToggles to fixedToggles and mainToggles to sliderToggles
- update topLength to fixedLength
- streamline nomenclature for clarity

* Fix TypeError in QuickSettingsPage.qml by preventing null width access and disabling overscroll

Resolved 'TypeError: Cannot read property 'width' of null' on overscrolling ListView by:
- Using safe width bindings (slotList.width instead of parent.width) in delegate and dragProxy
- Setting boundsBehavior to StopAtBounds to prevent overscroll, stabilizing delegate access
- Increasing cacheBuffer for better delegate recycling
Disabling overscroll also improves drag-and-drop usability by reducing list jitter.

* Refactor batteryBottom to options array and enhance QuickSettingsPage.qml with LabeledSwitch and Options label

- Renamed batteryBottom ConfigurationValue to options, using an object with batteryBottom, batteryAnimation, and batteryColored booleans
- Renamed batteryAnimations to batteryAnimation for clarity (single animation)
- Updated ListModel Component.onCompleted to:
  - Validate and append config items for batteryAnimation and batteryColored
  - Remove all spacers, relying on ListView header and footer for spacing
  - Add 'Options' label (id-options) as a divider between draggable items and battery-bottom config
- Updated translation texts to remove 'Meter': 'Battery aligned to bottom?', 'Show Battery Animation?', 'Enable colored Battery?'
- Modified config delegate to use LabeledSwitch:
  - Dynamically adjust height based on wrapped text (Math.max(rowHeight * 2, implicitHeight))
  - Set text, checked state, and onCheckedChanged to manage options array
  - Removed unnecessary font.pixelSize, leftPadding, rightPadding, topPadding as LabeledSwitch has built-in padding
- Updated main delegate to:
  - Respect dynamic config item heights using childrenRect.height
  - Remove spacer logic
- Increased toggle checkmark leftMargin to Dims.l(15) for consistency

* Update QuickSettingsPage.qml translations and remove debug artifacts

- Updated translation files to include latest strings: 'Options' (id-options), 'Battery aligned to bottom?' (id-battery-bottom), 'Show Battery Animation?' (id-battery-animation), 'Enable colored Battery?' (id-battery-colored)
- Removed console.log debug statements from drag-and-drop logic to clean up code

* Prevent empty rows in QuickSettings.qml with self-contained minimum toggle logic

- Modified QuickSettingsPage.qml toggle checkmark MouseArea to enforce minimum active toggles:
  - Fixed row: Minimum 1 active toggle
  - Slider row: Minimum 2 active toggles
- Implemented self-contained active toggle counting within MouseArea using fixedToggles and sliderToggles
- Prevented disabling toggles when minimum active count is reached, ensuring no empty rows

* Reorder Quicksettings to 3rd place in Quick Settings to account for long text/translation strings showing in the center, the widest part of round screens

* Handle hardware-dependent toggles and polish drag-and-drop in QuickSettingsPage.qml

- Added org.asteroid.utils import for DeviceInfo to check hasWlan and hasSpeaker
- Option to mark wifiToggle and soundToggle as unavailable, disabling them in toggleEnabled, sorting last, hiding checkmark, and matching inactive toggle opacity
- Fixed slider row toggle swapping on reload by persisting stable sorted order to sliderToggles.value
- Prevented dropping toggles below unavailable slider toggles using first unavailable index restriction
- Fixed cross-row toggle move persistence by updating listView property during drags
- Fixed toggle doubling when moving from fixed to slider row by tracking usedToggleIds and updating replacement toggle listView
- Fixed broken drag-and-drop by moving slotModel refresh to finalizeMove, ensuring real-time reordering and drop persistence
- Fixed disappearing displaced toggles by syncing listView before index-based assignment in updateConfiguration
- Fixed unavailable soundToggle visibility by appending to slotModel and sliderToggles.value, ensuring presence after QuickSettings load

* Prevent dropping toggles below the options label by adjusting the firstUnavailableIndex according to its position

* Restore autoscroll while dragging feature the slotList downwards

* Resolve ListView jump bug by adopting stripped-down scrolling logic

- Replaced scrollTimer with autoScrollTimer using scrollSpeed and explicit contentY clamping
- Updated dragProxy.y to follow mouse coordinates, decoupling from contentY
- Added clip: true and interactive: draggedItemIndex === -1 to ListView
- Removed initResetTimer with forceLayout and positionViewAtBeginning
- Adopted itemAt(slotList.width / 2, pos.y + slotList.contentY) for drop target detection
- Preserved complex version’s moveItems, restoreOriginalOrder, and toggle animations
- Excluded dropIndicator from stripped-down version
- Added contentY clamping in abortDrag and onReleased

* Ensure toggle swaps occur during slider-to-fixed drags

- Fixed slider-to-fixed move logic in moveItems to correctly swap toggles
- Deferred draggedItemIndex update until after successful move
- Updated onReleased handler to validate drops using draggedToggleId
- Added detailed logging for swap operations
- Preserved slotList.forceLayout() for visual consistency

* Prevent ListView jump by preserving contentY in abortDrag

- Removed contentY reset in abortDrag to respect header offset (e.g., contentY=-80)
- Removed contentY reset in onReleased for valid drops to maintain scroll position
- Remove all debug logging since the issue contentY jump issue is solved
- Ensures ListView stays at current scroll position (e.g., -33 or -80) after rejected drops

* Prevent ListView jump when dragging over header

- Added header offset handling in autoScrollTimer to allow negative contentY
- Skipped drag processing in onPositionChanged for dropY < 0 (header area)
- Aborted drags in onReleased when dropY < 0 to prevent list jump
- Ensures stable ListView position during header drags

* Eliminate sticky pressHighlight and dragProxy glitches

- Reset pressHighlight and stop longPressTimer at start of onReleased to clear state for all presses
- Unified drag cleanup in onReleased to always reset dragProxy, draggedItemIndex, and targetIndex
- Removed redundant abortDrag calls for invalid drops, simplifying state management
- Increased autoScrollTimer scrollSpeed to 25 for smoother drag scrolling
- Fixes stuck highlights, unresponsive toggles, and persistent dragProxy

* Add smooth animations for inter-row toggle swaps

- Introduced moveTimer with 50ms delay to stagger slotModel.move operations in inter-row swaps
- Added crossRowMoveInProgress flag to track inter-row move state
- Implemented ListView move and add transitions for consistent 200ms Easing.InOutQuad animations
- Moved saveConfiguration to moveTimer for inter-row swaps to ensure model consistency
- Ensures fluid animations for fixed-to-slider and slider-to-fixed toggle movements

* Enhance handling of unavailable toggles in quick settings

- Added sortToggles function to prioritize available toggles in fixed and slider rows
- Updated refreshModel to sort fixedToggles and sliderToggles by availability
- Modified fixed row population to prefer available toggles, falling back to unavailable ones
- Adjusted iconRectangle, toggleIcon, and Label opacities to visually distinguish unavailable toggles
- Restricted dragArea to available toggles only, preventing interaction with unavailable ones
- Maintained smooth 200ms Easing.InOutQuad animations for all toggle swaps

* Enforce valid drop positions for toggle drag-and-drop

- Added isValidDropPosition function to validate drop targets, preventing drops on non-toggles or below unavailable toggles
- Updated moveItems, onPositionChanged, and onReleased to use isValidDropPosition for stricter drag-and-drop rules
- Maintained sorted order of available/unavailable toggles in fixed and slider rows
- Preserved 200ms Easing.InOutQuad animations for all toggle swaps

* Unify highlight visuals with HighlightBar for toggles and drag proxy

- Replaced pressHighlight Rectangle with HighlightBar in ListView delegate for consistent white #33ffffff highlights
- Updated dragProxy background to use HighlightBar with containsPress bound to visibility, matching toggle highlight style
- Removed manual opacity changes in dragArea, leveraging HighlightBar's 150ms Easing.OutQuad ColorAnimation
- Ensured visual consistency with LabeledSwitch highlights, enhancing overall UI polish
- Preserved 200ms Easing.InOutQuad animations and drag-and-drop functionality

* Add OptionCycler component to QuickSettingsPage.qml for particle design selection

- Extended options config to include particleDesign, aligning with QuickSettings.qml.
- Introduced particleDesigns array with design options: diamonds, bubbles, logos, flashes.
- Added necessary imports: QtGraphicalEffects 1.15 for OpacityMask, Nemo.Mce 1.0, and MCE components (MceBatteryLevel, MceBatteryState, MceChargerType) for batteryMeter functionality.
- Created new OptionCycler component in org.asteroid.controls, analogous to LabeledSwitch, with documentation and example, for cycling through configuration values without battery meter.
- Replaced inline optionCycler item in QuickSettingsPage.qml with new OptionCycler component for particleDesign selection.
- Moved batteryMeter to a separate static display slot with label 'id-battery-preview', maintaining parameters (toggleSize: Dims.l(28), no states/Connections/Component.onCompleted).
- Updated refreshModel to include new display slot and findOptionsLabelIndex to account for additional slot.
- Ensured OptionCycler and batteryMeter (display type) cannot be dragged and prevent toggle drops, consistent with LabeledSwitch behavior.
- Modified isValidDropPosition to include display type in non-droppable items.
- Added title property to OptionCycler for context, with height set to rowHeight * 2, title label top/left-aligned, and value label below right-aligned.
- Reordered LabeledSwitch items in QuickSettings.qml to place id-battery-colored before id-battery-animation.
- Implemented touch disabling for id-particle-design OptionCycler when id-battery-animation is disabled, with 0.5 opacity, using conditional HighlightBar onClicked handler to preserve ListView scrolling.

* Extend QuickSettingsPage.qml with live updating batteryMeter preview and particle system

- Added toggleOptions for toggle metadata and management.
- Enhanced batteryMeter with dynamic particle spawning (60px/s charging, 20px/s discharging), horizontal stratification, and clipping destruction.
- Set particle spawn intervals to 200ms (charging) and 750ms (discharging), with TTLs at 2500ms and 8500ms.
- Adjusted particle maxOpacity to 0.6, aligned with QuickSettings.qml.

* Add power-off and reboot toggles to QuickSettingsPage

Integrate 'powerOffToggle' and 'rebootToggle' into 'QuickSettingsPage.qml', enabling users to configure these toggles via the drag-and-drop interface. The toggles, introduced in 'QuickSettings.qml' with 'RemorseTimer' for safe power-off and reboot actions, are now manageable in the settings page.

Changes:
- Added 'powerOffToggle' and 'rebootToggle' to 'toggleOptions' with translated names ('qsTrId(id-toggle-power-off)', 'qsTrId(id-toggle-reboot)') and icons ('ios-power', 'ios-refresh').
- Updated 'sliderToggles' defaultValue to include 'powerOffToggle' and 'rebootToggle' in the sliding row.
- Extended 'toggleEnabled' defaultValue to enable both toggles by default.

Fix toggle order in QuickSettingsPage to respect toggleOptions

Correct the toggle order in 'QuickSettingsPage.qml' to ensure available toggles appear in the 'slotList' and 'sliderToggles' configuration in the order defined by 'toggleOptions', with unavailable toggles sorted alphabetically at the end. Previously, the 'powerOffToggle' and 'rebootToggle' (added in the prior commit) were sorted incorrectly due to the 'sortToggles' function ignoring 'toggleOptions' order for available toggles.

Changes:
- Updated 'sortToggles' to prioritize 'toggleOptions' index for available toggles, after sorting by availability.
- Rewrote 'refreshModel' to initialize 'fixedToggles' and 'sliderToggles' using 'toggleOptions' order for available toggles, appending unavailable toggles last.
- Ensured 'saveConfiguration' writes the correct order to dconf, placing 'powerOffToggle' and 'rebootToggle' at the end of available toggles.

Signed-off-by: Timo Könnecke <[email protected]>

* Add aodToggle to QuickSettingsPage with custom icons

Integrate 'aodToggle' into 'QuickSettingsPage.qml' to allow configuration of the always-on display (AoD) alongside other quick settings toggles.

Changes:
- Added 'aodToggle' to 'toggleOptions' with 'qsTrId(id-always-on-display)' and 'ios-watch-aod-on' icon from 'asteroid-icons-ion'.
- Updated 'sliderToggles' and 'toggleEnabled' to include before 'powerOffToggle'.

This enables users to enable, disable, and reorder the 'aodToggle' in the quick settings configuration UI, with proper internationalization and visual consistency.

Signed-off-by: Timo Könnecke <[email protected]>

* Update Translations

* Fix cross-row drag and drop behavior in QuickSettingsPage

- Simplify the cross-row drag logic by handling both directions in a single operation
- Remove two-step process that interrupted continuous drag operations
- Eliminate unnecessary moveTimer and crossRowMoveInProgress flag
- Improve position calculation during drag to better determine valid drop positions
- Ensure consistent behavior when dragging toggles between fixed and sliding rows
- Allow continuous drag operations between rows in both directions

* Optimize ListView:

- Reduce animation duration to 150ms (from 200ms)
- Use simpler easing functions (Linear or OutQuad instead of InOutQuad)
- Reduce cacheBuffer size

Signed-off-by: Timo Könnecke <[email protected]>

Signed-off-by: Timo Könnecke <[email protected]>

* Throttle timers and animations:

- Increase intervals for less critical animations
- Use running state management to disable timers when not needed

Signed-off-by: Timo Könnecke <[email protected]>

* Add musicToggle and flashlightToggle to QuickSettingsPage.qml for configuration in asteroid-settings

* Replace batteryMeter with ValueMeter in QuickSettingsPage.qml

- Replaced batteryMeter Item in slotList delegate with ValueMeter component for the battery preview, enabling reuse for other value types.
- Moved battery-specific color logic to ValueMeter's fillColor property, matching QuickSettings.qml behavior.
- Updated anchoring to maintain layout consistency.
- Removed erroneous particleTimer addition, as ValueMeter handles particle logic internally.
- Ensured compatibility with options.value settings for animations, colors, and particle design.

* Update translations for QuickSettingsPage

* Change DeviceInfo to DeviceSpecs, adapting to this change: AsteroidOS/asteroid-launcher#178

* Fix drag-and-drop bug in QuickSettingsPage.qml

Prevent list order reset when dropping a toggle below the last valid position in the sliding row.
- Updated isValidDropPosition to explicitly handle boundary cases, preventing drops into the options section.
- Modified MouseArea's onPositionChanged and onReleased to adjust dropIndex to the last valid toggle position.
- Removed restoreOriginalOrder from abortDrag to avoid unintended list resets.
- Ensured stable drag behavior at the end of the sliding row.

* Fix sliding and fixed row order reset in QuickSettingsPage.qml

Ensure user-defined order of sliding and fixed row toggles persists on page restart.
- Modified refreshModel to use sliderToggles.value directly, preserving user-defined order for sliding row.
- Split sliding row population into two loops: available toggles first, then unavailable toggles.
- Modified refreshModel to use fixedToggles.value directly, preserving user-defined order for fixed row.
- Split fixed row population into two loops: available toggles first, then unavailable toggles to fill slots.

* Enable full-row tap to toggle enable/disable state for quick settings.
As suggested by @MagenFire.
- Moved toggle logic to dragArea MouseArea's onReleased, using press duration (<400ms) to detect short taps.
- Preserved long-press (>400ms) for drag-and-drop with real-time item reordering.
- Removed checkmarkIcon MouseArea, making it a visual indicator only.

Co-authored-by: Darrel Griët <[email protected]>
Signed-off-by: Timo Könnecke <[email protected]>

* Force static startup of the listView using a loader

Eliminate ListView startup animations for instant, static display.
- Use Loader to defer ListView creation until model is fully populated.
- Apply forceLayout() to pre-position delegates, avoiding render glitches.

* Remove Checkmark and Refine UI

Polish QuickSettingsPage UI for consistency and better visibility.
- Remove checkmark icon from ListView delegate and dragProxy for cleaner layout.
- Remove PageHeader, set ListView header height to 0, and update autoScrollTimer minContentY to 0.
- Increase rowHeight to Dims.h(18) and use for all rows, removing labelHeight property.
- Increase iconRectangle size to Dims.w(16) and leftMargin to Dims.l(14) in delegate and dragProxy.
- Adjust opacity: iconRectangle (0.2 unavailable, 0.7 enabled), toggleIcon (0.4 unavailable, 0.8 disabled), Label (0.5 unavailable, 0.6 disabled), dragProxy (0.8 icon, 0.9 text).
- Increase label font.pixelSize to Dims.l(6) for better readability.
- Extend longPressTimer interval to 500ms to prevent accidental drags.
- Set boundsBehavior to Flickable.DragAndOvershootBounds for scroll feedback and to fix toggle misfires.

* Update translations with removed strings Link  from the app start buttons and Content from the slidng and fixed row labels

* Rename QuickSettingsPage to QuickPanelPage, depends on AsteroidOS/asteroid-icons-ion#26

* quickpanel: Reduce nesting and remove use of var

- Reduces nesting to improve code readability
- Reduce accessing to the model by fetching once and storing in
  variables
- Remove use of `var`, replacing it with `const` and `let` where
  relevant. Using `var` is a bad JavaScript practice as it can introduce
scoping issues.

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Fix resetting scrollspeed upon release

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Add more documentation to some blocks of code

Signed-off-by: Darrel Griët <[email protected]>

* wip: quickpanel: Remove redundant code

Signed-off-by: Darrel Griët <[email protected]>

* wip: quickpanel: More nesting reduction

Signed-off-by: Darrel Griët <[email protected]>

* wip: quickpanel: Remove some magic numbers and further nesting reduction

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Remove `available` logic

There is currently no use case for it, instead don't add toggles that
aren't available.

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Remove invisible header

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Remove another available related loop

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Ensure unused toggles are added to the sliding row

In the event that a toggle isn't in any of the fixed or sliding rows it
may never be added.
This ensures that it's added to the sliding row.

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: more documentation

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Fix potential endless loop

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Reduce use of findToggle

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Remove toggle sorting

It does not appear to be used.

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Remove findToggle and cache

Remove the for-loop for finding toggles, instead just use a dictionary
to access the toggles directly.

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Remove unused restore function

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Fix dropping inside an invalid region

Signed-off-by: Darrel Griët <[email protected]>

* quickpanel: Fix minor duplicate code

Signed-off-by: Darrel Griët <[email protected]>

---------

Signed-off-by: Timo Könnecke <[email protected]>
Signed-off-by: Darrel Griët <[email protected]>
Co-authored-by: Darrel Griët <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants