summaryrefslogtreecommitdiff
path: root/src/controls
Commit message (Collapse)AuthorAgeFilesLines
* SwitchStyle: Make it work with pre-Holo AndroidGabriel de Dietrich2014-08-081-61/+68
| | | | | | | | | | The Switch control was introduced in Android 4.0 together with the Holo UI. Therefore, there's no way we can extract assets on devices running earlier versions. In that case, we fall back to the Base style Switch visuals. Change-Id: I48d8a5cd94999cd5687fab62c8d16beb4fc53b5c Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* TableViewStyle: Add header delegate for Android styleGabriel de Dietrich2014-08-081-1/+27
| | | | | | | | | | | | | | | | The whole TableView concept doesn't map very nicely on Android (and in mobile in general). However, for completeness, we provide a fully implemented TableViewStyle. For the header delegate, we re-used the design for section headers which is close enough, specially since it's not uncommon to see sticky section headers in mobile applications. This change depends on another change in qtbase, which takes care of extracting the 'listSeparatorTextViewStyle' element. Change-Id: I9c50e4c7cabdc6b0ea864cef3da55ae3d7337d79 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Doc: Update QtQuick.Controls version to 1.3Caroline Chao2014-08-071-1/+1
| | | | | Change-Id: Iefe0694b9a59d80319059727df0043cc91f2943f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Android styleJ-P Nurmi2014-08-0746-1/+3961
| | | | | | | | | Note: Requires Android 3.0 (API level 11) or later. Task-number: QTBUG-35081 Change-Id: Id7a4577a4d78c9474c9ccd7ae754e16fcac8f0e5 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Fix ApplicationWindow state / content sizeJ-P Nurmi2014-08-065-142/+2
| | | | | | | | | | | | | | | | QML Window is not a plain QQuickWindow, but QQuickWindowQmlImpl that does delayed visibility handling and shows the window in appropriate state. Thus, ApplicationWindow cannot inherit QQuickWindow or it would lose all that magic. QQuickApplicationWindow was added in order for ApplicationWindowStyle to be able to know whether a custom window color had been set. This change gets rid of the QQuickWindow subclass and simply compares the window color to white, which is the default fill color of QQuickWindow. Change-Id: Ibd95ef0717c2db51246c6a71585e9286e61cef0b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QQuickMenu: add enum MenuType that reflects QPlatformMenu::MenuTypeRichard Moe Gustavsen2014-08-062-2/+7
| | | | | | | | | | | | On mobile platforms several different popup menu types exist. E.g on iOS, you have a special popup just for selecting text. A recent patch added to QtBase added a new enum to QPlatformMenu that lets UI controls select/hint which one to use. This patch adds the same enum to QQuickMenu so that we can control this from Controls as well. Change-Id: Ibf4bdc84577b5a6527021b1cb15578b56bb4a92e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Introduce ApplicationWindowStyleJ-P Nurmi2014-08-059-3/+298
| | | | | Change-Id: If96bfc8185883ff523ca4242f8ab04b5fccb8999 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QQuickMenu: dismiss platform menu, not only QQuickMenuPopupWindowRichard Moe Gustavsen2014-08-041-6/+10
| | | | | | | | This patch will fill in the missing code path that tells a native platform menu to dismiss when requested. Change-Id: I2625fddd0a735ca9ec7fabaf783921a1f99caa1d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QQuickMenu: center menu when mouse not presentRichard Moe Gustavsen2014-08-041-0/+6
| | | | | | | | | | | | | | | | | | | | On touch platforms, QCursor::pos() will return the last touch synthesized to a mouse pos. Since this will only happen when the user taps on a control that does not handle the touch, the position you get can easily be very old. And in many cases, a mouse pos has never been synthesized at all, and the position you get is inf. As a quick fix, this patch checks if the mouse position is invalid, and center the menu. For a long term fix we need to find a way to expose touch events in QGuiApplication, and write logic that determines when to use touch and when to use mouse to position the menu, and if using touch, which touch point should be used. Change-Id: Ic4d2dd78372efcd0c2362204492e76f44ff0a49a Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* TableView: fix styleData.pressed for filled rowsJ-P Nurmi2014-07-311-0/+2
| | | | | Change-Id: I42b6fd74fc9a51ab7fbb490ea64fb59df3164c5d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* MenuStyle: fix separator heightJ-P Nurmi2014-07-291-1/+3
| | | | | | | | | Let the delegate choose separator height instead of forcing a height calculated based on the font size, and check styleData.type instead of styleData.isSeparator that doesn't exist. Change-Id: Ia395a27ea86087f772606a252adf7565868ceac9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* OS X: fix positioning of non-native menu popupsJ-P Nurmi2014-07-292-11/+11
| | | | | Change-Id: Iafc7f3a1a41093628e3cba8dd2a7781c2b82b021 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* MenuStyle: Add pressed property to style data objectGabriel de Dietrich2014-07-293-0/+4
| | | | | | | | | [ChangeLog][Styling] Add pressed 'property' for MenuItem styling in styleData object Task-number: QTBUG-40178 Change-Id: Id5c2af529ed67981415fb055ce83e2c528da525a Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix TextHandle min/max position handlingJ-P Nurmi2014-07-281-1/+3
| | | | | | | | | | | | When not explicitly specified, the maximum is the length of the editor content, not minus one (cursor can be moved "past" the last character). Furthermore, due to binding evaluation orders, the minimum/maximum properties might be temporarily pointing outside the range so we must validate them to avoid clients (TextField/TextArea) having to do that. Change-Id: I1faddd1e7ac4f12d7a802484ceb8eea500ad8bfc Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* ComboBox: respect style padding for the editorJ-P Nurmi2014-07-282-2/+5
| | | | | | | | | | | | | | Get rid of the hard coded 8px left margin and use whatever value the style supplies (and is already used for the label). This allows the Android style to provide a sensible value for High DPI screens. The new value for the left margin is 6px in Base and Desktop styles. It looks slightly better, but still not pixel perfect. Notice that the text label of editable and non-editable ComboBoxes are not perfectly aligned in native Windows and OS X ComboBoxes either. Change-Id: I9a66c3a26fcd9ef1653b355e831277a7b6cbe72f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Text handles: fix input method commitsJ-P Nurmi2014-07-253-4/+1
| | | | | Change-Id: I1fa2240915b114c6b46360233fcea2b6cee86cd7 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* TextArea: let style specify the default text marginJ-P Nurmi2014-07-243-1/+7
| | | | | | | | | The hard coded 4px margin is unsuitable especially on High DPI devices. For example on Nexus 5 it should be 36px, so let the Android style specify a suitable value. Change-Id: I31287d2e78ae822b8bd63ea19674c85b08975426 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Add scollBarPolicy properties to scrollviewDavid Edmundson2014-07-222-2/+35
| | | | | | | | This adds horizontal and vertical scrollbar policies allowing one to pernamently show or hide the scrollbars like in QAbstractScrollArea. Change-Id: I4989dbf2225ab34741b5a2811d7c6ff52880e0c3 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Make text selection handles behave in a FlickableJ-P Nurmi2014-07-211-1/+12
| | | | | | | | | | Prevent stealing but not before the drag threshold has been passed. This makes it possible to flick over the handles, but the press won't get easily stolen by a Flickable after moving the handles. The same technique is used in Slider. Change-Id: I8eac1bf84ada8bb2334f5ed3985f14a520ecc3c5 Reviewed-by: Liang Qi <liang.qi@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-07-193-32/+34
|\ | | | | | | Change-Id: Icc15fe685e94dd043979b6b9c6a624f18f2d1e4c
| * Centralize determination of "no desktop" configurationsJ-P Nurmi2014-07-182-2/+2
| | | | | | | | | | | | Change-Id: I030012f48668db4f01737ef92fdb7e6e0426e025 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
| * Do not embed the Desktop style into resources on irrelevant platformsJ-P Nurmi2014-07-181-25/+27
| | | | | | | | | | | | | | | | | | | | The Desktop style is not built on these touch/mobile platforms, or when QtWidgets is not enabled, so it's pointless to embed these QML files. Change-Id: Iac11473b3a9791745a107e0f7ac1cd34a91a9a5d Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
| * Improve implicit size of Calendar on high DPI devices.Mitch Curtis2014-07-171-6/+6
| | | | | | | | | | | | Task-number: QTBUG-39473 Change-Id: Ibfb1c040efd9744ba6c8bc56affcdf90a807b046 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | ComboBox: add support for selection handlesJ-P Nurmi2014-07-182-11/+55
| | | | | | | | | | | | Task-number: QTBUG-38934 Change-Id: I0d7bfc821ff345e76d1ae89818f6a5e0120695f5 Reviewed-by: Liang Qi <liang.qi@digia.com>
* | SpinBox: add support for selection handlesJ-P Nurmi2014-07-182-11/+55
| | | | | | | | | | | | Task-number: QTBUG-38934 Change-Id: I8f23d20a24977f1787dcd451b48b22326959e3bc Reviewed-by: Liang Qi <liang.qi@digia.com>
* | Add styleData.hasSelection for text selection handlesJ-P Nurmi2014-07-183-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Text selection handles typically look different based on whether the editor has selection or not (one handle for moving the cursor vs. two handles for selecting text). SpinBox and ComboBox do not have suitable properties for testing whether the control has selection or not, so styleData.hasSelection is introduced to abstract and expose that information. Task-number: QTBUG-38934 Change-Id: I362b5790f5d487e5ba258e42d1b801a5cce76770 Reviewed-by: Liang Qi <liang.qi@digia.com>
* | TextField: refactor selection handlesJ-P Nurmi2014-07-184-119/+176
| | | | | | | | | | | | | | | | | | Move the selection handles to a private type that can be re-used in SpinBox and editable ComboBox. Task-number: QTBUG-38934 Change-Id: Ib1eec3259d19ffea7aa8c2b76fed4e914f2ce3ec Reviewed-by: Liang Qi <liang.qi@digia.com>
* | Add ComboBox::inputMethodComposingJ-P Nurmi2014-07-181-0/+12
| | | | | | | | | | Change-Id: I3701a28721252bc3cca46a223bb665faf38002f7 Reviewed-by: Liang Qi <liang.qi@digia.com>
* | Add SpinBox::inputMethodComposingJ-P Nurmi2014-07-181-0/+12
| | | | | | | | | | Change-Id: I5c2b10cf293b36547486a12f6a50e8083d36c6a3 Reviewed-by: Liang Qi <liang.qi@digia.com>
* | SpinBox: revert back to querying font via style panelJ-P Nurmi2014-07-173-2/+5
| | | | | | | | | | | | | | This is a partial revert of 8c3afd8 for the same reason than 790769d. Change-Id: Ia082f375caa441a5db562b04369699092cf0007e Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-07-174-6/+38
|\ \ | |/ | | | | | | | | | | Conflicts: src/controls/Styles/Base/MenuStyle.qml Change-Id: I95c8b4f348260b958f158ae28c0984d54af973a8
| * MenuStyle: fix default text rendering typeJ-P Nurmi2014-07-171-0/+3
| | | | | | | | | | | | | | | | It's missing Text.NativeRendering which makes it look awful. We use native rendering everywhere by default, even in MenuBarStyle. Change-Id: I2f032fad87a0a2700e13d0f55152bb6293d20d9a Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
| * SpinBox: don't force active focus when tapping the buttons on touchJ-P Nurmi2014-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | This improves the usability of SpinBox on touch devices. The input panel is no longer immediately shown when tapping the buttons, but only when tapping the editor area. Change-Id: I09a2218419490cb33da3b0733c9a42f871edc965 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
| * Fixed incorrect cursor when moving column in TableViewPiotr Wycisk2014-07-111-1/+2
| | | | | | | | | | | | | | | | Task-number: QTBUG-37288 TableView: The resize column cursor should not appear when moving a column Change-Id: Ibd3ef44eeb645e8a9c17a58a3fcf2ef06624d3ad Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
| * Doc: Updated the example documentationVenu2014-07-111-3/+31
| | | | | | | | | | | | Task-number: QTBUG-37203 Change-Id: I8a3d48ea8163787cd7f41d43ea201be067d310f0 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Add MenuBarStyle::fontJ-P Nurmi2014-07-171-1/+11
| | | | | | | | | | Change-Id: I6b409baa96c5d64ce0337d5d7616091f4f204018 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Fix Calendar::clicked() signal emissionJ-P Nurmi2014-07-161-8/+7
| | | | | | | | | | | | | | Emit only when releasing over the same date than was pressed. Change-Id: I7a8d4d6e3871231ae2589d565a75d9b641b649ac Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Add Calendar::pressAndHold(date) signalJ-P Nurmi2014-07-162-0/+23
| | | | | | | | | | | | | | | | [ChangeLog][Calendar] Added pressAndHold(date) signal that is emitted when the user presses and holds a valid date. Change-Id: Ie880a3ed827332d35fabc76cd6a09eebc7685eb7 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | ComboBox: query font & colors via style panelJ-P Nurmi2014-07-163-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Advanced custom styles have difficulties binding values from native styling elements to the style root, because such styling elements are created inside delegate components. ComboBoxStyle { id: style panel: Item { NativeStyle { id: native elementType: "ComboBox" } // typical "backwards" bindings that we want to avoid: Binding { target: style; property: "font"; value: native.font } Binding { target: style; property: "foo"; value: native.foo } Binding { target: style; property: "bar"; value: native.bar } // ... } } Becomes: ComboBoxStyle { id: style panel: Item { NativeStyle { id: native elementType: "ComboBox" } font: native.font foo: native.foo bar: native.bar // ... } } Change-Id: I23a3a6528cf0162dc91f94a44bcade2985260a9d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Introduce TableView::pressAndHold(int row) [signal]J-P Nurmi2014-07-141-0/+19
| | | | | | | | | | | | | | | | [ChangeLog][TableView] Introduced a pressAndHold(int row) signal that is emitted when the user presses and holds a row. Change-Id: I823a7fd534fd6fca78831f00e7ecbb9f2118e006 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | ComboBoxStyle: allow specifying text & selection colorsJ-P Nurmi2014-07-123-4/+28
| | | | | | | | | | | | | | The system palette colors are not suitable for all styles. Change-Id: I326e57a3bac9c11dab9a40d1e4c933fc534e7ada Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* | TableView: add styleData.pressed for itemDelegate & rowDelegateJ-P Nurmi2014-07-111-13/+41
| | | | | | | | | | | | | | | | Make it possible for the Android style to visualize the pressed state. Task-number: QTBUG-35081 Change-Id: Ida956ef1fbdccd0931c111424788973c29b0a6c3 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-07-0956-127/+393
|\ \ | |/ | | | | | | | | | | Conflicts: src/controls/ToolBar.qml Change-Id: I5510496219a4ebe8bfced4192307219238ca9bb6
| * Fix editable ComboBox mouse cursorJ-P Nurmi2014-07-091-1/+9
| | | | | | | | | | Change-Id: I6866686b09348f486c6629917d271b640b1b734e Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
| * Doc: Update image for ApplicationWindowCaroline Chao2014-07-081-0/+0
| | | | | | | | | | Change-Id: I95f497ed0e5d084d2941a1523165c3e37df415e2 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
| * Fix SpinBox mouse cursorJ-P Nurmi2014-07-081-1/+10
| | | | | | | | | | Change-Id: I0b0fe9c7b7ddd9ba01035fd2ca70c7b11433ec90 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
| * Mention that ApplicationWindow is not visible by default.Mitch Curtis2014-07-071-0/+4
| | | | | | | | | | Change-Id: I8291df95b1aade62b91f000c64d5cd810de252ac Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
| * Allow QT_QUICK_CONTROLS_STYLE pointing to resourcesJ-P Nurmi2014-07-031-1/+3
| | | | | | | | | | | | Change-Id: I4cf6e040c8ac5bc2e8ba1838f22cb5b1cd776f85 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
| * TextField/Area: soft dependency to inputMethodHintsJ-P Nurmi2014-07-022-2/+2
| | | | | | | | | | | | | | | | Don't use an alias to a property that might not exist (when QT_NO_IM), but just bind to it and fallback to Qt.ImhNone if it's undefined. Change-Id: I0e8de86acb534dfe620b829c2bff09db119ef08d Reviewed-by: Liang Qi <liang.qi@digia.com>
| * Use the correct parent window for menu popupsLaszlo Agocs2014-07-013-10/+16
| | | | | | | | | | | | | | | | | | The previous fix applied only to the non-platform menu case and was broken on OS X at least, when having a combobox in a QQuickWidget. Task-number: QTBUG-39908 Change-Id: I5dde103c2fe33d52a312cc80b36b47b13e72a188 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>