aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/fluentwinui3
Commit message (Collapse)AuthorAgeFilesLines
* FluentWinUI3 Style: Hide private QML propertiesDoris Verria2025-03-2030-377/+378
| | | | | | | | | The style declares several QML dynamic properties which are meant to be private. Hide them using __ convention. Pick-to: 6.9 6.8 Change-Id: I4317d2ee7072a72fda1736fc8c9165a980889d95 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* Menu: adjust the insets according to the drop shadowRichard Moe Gustavsen2025-03-202-8/+17
| | | | | | | | | | | | | | | | | | | As it stood, the background delegate of a Menu would draw its drop shadow on the outside of the delegate, and therefore also on the outside of the Menu as a whole. This works fine for Popup.Item, since an Item is allowed to draw out-of-bounds. But for Popup.Window, this would fail. Instead, the correct solution in this case is to draw the shadow _inside_ the delegate, and instead make the whole menu bigger by adjusting the insets instead, to take the shadow into account. In order to be able to do this, we also need to teach StyleImage to optionally draw the shadow inside the bounds. Pick-to: 6.9 6.8 Change-Id: I306e511abca44f4f86ee18a16740f679cf987ac1 Reviewed-by: Doris Verria <[email protected]>
* ContextMenu: add to text editing controlsMitch Curtis2025-02-289-0/+90
| | | | | | | | | | | [ChangeLog][Controls] TextField and TextArea now provide a ContextMenu by default. If you already have a custom context menu for these types, ContextMenu will not open its own on e.g. right click. Fixes: QTBUG-35598 Pick-to: 6.9 Change-Id: I0897a7ba5e1b5b6d5425c80cbc6f2550c904605b Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3: Move StyleImage to private impl moduleDoris Verria2025-01-1625-52/+130
| | | | | | | | | | | | | | Follow the approach with FocusFrame and move StyleImage.qml to the private FluentWinUI3.impl module instead. Add deprecation warnings to the original file. [ChangeLog][QtQuick][Controls][FluentWinUI3] StyleImage.qml is deprecated in the module's public QML API and moved to the private impl module instead. Pick-to: 6.9 Change-Id: I2a536591abb2172a1f7d7a052e88f0c2f58cd481 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3: Move FocusFrame type to private impl moduleDoris Verria2025-01-158-9/+93
| | | | | | | | | | | | | | | FocusFrame.qml was included in the FluentWinUI3 public module imports, despite not providing any documentation. This component is an implementation detail and should not be part of public QML API. Add deprecation warnings in the original file and move it to the private impl module instead. [ChangeLog][QtQuick][Controls][FluentWinUI3] FocusFrame.qml is deprecated in the module's public QML API and moved to the private impl module instead. Pick-to: 6.9 Change-Id: I74c8c9a03ccc1f7b33d6fb814ca1faeca57b0545 Reviewed-by: Mitch Curtis <[email protected]>
* FocusFrame: Don't remove binding on visible propertyDoris Verria2024-12-201-2/+0
| | | | | | | | | | | | | When calling moveToItem() when the focus object changes, we were explicitly assigning the visible property. This caused the previous binding declared on the visible property of the frame to be removed. To fix, don't assign the visible property on moveToItem, as the binding on the target item and its visibility will take care of that. Ammends 945c3a98edac75cac082b1719c380a0bae861944. Pick-to: 6.8 6.9 6.5 Change-Id: I504a0e00000c5fdfb8c5193b9fa2314199a7c4e0 Reviewed-by: Jan Arve Sæther <[email protected]>
* Compute implicitSize based on implicitContentSize in Popup and subclassesTor Arne Vestbø2024-12-194-8/+8
| | | | | | | | | | | | Popup uses a Pane as its popup item, so now that Pane reflects its explicitly set contentWidth/Height through implicitContentWidth/Height we can use the same expression for implicit width/height as regular controls, which hooks us into the safe area binding loop detection as well. Pick-to: 6.9 Change-Id: I3709978dae0271d7daf44fc6988f09f03df15b1f Reviewed-by: Mitch Curtis <[email protected]>
* Take safe areas into account for Qt Quick Controls ToolBar and MenuBarTor Arne Vestbø2024-12-192-8/+8
| | | | | | | | | | | | | | | A ToolBar and MenuBar is commonly placed in the header/footer/menuBar of an ApplicationWindow, where we don't do any automatic padding to account for the safe area. By adding the safe area margins as padding to the controls, we ensure that the control's background flows into the non-safe area, while the content item of the control (the toolbar or menu bar content) is kept within the safe area. Pick-to: 6.9 Change-Id: I5fad7394beaa01ae8ed142e4e2e42c5bffaab9fa Reviewed-by: Richard Moe Gustavsen <[email protected]>
* Compute implicitSize based on implicitContentSize in Container and subclassesTor Arne Vestbø2024-12-182-4/+4
| | | | | | | | | | | | Now that Container reflects its explicitly set contentWidth/Height through implicitContentWidth/Height we can use the same expression for implicit width/height as regular controls, which hooks us into the safe area binding loop detection as well. Pick-to: 6.9 Change-Id: If0a710a5eb4a35c91d02d7170b5e03e457e6bc12 Reviewed-by: Oliver Eftevaag <[email protected]> Reviewed-by: Richard Moe Gustavsen <[email protected]>
* Compute implicitSize based on implicitContentSize in Pane and subclassesTor Arne Vestbø2024-12-183-6/+6
| | | | | | | | | | | Now that Pane reflects its explicitly set contentWidth/Height through implicitContentWidth/Height we can use the same expression for implicit width/height as regular controls, which hooks us into the safe area binding loop detection as well. Pick-to: 6.9 Change-Id: Ie31b740a1e405341fc5f0ed9673b213292e4afd9 Reviewed-by: Oliver Eftevaag <[email protected]>
* FluentWinUI3: Show focus frame when focus reason is from arrow keysDoris Verria2024-12-181-5/+5
| | | | | | | | | | | | | | | | | | We don't have a Qt::FocusReason enumerator value that represents the focus reason being arrow keys, so for cases that an item gains focus due to arrow-key navigating, the focus reason will be OtherFocusReason. The FluentWinUI3 style only draws the focus frame when the focus reason was Tab/Backtab to avoid drawing it for focus reasons other than keyboard focus, but it should draw it for when focus shifts due to arrow keys too, so include Qt::OtherFocusReasons in the conditions. Also, reset the focus frame when we can't find a focus object AND when the focus reason is none of the above in order to avoid showing the frame around an item that lost focus because of another reason. Fixes: QTBUG-130328 Pick-to: 6.8 6.9 Change-Id: I6cbc13124a0e672bf453896bafd0ba1d8656449e Reviewed-by: Mitch Curtis <[email protected]>
* Focus frame: Don't delete focus frame whenever new focus item is nullDoris Verria2024-12-181-1/+4
| | | | | | | | | | | | | | | | | | When we didn't find a new target focus item we would destroy the focus frame object and recreate it the next time a new valid focus item is found. This can be expensive due to cleanup and reallocation calls, and it can also lead to a crash during parent destruction because the focus frame gets deleted as part of the parent item's destruction, potentially triggering changes in the focus object that result in another attempted deletion of the focus frame. Instead, in case of an invalid new focus item, we should just set the focus frame's target item to null when calling moveToItem. This will handle that case by making the frame invisible and setting its parent to null. Pick-to: 6.9 6.8 Change-Id: Icf46af0ce3c79bab09343a2262688fb33ed8a4d9 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FocusFrame: Remove the kludge with the invisible root itemJan Arve Sæther2024-12-181-27/+21
| | | | | | | | | | | Now when we call setTransparentForPositioner(true) on the focus frame, there is no need to keep the root item with size(0,0). The only purpose of having that item was so that layouts would ignore the focus frame. Pick-to: 6.8 6.5 6.9 Change-Id: I6224dced83c054b573eb682997e238a0cf1f4776 Reviewed-by: Jan Arve Sæther <[email protected]> Reviewed-by: Doris Verria <[email protected]>
* Mark the focus frame as transparent for positionersJan Arve Sæther2024-12-032-4/+3
| | | | | | | | | | | | | Applies to the focus frame on macOS, Windows and FluentWinUI3 style. This will ensure that it is excluded by layouts and positioners. Previously, layouts excluded items with 0x0 size, so setting the size of the focus frame to 0x0 worked then. This is not the case any longer. Pick-to: 6.8 6.5 Fixes: QTBUG-129427 Change-Id: I399317f8a7a6b941803556e7ffb2208ad3237726 Reviewed-by: Doris Verria <[email protected]>
* QQuickFocusFrame: Fix showing focus frame inside embedded qquickwidgetDoris Verria2024-09-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QQuickFocusFrame, we connect to QGuiApplication::focusObjectChanged signal and draw the focus frame around focusObject() of qGuiApp, which as per its implementation, is the focusObject() of the app's focusWindow(). However, in the case of QQuickWidget, its offscreenWindow will never become the focusWindow of the application because it doesn't have a native handle. Also, since 0dbc575c1a8359534761167a5f5f1e29abedd51d QQuickWidget intentionally doesn't override the focusObject method to return the focusObject of its offscreen window because that would bypass needed event handling logic in qquickwidget. That is why if a qquickwidget has active focus, qGuiApp will report the qquickwidget itself as its focusObject, rather than the focusObject inside of the widget. However, we still do propagate focus object changes inside the qquickwdiget's offscreen window up to the top level widget and the application, so that when the offscreen's window QQuickWindow::focusObjectChanged is emitted, the equivalent signal in QGuiApplication will also be emitted. That is why in qquickfocusframe we should rely on the signal parameter instead, which represents the right focus object, rather than query qGuiApp::focusObject(). While we're at it, reset the focus frame if no item inside the quick window currently has active focus, otherwise we would still show a focus frame even if the quick window lost focus. Note: Ideally qGuiApp::focusObject() should give us the same object as the QGuiApplication::focusObjectChanged signal parameter, but that can require more work as the focusObject() of the application will then receive key events and qquickwidget relies on handling those key (and other) events itself. Fixes: QTBUG-128931 Pick-to: 6.8 6.8.0 Change-Id: Id86a4e9dfd6b2bda5cc9ea633305e71d86fcdb5f Reviewed-by: MohammadHossein Qanbari <[email protected]> Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluentWinUI3 Style: Add SwipeDelegateDoris Verria2024-09-062-0/+67
| | | | | | | Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: Ia1f35705cd1f6ff912294ddce172bde381789fbb Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3: Show focus frame only if focusReason was from tab/backtabDoris Verria2024-09-022-12/+14
| | | | | | Pick-to: 6.8 Change-Id: Ib2b98ba7f69d70b251bfa17e35ee121c7728b916 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add focus frame componentDoris Verria2024-08-3021-3/+230
| | | | | | | | | | | | | Add a FocusFrame component that follows the active focus item, mirroring the approach used by the native styles with QQuickFocusFrame. In the future, this should probably move out of the native style and serve as a common solution across all styles. Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: I577d0b783c36bc7e146a7e02051195d78a11ca60 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add ToolTipDoris Verria2024-08-303-0/+71
| | | | | | Pick-to: 6.8 Change-Id: I962b1d9a3aa0e2dbcdc9d262088de00e5abd3322 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add Dialog/DialogButtonBoxDoris Verria2024-08-304-1/+141
| | | | | | | | | | | Add Dialog and DialogButtonBox. While at it, remove them from the list of not-yet supported controls in the Fluent style docs, together with other controls that have already been implemented. Pick-to: 6.8 Change-Id: I6abe0cae8712a999a5491b5ec1a904df56d38d0d Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add RoundButton and DelayButtonDoris Verria2024-08-303-0/+179
| | | | | | | Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: I400c3ccc27088427481a86cc937597675649fb3d Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3: Support button and accent palette roles for Button/ToolButtonDoris Verria2024-08-30139-165/+238
| | | | | | | | | | | | | We want to be able to support custom palette.accent and palette.button colors for the Button/ToolButton. To do that, use QML instead of images for the button background and factor it out in reusable component ButtonBackground. Remove previously generated images for the button/toolbutton backgorunds but keep using geometry information generated from the stylegenerator. Pick-to: 6.8 Change-Id: I6f195b32142d06c96833ac3d9184da9f8bbd22ba Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Adjust ToolSeparator paddingsDoris Verria2024-08-301-4/+5
| | | | | | | | | The horizontal/vertical paddings need to be inverted depending on orientation. Pick-to: 6.8 Change-Id: Ia9d516088a749e0c29e70d06bc24a83f1ffb6f3b Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Minor fix for checkbox checkmark indicatorDoris Verria2024-08-231-5/+5
| | | | | | | | | Checkmark indicator was slightly different as pointed out by baseline testing. Pick-to: 6.8 Change-Id: I5984a2de7853c3c8008d8e7215106df8f2f12a6f Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Override platform theme's palette with style's oneDoris Verria2024-08-231-6/+17
| | | | | | | | | | | | | | | | | | | | | | | On Windows platforms we were using the platform theme's palette to construct the FluentWinUI3 style's palette with the motivation that the colors as gotten from the system's APIs in qwindowstheme would be the correct ones for the style. This is not the case as these APIs represent the colors for old Windows10 platforms and do not correspond with the modern WinUI3 colors. That is why we need to override many of these palette roles in the FluentWinUI3's style palette. These colors need to be hardcoded even for Windows platforms as there are no APIs that we can use to retrieve them. The color entries are taken from the official Figma files for the style. The accent color is an exception and that we can safely retrieve from the system APIs. As a drive-by, resolve the style's palette based on the platform theme for all platforms, not only on Windows, as we want to use the system's accent color no matter the platform. Partially reverts 8516ddf690440cd33e3332e8cb2d049ed0032954. Pick-to: 6.8 Change-Id: I360fc30bd04fac9b04a8ffe0e99791349ad365a6 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add Menu and related controlsDoris Verria2024-08-2170-145/+420
| | | | | | | | | | | | | | Add Menu, MenuItem, MenuBar, MenuBarItem, MenuSeparator. Menu is a popup so reuse assets from the Popup control. Similarly, reuse assets and config from ToolBar/ToolButton for MenuBar/MenuBarItem since they have a similar look. As a drive-by, fix some sizes and colors in the Figma design for these components. Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: Ib97103be492dd7df21ce6c76520fd9a67c0bbd37 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add ToolSeparatorDoris Verria2024-08-212-0/+28
| | | | | | | Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: I667cd760dd42f648659046d0b95d16d703610067 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Support accent color for CheckBox/RadioButtonDoris Verria2024-08-2186-16/+140
| | | | | | | | | | | Use ColorImage and primitive QML types for indicators in order to support accent color customization for CheckBox, CheckDelegate, RadioButton, and RadioDelegate. As a drive-by, fix indicator colors for SwitchIndicator. Pick-to: 6.8 Change-Id: Ic1806b5c8cd5c51d2a92f9b30483a117c06e162f Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add Check/Radio/SwitchDelegateDoris Verria2024-08-09104-579/+444
| | | | | | | | | | | | | | Use existing assets for ItemDelegate and CheckBox, RadioButton, and Switch respectively. Factor out SwitchIndicator into separate component so that it can be shared by Switch/SwitchDelegate and use QML instead of images for switch indicator in order to support custom accent color Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: I738a655439ca07745968f4775d4e8c123329fa25 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Fix HighlightedText palette role colorDoris Verria2024-08-093-26/+39
| | | | | | | | | | | | Highlighted text represents the color of selected text and should be white on both light and dark mode. We were incorrectly using this role for the button text color for checked and highlighted buttons, which does not correspond to always light text. Fix this for Button and ToolButton as well as set this palette role to white color. Pick-to: 6.8 Change-Id: Ia79d3e86cc038525e4c566d368f418ee5c56f89f Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add BusyIndicatorDoris Verria2024-07-052-0/+66
| | | | | | | | Add BusyIndicator and unblacklist its tests. Pick-to: 6.8 Change-Id: If42d53fcf60b897e98bd68465de662633d1d306e Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Get pressed/hovered colors from paletteDoris Verria2024-07-032-9/+13
| | | | | | | | | | Don't hardcode colors for pressed/hovered indicators, but rather use the control's palette and the Qt.rgba function to get the right colors. In this way the style will look correct when the palette changes. Pick-to: 6.8 Change-Id: I3af986d027e920efa2d8ef90b5c4710b194bfd80 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Use platform palette on Windows11+ platformsDoris Verria2024-07-036-27/+59
| | | | | | | | | | | | | | When on Windows11+ platforms, use system colors as reported by the platform theme. Also don't use BrightText color role for pressed button text in the FluentWinUI3 style, but hardcode this color. We do the same in the windows11 widgets style. This is because the windows theme uses the BrightText role for a different purpose. Task-number: QTBUG-125279 Change-Id: I76c710145e0f9fdfbfe058300ba4477020bd62e9 Pick-to: 6.8 Reviewed-by: Santhosh Kumar <[email protected]>
* FluentWinUI3: Regenerate Config after fixes in the stylegeneratorDoris Verria2024-07-011-472/+472
| | | | | | | | | Regenerate config after a fix in the stylegenerator tool which fixes the geometry calculations to not account for "invisible" strokes. Pick-to: 6.8 Change-Id: I58497b644068455153998314f69ee328bbe4e7a4 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluentWinUI3 Style: Add PageIndicatorDoris Verria2024-07-0145-0/+779
| | | | | | | Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: I5a7d791fa121a054bd6f4d3f375b17a05c8378c7 Reviewed-by: Mitch Curtis <[email protected]>
* Controls: replace Qt.styleHints with Application.styleHintsMitch Curtis2024-06-214-10/+10
| | | | | | | | | | | | | | As mentioned in QTBUG-95540, using the latter provides better type information for tooling, and avoids the "this property only exists on the object if Quick has been imported" issue. Replace QtQml import in Fluent style's Config.qml with QtQuick to provide access to the Application type. Fixes: QTBUG-126512 Pick-to: 6.5 6.7 6.8 Change-Id: I4aac22e54f3b522f74acafd467ce22139352c9dd Reviewed-by: Ulf Hermann <[email protected]>
* FluentWinUI3 Style: Don't animate slider's knob on disabled stateDoris Verria2024-06-122-3/+3
| | | | | | Pick-to: 6.8 Change-Id: I278ed628f3810d315480cd2a4362fff6fb350275 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluentWinUI3 Style: Add ToolBar/ToolButton controlDoris Verria2024-06-1247-54/+1807
| | | | | | | Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: Id74e7ed3512327dcd8c7014a81fd81c24ec6f82b Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add SpinBoxDoris Verria2024-06-12243-0/+2225
| | | | | | | Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: I0e7a985f16244e495b8e210553646b9d5a279378 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Add ComboBox controlDoris Verria2024-06-12153-0/+3977
| | | | | | | Task-number: QTBUG-125279 Pick-to: 6.8 Change-Id: I2fc049a14b78f99da27e5c9e4312251e35f3f369 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluentWinUI3: Regenerate Config file and images after design changesDoris Verria2024-06-12129-768/+768
| | | | | | | | | | | | | | | | | | What changed: 1. Default height for buttons is 32 (from WinUI3 Figma design) 2. Radius for textfield is 4 (from WinUI3 Figma design) 3. Indeterminate progressbar doesn't have visible groove 4. TextArea/TextField paddings and height fixed according to guidelines 5. Geometry calculation was fixed in the stylegenerator tool to include strokes drawn outside the boundaries of the control. This means that some of the paddings, sizes, and coordinates may have changed. Pick-to: 6.8 Task-number: QTBUG-125279 Change-Id: I58df66b4adc022eb39a0b09554ef2348939a740e Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluentWinUI3 Style: Add Frame and GroupBoxDoris Verria2024-06-1216-0/+860
| | | | | | | Pick-to: 6.8 Task-number: QTBUG-125279 Change-Id: Ic5d8f0f503fbbc0019546423ea6ab0ee8fb2d627 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluentWinUI3 Style: Add TabBar/TabButton controlsDoris Verria2024-06-124-0/+1775
| | | | | | | | | | | | | Add TabBar/TabButton controls and fix tst_tabbar to: - take into account TabButton's background when calculating its expected width - most of the tests assume TabBar's paddings are 0, so explicitly set them to 0 Pick-to: 6.8 Task-number: QTBUG-125279 Change-Id: I0a68fc085baee250925f30dee6636ae71d17e82c Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluenWinUI3 Style: Add ItemDelegate controlDoris Verria2024-06-1233-0/+846
| | | | | | | Pick-to: 6.8 Task-number: QTBUG-125279 Change-Id: Ic0a63950a5e2e2595bacd15e7bf4a188d5afa001 Reviewed-by: Mitch Curtis <[email protected]>
* FluentWinUI3 Style: Support accent color for Slider/RangeSlider trackDoris Verria2024-06-1151-113/+17
| | | | | | | | | Don't use images for the track but use QML Rectangle with accent color. Pick-to: 6.8 Task-number: QTBUG-125279 Change-Id: I3175c9bb7afc7932de6541833cb3a3deb05dfc22 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* FluentWinUI3 Style: Add Popup controlDoris Verria2024-06-119-0/+133
| | | | | | | Pick-to: 6.8 Task-number: QTBUG-125279 Change-Id: I33193802a314c6d0b7fbf5df4a13286cdda90c37 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* Rename Fluent style to FluentWinUI3Doris Verria2024-06-02565-0/+11260
The style is based on the WinUI3 design system, which follows the Fluent design. Task-number: QTBUG-125279 Change-Id: Ie92c35a5c1d3eafdbb377d1c49df4b8cc84e1e98 Reviewed-by: Richard Moe Gustavsen <[email protected]>