aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/impl/qquickmaterialplaceholdertext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Set explicit default security level of all files with default securityJan Arve Sæther2025-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The files (folders) already processed are listed in each issue in epic QTBUG-134547 These files were processed half a year ago. In order to make it clear that all of these files are already processed, mark them with an explicit default security header. For the record, this was generated with this script: find -E . -regex ".*\.(cpp|h|hpp|mm|qml|js)$" | xargs python3 ~/bin/add-cra-header.py in the folders listed in each subtask of QTBUG-134547 (add-cra-header.py only exist at my desktop, but it simply adds the default security header if it doesn't already have any existing security header) QUIP: 23 Fixes: QTBUG-134547 Pick-to: 6.10 6.9 6.8 Change-Id: Ieb8c78ea6561fdbdd27c7b13185ece853eedf80f Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Material Style: fix focusIn and focusOut animation issuesMorteza Jamshidi2025-08-141-71/+38
| | | | | | | | | | | | When a property potentially used in focusIn or focusOut animation is changed, we need to reschedule the animation with the correct parameters. properties like verticalPadding, leftPadding, controlHasText, ... To fix the issue I simplified focus animation logic. Fixes: QTBUG-138028 Change-Id: I115fb6fdd5676ae0282b5b4b5bd460ea3b28392a Pick-to: 6.10 6.9 6.8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: Fix FloatingPlaceholderText X positionBartlomiej Moskal2025-02-281-0/+50
| | | | | | | | | | | | | | | | | | | In cb7eb152204e206539f307a9556eea43c589f026, we stopped using the leftPadding value for FloatingPlaceholderText. As a result, the text is now misaligned with the placeholder. This commit restores the FloatingPlaceholderText X position to leftPadding. If leftPadding is not set, it defaults to Material.textFieldHorizontalPadding. To prevent regressions (such as QTBUG-120149), a new X position animation has been added to FloatingPlaceholderText. Fixes: QTBUG-133492 Pick-to: 6.9 6.8 Change-Id: I5c80dcedd7c2beec0891b524fc55388fa5456f2a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: fix assertion failure when quickly changing TextField's focusMitch Curtis2024-02-151-1/+12
| | | | | | | | | | | | Focus changes can happen before the focus in/out animations finish. In that case, stop the animation, which will eventually delete it. Until it's deleted, we clear the pointer so that our asserts don't fail for the wrong reason. Fixes: QTBUG-118889 Pick-to: 6.6 6.7 Change-Id: I6398805c006dadac71e168126c7a387357d5d2b0 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Material: respect horizontalAlignment in placeholder textHatem ElKharashy2023-11-111-5/+22
| | | | | | | | | | | | | This allows placeholder text to follow the Alignment set to the TextField or TextArea components when using Material style. The placeholder text will float to the left, right, or center depending on the alignment set, and the arc will be drawn properly in case of Material.Outline container style. Fixes: QTBUG-118856 Pick-to: 6.6 6.5 Change-Id: Ic9cede806dc2f6109e7e2c4b2b2fc960d9c6a1b6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Material: allow setting background to nullMitch Curtis2023-09-191-3/+0
| | | | | | | | | | | | The texteditor example does this since it's a full-screen editor. Currently that example produces a warning. It also doesn't cost us much to support it. Amends 2d99c70f982da92c70c022551cf456877141a5c8. Pick-to: 6.5 6.6 Change-Id: I8fb847297add3ab10f4ee5e6b5634ac841bfd4e6 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* QQuickMaterialPlaceholderText: fix code checker complaintMitch Curtis2023-05-171-1/+1
| | | | | | | | | | | | | | The message was: result of integer division used in a floating point context; possible loss of precision Fixing it revealed a test that relied on it; removed the Math.floor() work-around the test used previously. Pick-to: 6.5 Change-Id: I7c2fde1902d2013ba9fedcadf87ae3b21987fca2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Material: fix clipped floating placeholder textMitch Curtis2023-05-091-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes to placeholder text in 20e3d1b522d1b79239e9ac4a6af47ce3648512bd and 5704741a4073ac131782c3dd73cac5cda6800a28 result in floating placeholder text (i.e. the text shown at the top of the control when it has active focus) being clipped when e.g. in a ScrollView. This is probably only an issue for TextArea in practice, since you wouldn't usually put a TextField in a ScrollView, but you can still run into it if you clip it. We don't want to unconditionally set topInset by default, because, as mentioned above, these controls are not always clipped. In most cases they are used on their own, and this issue won't affect them. Unconditionally setting topInset would ruin the layout of existing UIs. So, we set topInset only if the control itself clips (or its Flickable parent in the case of TextArea). [ChangeLog][Controls][Material] The outlined TextArea now sets topInset by default if it or its Flickable parent clips. This avoids the floating placeholder being clipped in those cases. The outlined TextField sets topInset by default only if the TextField itself clips. Fixes: QTBUG-113321 Pick-to: 6.5 Change-Id: I8555e4fc0c7a9800f76b54a84d94f4d04691bc23 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Material: fix placeholder text alignmentMitch Curtis2023-05-031-1/+3
| | | | | | | | | | The placeholder text should always be aligned to the left according to my tests on native Android via an emulator. Fixes: QTBUG-113172 Pick-to: 6.5 6.5.1 Change-Id: I75ae31e1e6b9846d90ab5034c43f8684698e0ab7 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Material: fix TextArea decorations when in a FlickableMitch Curtis2023-04-191-2/+2
| | | | | | | | | | | | | | | | This patch fixes the following issues when the Material TextArea is attached to a Flickable: - Floating placeholder text scrolls with the Flickable. - When text is cleared without the control having focus: - Floating placeholder text is positioned incorrectly. - The floating text background outline gap is still open. - The background outline color is incorrect when the control has focus (used primaryTextColor instead of accentColor). Pick-to: 6.5 Task-number: QTBUG-112650 Change-Id: Icfa3517e4abcb1209ea2291dabdec225011f19ef Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Material: fix placeholder text y position when control is too smallMitch Curtis2023-03-081-12/+46
| | | | | | | | | Ensure that it's sensibly positioned despite its size. Fixes: QTBUG-111515 Pick-to: 6.5 6.5.0 Change-Id: I71816c461ff1d2f85e010bf871ab1b7ef2ccaf6e Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Update Material TextField to Material 3Mitch Curtis2023-02-171-0/+245
Fixes: QTBUG-72554 Fixes: QTBUG-109218 Pick-to: 6.5 Change-Id: I0bc6fc3d16630352dcd5c58c5dd2b1bf794741c5 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>