Draft
Conversation
abbe246 to
54d6eb0
Compare
These types will be the building blocks of the new list items, which extend the QtQuick Control type. Using controls will greatly simplify the list item layouts and the list item API, since the current ListItem type requires paddings, margins and a background. Also, for portrait mode, some list items will need to implement a custom layout, so it will be easier to do that per-item (by changing individual contentItem implementations) instead of trying to implement a one-size-fits-all layout algorithm in the root ListItem type that cannot take all cases into account. Note: ListItemControl will be renamed to ListItem, once all existing ListItem-based types are ported to use ListItemControl. Contributes to #2789
Change ListText to extend ListSetting. This means it must implement its own layout, as the layout no longer comes from ListItem. Also avoid alias properties in the ListText API, as those are invalid if a derived type overrides the contentItem. Contributes to #2789
Change ListSwitch to extend ListSetting. This means it must implement its own layout, as the layout no longer comes from Listitem. Also avoid alias properties in ListSwitch, as those are invalid if derived types override the contentItem. Also fix the Switch layout to visually align the item correctly, and avoid unnecessary items. The contentItem Label is not needed as that would increase the touchable area, whereas the switch should only be activated when the visual indicator is pressed. Contributes to #2789
Change ListQuantity and ListQuantityGroup to extend ListSetting. This means they must implement their own layout, as the layout no longer comes from Listitem. Also avoid alias properties in the base type API, as those are invalid if derived types override the contentItem. Remove maximumContentWidth binding in PVCFListQuantityGroup as that is no longer available, and is not necessary in the new layout anyway. Remove the fixed height in QuantityRow as it's not necessary and it forces workarounds elsewhere to change the default height. Contributes to #2789
Change ListNavigation to extend ListSetting. This means it must implement its own layout, as the layout no longer comes from Listitem. Also avoid alias properties in the ListNavigation API, as those are invalid if derived types override the contentItem. As part of this change: - Change ListQuantityGroupNavigation to extend ListSetting directly, as its custom items do not fit within the ListNavigation layout. - Since ListQuantityGroupNavigation no longer has secondaryText, change DeviceListDelegate-derived types to use the QuantityModel for the purpose of adding secondary text. - Remove ListPressArea z:-1 so that the component can be used by ListNavigation. Move this binding into existing uses of ListPressArea which will be reworked later when removing ListItem. Contributes to #2789
Change ListRadioButton to extend ListSetting. This means it must implement its own layout, as the layout no longer comes from Listitem. As part of this change: - Add a contentItem to RadioButton to display the secondaryText for a ListRadioButton. - Update RadioButtonListPage to use the updated layout in ListRadioButton. Contributes to #2789
Change ListButton and ListLink to extend ListSetting. This means they must implement their own layouts, as the layouts no longer come from Listitem. Align the layouts of these two types, as they are very similar. Avoid alias properties in ListButton, as those are invalid if derived types override the contentItem. Remove the 'showEnabled' Button property; it is no longer needed. Only ListInverterChargerModeButton and ListCurrentLimitButton used this, and they can implement their own background items to provide the same behaviour. For ListItemButton, set a max width, and remove the flat binding as the button should still have an outline when disabled, as it would look like plain text otherwise, which is odd for an action-type button. Also remove ListLink_Mode enum as it is not really necessary. Contributes to #2789
Change ListSlider and ListRangeSlider to extend ListSetting. This means they must implement their own layouts, as the layouts no longer come from Listitem. Fix the geometries in Slider and RangeSlider to respect the paddings correctly when aligning their backgrounds, and avoid alias properties to the contentItem and handle in Slider, as those are invalid if derived types override the contentItem. Similarly, remove the 'slider' alias in ListSlider and ListRangeSlider, as the alias becomes invalid when the contentItem is overriden by a derived type. Provide properties to configure the to/from/stepSize/value slider properties. Contributes to #2789
Prepare to change ListTextField to extend ListSetting, which will result in the TextField being moved into the contentItem; at that point, the alias properties will not be accessible, so they must be removed. Contributes to #2789
Change ListTextField to extend ListSetting. This means it must implement its own layout, as the layout no longer comes from Listitem. This means the internal text field item can no longer be exposed outside of the type, since it is now created within the contentItem. Add TextValidationField type to encapsulate the text validation feature so that it can be used from RadioListButtonPage without creating a nested ListPasswordField. Remove ListPasswordField as it is no longer needed. Contributes to #2789
Move towards Control-based list items. Instead of using ListItem, which is not based on QtQuick Control, do one of the following: - Use ListSetting, if the component requires access-control parameters. The component will need to implement its own layout. - Use ListItemControl, if the component does not require access-control parameters. The component will need to implement its own layout. - Use an existing ListItemControl-derived type that already implements a layout. For example, if an item just displays secondary text, it can use ListText. This prepares for the removal of ListItem, followed by the renaming of ListItemControl to ListItem. Contributes to #2789
Move towards Control-based list items and prepare for the removal of BaseListItem. Where QuantityTable and QuantityTableSummary are used, replace BaseListItem with ListItemControl and adjust the paddings and insets accordingly. Set a better implicitWidth in QuantityTable so that the ListItemControl containers can just use the default table width instead of needing to bind to parent.width, because if the parent is a ListView, then parent.width includes the left/margins, which is too wide. Contributes to #2789
Move towards Control-based list items and prepare for the removal of BaseListItem. Instead of using BaseListItem, do one of the following: - Use ListItemControl, if the item is a list item that should receive focus. In this case, move the component layout to the control contentItem. For example: breadcrumb buttons, NotificationDelegate, SystemBatteryDelegate. - Use a plain FocusScopem and set focus=true and focusPolicy=Qt.TabFocus, if the item is a container that should receive focus but pass it onto its children - that is, the item is not a control in itself. For example: SettingsColumn, ControlCard. - Use some other non-focusable type if the item just needs a background, because it is already within a focusable container. For example: EnvironmentGaugePanel, TankItem. Also do some minor clean-up: - GaugeHeader: remove the internal extra Rectangle, which is no longer needed now that corner radii can be set individually in a Rectangle. - MultiStepButton: use MiniToggleButton for On/Off button, since this is already provided for SwitchableOutputDimmableSlider. Contributes to #2789
The theme files are the same as for 7", except: - Theme.geometry_screen_width = 393 - Theme.geometry_screen_height = 793 In mock mode, the 'O' key toggles between the Portrait and 5" sizes. Contributes to #2829 screen size
8e88ec0 to
5f1f061
Compare
Add StatusBar_Landscape with adaptations for the Portrait layout. Move various code out of StatusBar.qml, to reduce the code duplication between StatusBar and StatusBar_Portrait. Remove the MainView StatusBar alias as the item is now loaded dynamically. Contributes to #2829
Add portrait layout customisation for BriefSidePanelWidget, so that the BriefSidePanel can be shown below the main gauge on the Brief page. Contributes to #2829
- Add portrait layouts for various list item layouts. - Update various font sizes for portrait layout. - Use WordWrap instead of Wrap for primary and secondary labels, so that they do not wrap in the middle of the first word, causing those labels to bunch up. Contributes to #2829
5f1f061 to
79839d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.