aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/imagine
Commit message (Collapse)AuthorAgeFilesLines
* DialogButtonBox: workaround implicit size calculation with one buttonv5.11.0-beta1J-P Nurmi2018-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When there's only one button in the dialog button box, the Default and Universal styles resize the button to cover half of the button box. This works in typical scenarios when the dialog button box is assigned as a footer of a dialog, and thus, gets resized together with the dialog. However, if the dialog button box is placed into a layout, or otherwise not given an explicit size, the implicit size calculation loops until it reaches zero. 1) button box gets the implicit size of the content (one button) 2) button box resizes the button to cover half of the box width 3) button box re-calculates its implicit size => step 1 Avoid the problem by providing a reasonable hard-coded implicit size for this special case. Notice that this is just a temporary workaround to avoid the problem. This can be fixed properly in dev by providing separate contentWidth and contentHeight properties that cleanly propagate the content size to QML. Task-number: QTBUG-59719 Change-Id: I552e0824ae6bff26b570c699252a3e4f09bd3397 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Imagine: declare missing QtGraphicalEffects dependencyJ-P Nurmi2018-02-201-0/+1
| | | | | | | | | | DelayButton and ProgressBar are using QtGraphicalEffects. The dependency must be declared in static builds: DelayButton.qml:41:1: module "QtGraphicalEffects" plugin "qtgraphicaleffectsplugin" not found Change-Id: Ic6774a2ebb85e6324ad6e9e222d15120c191a144 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* GroupBox: fix background y and height assignmentsMitch Curtis2018-02-161-1/+1
| | | | | | | Use the more specific bottomPadding rather than padding. Change-Id: Ib8823d6d9b07eaea97479ef432df0868b1b5d37d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.10' into 5.11Liang Qi2018-02-122-2/+2
|\ | | | | | | Change-Id: I2934d3f51fea9626fd2d2512786eb297d9f7fe6c
| * Editors: tweak placeholder text colorJ-P Nurmi2018-02-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using 50% translucent palette.text, use 50% translucent TextField::color (which defaults to palette.text) to make the placeholder text color follow the text color when changed directly without changing the palette. In the future, the placeholder text color should be exposed as a separate property to give users full control. Task-number: QTBUG-66176 Change-Id: I57153ff676be6518f9b48cdbd7da4089daa36853 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix memory leak in QQC2Simon Hausmann2018-02-071-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When repeatedly creating a QQuickView, loading a QML file that imports QQC2 and deleting the view again, we would leak memory that was allocated as a consequence of QML type registration in initializeEngine() callbacks that were called on every iteration. After the limitation of namespacing in the registerTypes() callback of QML module plugins has been lifted, we can move the type registrations into registerTypes() where they belong and which is called only once. Change-Id: I7e314663a69fd8c8529195b56c128b61392c0042 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-208-43/+42
|\| | | | | | | Change-Id: I61d779eb40e3a278aa2ef429e014d351da34f80a
| * Imagine/Switch(Delegate): cleanup internal IDs for deferred executionJ-P Nurmi2018-01-182-4/+6
| | | | | | | | | | | | Task-number: QTBUG-50992 Change-Id: I621343bef562b4ed85202a0690a0cccfc0a053c5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine/DelayButton: cleanup internal IDs for deferred executionJ-P Nurmi2018-01-181-11/+10
| | | | | | | | | | | | Task-number: QTBUG-50992 Change-Id: I5f2708bc0e9f37232b10e2cd6f1c61ab779156e3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine/ProgressBar: cleanup internal IDs for deferred executionJ-P Nurmi2018-01-181-15/+16
| | | | | | | | | | | | Task-number: QTBUG-50992 Change-Id: I1f31b23f3db23e5582b74b18ed643e8263d99142 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine/BusyIndicator: cleanup internal IDs for deferred executionJ-P Nurmi2018-01-181-3/+3
| | | | | | | | | | | | Task-number: QTBUG-50992 Change-Id: Idee1a13355e36e9221b32cdf9b89b4090dcf87b4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine/GroupBox: cleanup internal IDs for deferred executionJ-P Nurmi2018-01-181-5/+4
| | | | | | | | | | | | Task-number: QTBUG-50992 Change-Id: Ied6b4365d03fc1ef3ae3a69667f1cb1fc8cdb9ac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine/SpinBox: cleanup internal IDs for deferred executionJ-P Nurmi2018-01-181-4/+2
| | | | | | | | | | | | Task-number: QTBUG-50992 Change-Id: Iaabd561b2bd009d3db970f370eff6fa717164961 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Tumbler: qualify references to visibleItemCount with "control"Mitch Curtis2018-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | This code currently works, but we prefer to use control.<property> to access properties directly. A similar patch was done for the styles that were available in 5.9. Change-Id: Iff12162464daa6b10fa8d3f322e0e61632713d08 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devJ-P Nurmi2018-01-162-9/+8
|\| | | | | | | Change-Id: Ibd1490e8d958361e55ac272dff75c9361239958b
| * ComboBox: fix popup's deferred execution for the new stylesJ-P Nurmi2018-01-151-4/+4
| | | | | | | | | | | | | | | | Same as 3ec6d04d in 5.9, but for the new styles in 5.10. Task-number: QTBUG-50992 Change-Id: I211c0e6c0b290c1af310898f21850f9fad01b278 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Tumbler: cleanup internal IDsJ-P Nurmi2018-01-151-5/+4
| | | | | | | | | | | | | | | | Same as d61567f in 5.9, but for the new styles in 5.10. Task-number: QTBUG-50992 Change-Id: If47df3796eeadb997bfc76ce6dd6a3b14372ff2b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-098-54/+25
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/quicktemplates2/qquickabstractbutton_p.h Change-Id: I265cbd2ce51beaf2afef99292c2e2798dadb4ba3
| * Respect user font settings from qtquickcontrols2.conf fileMitch Curtis2018-01-032-46/+4
| | | | | | | | | | | | | | | | | | | | | | | | Resolve the style's font against the font that the user set in the configuration file, rather than only using the style's font. This patch also removes all of the fonts which were identical and replaces them with a single font. Task-number: QTBUG-65500 Change-Id: I284b0d75ac3ad5bf7123bbd13bbfe85d25145483 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Imagine: cleanup unnecessary property assignmentsJ-P Nurmi2017-12-205-8/+0
| | | | | | | | | | Change-Id: Iea84dc48b2807f336ff0b4c191fe5ec744cb1dd9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Update plugins.qmltypes for stylesJ-P Nurmi2017-12-131-0/+21
| | | | | | | | | | | | Change-Id: I19202b23a3027c7a24e15be2b929e9fc02aed044 Reviewed-by: Marco Benelli <marco.benelli@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devJ-P Nurmi2017-11-061334-7/+72
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quickcontrols2/qquickchecklabel.cpp src/quickcontrols2/qquickchecklabel_p.h src/quickcontrols2/qquickmnemoniclabel_p.h src/quicktemplates2/qquickbuttongroup_p.h src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquickswipedelegate.cpp Change-Id: I1278b78dcaf25be5698f34751193b83dc951eb3c
| * Imagine: round Slider handle position to avoid artefactsMitch Curtis2017-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handle can be positioned "between" pixels, leading to unpleasant results: https://imgur.com/a/GKItw Round the position to avoid this. Doesn't seem to be an issue for other styles that use Qt Quick primitives rather than images. Change-Id: Iddb21e37ff777de433b3fa2a68e640db9a4b369a Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Imagine: enable caching for image lookupsv5.10.0-beta3J-P Nurmi2017-10-261-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | File system lookups are somewhat expensive, so cache the results to avoid repetitive lookups. The default cache size of 500 is a rough estimate based on that the default assets have 300+ images per scale factor. Caching image lookups gives an average of 20% performance improvement in qmlbench: control before after improvement ---------------------------------------------- busyindicator 29 32 1.10344827586207 button 53 60 1.13207547169811 checkbox 51 60 1.17647058823529 combobox 39 44 1.12820512820513 dial 110 147 1.33636363636364 itemdelegate 54 61 1.12962962962963 label 143 152 1.06293706293706 menuitem 26 34 1.30769230769231 progressbar 13 15 1.15384615384615 radiobutton 52 59 1.13461538461538 scrollbar 37 62 1.67567567567568 scrollview 78 121 1.55128205128205 slider 31 40 1.29032258064516 spinbox 75 85 1.13333333333333 switch 35 43 1.22857142857143 textarea 80 88 1.1 textfield 56 63 1.125 tumbler 126 128 1.01587301587302 ---------------------------------------------- average 1.2102967624703 Caching can be disabled by setting an environment variable: QT_QUICK_CONTROLS_IMAGINE_CACHE=0 but this is not advertised in the docs for the time being. It is there to help debugging, should anything go wrong with caching. Change-Id: I1119f3d8186bc9a51cc174b06fed02ed9e1fb70c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * 9-patch export plugin for SketchJ-P Nurmi2017-10-182-0/+43
| | | | | | | | | | | | | | | | This plugin crops upscaled 9-patch PNG assets when exported from Sketch, to ensure that 9-patch borders remain 1px wide when upscaled. Change-Id: Iad46d75f37b76eecf64ac32fa38d2b9e9db8b34d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine: replace generated assets with exported assetsJ-P Nurmi2017-10-181264-0/+0
| | | | | | | | | | | | | | From now on, the assets are maintained via imagine.sketch. ;) Change-Id: Icee606115cb149f3c99b8d9b768ccb080ad909be Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Update imagine.sketchJ-P Nurmi2017-10-181-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove @1x from - applicationwindow-overlay-modal - menuitem-arrow-disabled - rename - button-background-disabled-checked -> button-background-checked-disabled - add missing - combobox-background-editable-focused - combobox-background-focused - dial-handle-hovered - delaybutton-background-focused - drawer-overlay - drawer-overlay-modal - remove checkable states for button Now the exported assets match with the files generated by imaginator. Change-Id: Icc73cd526227150b344512d08027f772a53acac2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine: add support for file selectorsJ-P Nurmi2017-10-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For example: assets/ |__ button-background.9.png |__ +custom/ |__ button-background.9.png $ QT_FILE_SELECTORS=custom ./myapp Change-Id: I26f0b82885aa1a8e62fb4e3e58c7d8b19012406e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine: add "qt.quick.controls.imagine" logging categoryJ-P Nurmi2017-10-172-0/+8
| | | | | | | | | | | | | | | | | | | | The output helps to debug image asset selection. For example: qt.quick.controls.imagine: "button-background" () -> "path/to/button-background.9.png" qt.quick.controls.imagine: "button-background" ("hovered") -> "path/to/button-background-hovered.9.png" Change-Id: I3aee85d357d9b9436341bfb06486e5b3089ce86f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine: remove bogus assetsv5.10.0-beta2J-P Nurmi2017-10-1664-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - flat buttons don't need checkable assets (checkable-checked vs. checked, and checkable-highlighted vs. highlighted look identical) - delegates don't need a checked background, because the checked state is visualized by the indicator - text editors have no pressed state - mirrored page-indicator is unnecessary because it looks identical (if a mirrored version was needed, then we would need to provide mirrored versions of all states including pressed, current...) Change-Id: I909f639bdcf9d9653c56b8ce2eda49b3219bdf77 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickSpinBox::displayTextJ-P Nurmi2017-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows styles to create a simple binding to display the textual value instead of calling the textFromValue() JS-function. Furthermore, this allows us to do the text<->value conversion in C++ using QLocale by default, unless custom textFromValue and/or valueFromText JS-functions are provided. Before: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml 100 frames 100 frames 99 frames Average: 99.6667 frames; using samples; MedianAll=100; StdDev=0.57735, CoV=0.00579281 After: running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml 152 frames 150 frames 151 frames Average: 151 frames; using samples; MedianAll=151; StdDev=1, CoV=0.00662252 Change-Id: I66a5ebaf685d2c30613b58099724e6e7bbe00504 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devJ-P Nurmi2017-10-1211-3/+11
|\| | | | | | | Change-Id: I3eb4463f8d931257b3e5d5438361f38f2f5b21ce
| * Refactor imagine.sketchJ-P Nurmi2017-10-111-0/+0
| | | | | | | | | | | | | | | | | | | | - split to page per control - define a palette and used shared styles - use shared symbols for 9-patches, indicators, handles, etc. - minor geometrical fixes here and there Change-Id: Ib6992f5ce2f57193ac893684bed43f039f22a815 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickImageSelector: fix clazy-qvariant-template-instantiationJ-P Nurmi2017-10-101-2/+2
| | | | | | | | | | Change-Id: I61f56c8806f02da2cab2ecf8452598431d921ca6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine: set icon properties as we do for ButtonMitch Curtis2017-10-061-1/+9
| | | | | | | | | | Change-Id: Iac93ca277883984ef99ffc34acade32f7b4ce434 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Fix imagine.sketchJ-P Nurmi2017-10-061-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - fix content padding for delegates - fix switch indicator size - fix combobox content padding - fix groupbox content padding - fix progressbar - fix delaybutton radius - fix popup overlay - fix dial background - fix tooltip content padding - fix combobox - fix popups - fix appwindow background - fix itemdelegate-background colors - fix radiodelegate-background - fix pane padding - fix radiodelegate-indicator-pressed color - fix pageindicator - fix sliders and range sliders - fix scrollbar & indicator - fix slider progress color - fix spinbox - fix switch - fix tabs - fix textfield padding - fix toolbar, button, separator - fix drawer - fix partially checked checkbox indicator - fix checkbox pressed indicator color - fix checkbox & delegate checkmark - fix dial handle size - fix dialogbuttonbox padding Change-Id: Idbbed7c7f80c754b3852b49e0720a02fbecfca49 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine: remove bogus spinbox assetsMitch Curtis2017-10-058-0/+0
| | | | | | | | | | | | | | These were incorrectly generated and are not used. Change-Id: Iec5fbdbaccce96722fa9ff1adefd43ecbcc4aebb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-051-0/+0
|\| | | | | | | Change-Id: I59e9e2044184f96f1e66577f6f639d028a825b9e
| * imagine.sketch: fix button-backgroundJ-P Nurmi2017-10-031-0/+0
| | | | | | | | | | | | | | | | | | Vertical content padding was off by one, and some flat buttons had wrong gray shade. Now buttons look identical when toggling between default and exported assets. Change-Id: I7d9bddb479292c18f500b0044a38a5ae420e6e59 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * imagine.sketch: remove white solid backgroundJ-P Nurmi2017-10-031-0/+0
| | | | | | | | | | | | | | | | | | | | | | Most of the assets, exluding some handles and indicators, had a solid white background (for the entire image). In general, nothing should have a solid background, but the areas around button corners, slider track and so on should be transparent. This patch simply selected all exportable assets and unchecked "Background color". Change-Id: Idebc0811290e8617f1a8cf5c3ebef665f02b8b62 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * imagine.sketch: fix menuseparator-backgroundJ-P Nurmi2017-10-021-0/+0
| | | | | | | | | | | | | | | | Remove the solid white background, and make the 1px dots rectangles instead of lines. Change-Id: If31059bdbe10e04bcf9ff5b060c390761c0b4921 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * imagine.sketch: fix frame-backgroundJ-P Nurmi2017-10-021-0/+0
| | | | | | | | | | | | | | | | Sketch has known issues with 1px line elements. Use rectangles instead of lines for marking the content area. Change-Id: Idd3d1380637f0baeea206c0971f8fef3b1387cd2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Imagine: add Sketch fileMitch Curtis2017-09-291-0/+0
| | | | | | | | | | | | | | | | This contains the default assets for the Imagine style in Sketch's file format. Change-Id: If9658b8674a7c456fdfe7ddcd5bb83ba464a82bb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devJ-P Nurmi2017-09-25143-93/+118
|\| | | | | | | Change-Id: If4e13f09012c80c1043fd0ee82bbddab50b1fad5
| * Imagine: fix MenuItem arrowMitch Curtis2017-09-2216-0/+0
| | | | | | | | | | | | | | | | | | | | | | It was white because menu previously had a dark background. The new assets have been optimized with: optipng -o7 -strip all *.png Change-Id: Ie59828612ae145b79f1e15d9f1f1db6a469b1020 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Imagine: fix SpinBox assetsMitch Curtis2017-09-2180-0/+0
| | | | | | | | | | | | | | | | | | | | | | Some assets were not flipped correctly. The new assets have been optimized with: optipng -o7 -strip all spinbox*.png Change-Id: I411e89d5b000b0afd71421428f9754b3c6b13259 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Imagine: fix QRC pathsMitch Curtis2017-09-1447-93/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using ApplicationWindow as an example, its NinePatchImage url is assigned like so: source: Imagine.path + "applicationwindow-background" If Imagine.path is set to ":/images" by the user, then the final URL would be: QUrl("file:///home/user/qt/qtbase/qml/QtQuick/Controls.2/Imagine/:/images/applicationwindow-background") We could use a QUrl for QQuickImagineStyle::path, but we don't want to support anything other than local paths. Instead, we add a private "url" property that returns a URL that we construct correctly in C++ ourselves, and then the Imagine QML controls files use that property. Change-Id: Ic4d1910bbc7f7b6f80f257496ae6131777a19401 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Bump import versionsMitch Curtis2017-09-1946-216/+216
|/ | | | | | | | This brings all QtQuick 2.x and QtQuick.Controls.x 2.x imports in src/ up to 2.11 and 2.4, respectively. Change-Id: Ica2413b85f5da62a495a5d1b02ea54a9a92c0ecb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Bump QtQuick 2.9 imports to 2.10Mitch Curtis2017-09-0646-46/+46
| | | | | Change-Id: I274146911cd8a204fcbf439da9259b0a38c8092e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix build when OpenGL is disabledJake Petroules2017-08-071-1/+1
| | | | | | | | This fixes a regression from 846a908. Task-number: QTBUG-62289 Change-Id: Ia8eabf67a1d71d3d45a7574103d8dafddbfb9367 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>