Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ListItem bottom padding into GradientListView and Column spacing #1904

Merged

Conversation

blammit
Copy link
Contributor

@blammit blammit commented Feb 14, 2025

Remove the built-in bottom padding from ListItem. This was previously required as a way to add spacing between items, instead of setting explicit 'spacing' on GradientListView or Column views, due to the fact that this would produce additional unwanted spacing for non-visible items within the view.

Now that visible items are no longer rendered by the view if VisibleItemModel is used, this built-in padding can be removed, and the spacing can be inserted directly into ListView and Column views instead.

Fixes #1827

@blammit blammit linked an issue Feb 14, 2025 that may be closed by this pull request
Remove the built-in bottom padding from ListItem. This was previously
required as a way to add spacing between items, instead of setting
explicit 'spacing' on GradientListView or Column views, due to the
fact that this would produce additional unwanted spacing for
non-visible items within the view.

Now that visible items are no longer rendered by the view if
VisibleItemModel is used, this built-in padding can be removed, and
the spacing can be inserted directly into ListView and Column views
instead.

Fixes #1827
@blammit blammit force-pushed the blam/1827-listitems-do-not-appear-to-be-the-right-height branch from f00d56f to e447c6a Compare February 17, 2025 03:40
dataItem.uid: Global.systemSettings.serviceUid + "/Settings/Gui/BriefView/Unit"
footer: Column {
width: parent.width
topPadding: Theme.geometry_gradientList_spacing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern is a bit ugly. I wonder if there's some more elegant solution? (Maybe add a "topSpacing" property to ListItem? but maybe that's just as bad or worse...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was wondering if ListItem should get a topPadding property, but wasn't sure ... I suppose it does already have left/right padding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this would have to be topMargin as it should be outside of the coloured background, rather than within it, unlike the padding. I'll leave it as-is for now, as it feels odd to have to build the margin back into the ListItem, when we've just removed it. @MikeTrahearn-Qinetic suggested that ListItem could eventually become a QtQuick control, which would also provide a built-in API for margin/padding.

Copy link
Contributor

@MikeTrahearn-Qinetic MikeTrahearn-Qinetic Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should definitely take a look as as separate topic, where it makes actual sense to use QtQuick.Controls Control as a base (or even some of the primitive Qt Quick Controls Templates) to bring a much needed architectural simplification across the whole design. This task would be made much easier if the Figma design was componentised like it should be.

I created #1919 as a placeholder.

Copy link
Contributor

@chriadam chriadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM although I had one nitpick/question

@blammit blammit merged commit f294665 into main Feb 17, 2025
2 checks passed
@blammit blammit deleted the blam/1827-listitems-do-not-appear-to-be-the-right-height branch February 17, 2025 22:29
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.

ListItems do not appear to be the right height
3 participants