| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
We don't want to hide the scrollbars on desktop when it's
not moving.
Change-Id: I6ce555b06a598560a7253e2b8e6db71405b9322b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch will add a focus frame to the macOS style.
We use one focus frame item that we move around according
to changes to the focus object.
It's normally the background delegate's responsibility to
draw a focus frame, so we take care to only draw the
native focus frame for controls with default delegates.
(to be consistent with the other styles)
Change-Id: Iaa7202675c1aad2fc19682563ac1afb6e686c105
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
| |
Move the hover animation handling API from macOS ScrollBar down to
QQuickStyleItem.
Change-Id: I36c8b173a15d0f4e10a59b7f3ccfe635e05c73e7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
To be able to show a focus frame around a control
from QML, we need to know the control's geometry and radius.
For the geometry we can use the already existing layout rect.
But for the latter we need to add focusFrameRadius enums to
QStyle using the already existing pixel metric function.
Change-Id: I45619194766cccbf824d93073a4dcea3a0893fbe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
Go trough the layout rects, and adjust them
so the look correct (by using nativestyle
manual test and PixelTool).
Change-Id: Idbd132b75fb2f87f8ff24cbe3a490ba6b3d2adc6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-86815
Change-Id: Ie0688d13b1787da3c1fc241a7d864aa014ca1d70
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
| |
We're no longer going to draw a static focus frame
from QStyle. Subsequent patches will add a dynamic
focus frame in combination with QML.
Change-Id: I08b13b4c51cab74cd1bc6ec66b879b49774ad267
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
Since all properties that we add to the QML style files will
bleed into the API of the control, prepend '__' to
nativeBackground to mark it as private.
Change-Id: I0cb474e054c3a3824985cf39b4bb675fb57b0696
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Qt 5, QtQuickControls2Plugin::registerTypes() was responsible for
calling initializeTheme() on each style plugin. Now that we delegate
more work to the QML engine, each style plugin calls initializeTheme()
via registerTypes().
To avoid fallback styles overwriting font and palette data set by the
current style, we need to check if the theme has been intialized before
calling initializeTheme(). To do this, we add a static
"themeInitialized" bool that QQuickStylePlugin sets to true after
calling intializeTheme() for the first time. It checks this value and
avoids calling intializeTheme() if it's true.
We also need to make QQuickStylePlugin ensure that the theme it's
initializing belongs to the current style.
Fixes: QTBUG-86303
Change-Id: Ie65e646677c78622829f4949c41cb79204cf5786
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
| |
QQuickStyleItemTextField didn't set a layoutRect. This was just
an oversight, and causes layout issues when trying to read it
to position the focus frame.
Change-Id: Ic959fd315da38e9700dc079c75993feca29c0c61
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
| |
Some controls needs more care, but that's for follow-up commits
Change-Id: Ia7afeccf06f2f12dbef1402bf5975807cad8adcb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A ProgressBar is based on floating point numbers, meaning that
it can have e.g from == 0.5, to == 1.5, and value == 0.8.
A ProgressBar in QStyle on the other hand is integer-based. So
add some extra code to convert floats to ints before passing
the values to QStyle. But only do this for ranges smaller than
100, to ensure that we don't overflow ranges that are really large.
And let "to" start at 0 in case the range ends close to Number.MAX_VALUE.
Change-Id: I2707647911ee31c91b435697d4ae840b304c5c69
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QStyle doesn't calculate a sensible minimum implicit size for us, only
a implicit size that matches the size of the contents. This means that
if the contents is empty (e.g a TextField that has no text), the implicit
size will typically be smaller than what a sensible minimum should be.
Note that for widgets, a sensible preffered size is set from the widgets
themselves, and not QStyle. Which explains why the sizes we get from
QStyle can sometimes be too small.
Therefore, add a sensible minimum implicit size to all the controls
that suffers from this problem. We let QStyle continue to calculate
the actual minimum size given the contents as before (which will end
up as the StyleItem's implicit size), and instead fix the recommended
minimum size directly in the QML style files.
Change-Id: Ic4097776e40d0de64312e4099d7fe4c7fc1ca9d1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
| |
Add it, and remove redundant virtual where it was used.
Change-Id: I7e0635f8d9eafbad49de63302a5b8f5cd25c0080
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: I240b7410a409bb2f72213c02f50870f4ed99db9a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
It shouldn't be needed in the API anymore, since a progress bar will
either paint background and contentItem itself, or it won't paint any of
those (therefore a custom progress bar have to provide both a background
and a contentItem)
Change-Id: Ic44fff97f5fc46453e9bbc9cada094b92fbe2aae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also remove the two custom progress bars from the manual test where
one has a custom background, and the other has a custom contentItem.
If you want to customize a progress bar, you need to provide
customizations for both the background and the contentItem. You cannot
provide a custom background (or contentItem) alone, since its almost
impossible to create a custom background that fits well with the
contentItem of all the other possible styles it might be using.
Change-Id: I82a87513e73f319bcecbfaed341ac4949f64c3bb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
| |
QString: :compare() return 0 if they are equal, just like strcmp...
Change-Id: Ib79513fed158f5068f27d77dfabe18fcff597aee
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
| |
This ensures that we received the warning we expect in
tst_StyleImports::importStyleWithoutControls when run with native styles.
Change-Id: I290f4e72222688e68ae36ace36f1d8be4bedaf31
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
| |
These break the build unless Qt is configured with
-no-warnings-are-errors.
Change-Id: I4a96efc0b29db60e7945fb9739a13da81f8d4c24
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
| |
Using ID's violates the rule we have for styles.
Change-Id: I923199a62ed2dc3f8563ee9eda593905d8b076f9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: I7ef28cc93fd4acad9849fecb3d4c2cab79f0acdb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Set the default width of an empty TextField to 90px (which
is a number found by creating an NSTextField in XCode
and measuring it with pixeltool). This should also make
tst_QQuickPopup::macOS::cursorShape() pass.
Change-Id: Ia2a059668c2e1eaea3eef20015a8ea99468dd8ad
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
After introducing the new registration system in Controls, the
theme palette picked up colors from the Default style. Until this
is fixed, set the system palette explicitly.
Task-number: QTBUG-86303
Change-Id: Ib4c90856bd5410c042160b532175a48fdaea0fbd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: I73319d18ca6540227ce6bf4bdcf217a3c279c64c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: Id05edfccb617c72db902f5a7147ed8433be62e7c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even though 'control' should only be set once and never
change, the QML engine will complain if you have
a binding to e.g control.pressed, since both
'control' and 'pressed' in theory can change. So
add a NOTIFY section to silence the engine.
Change-Id: I64b79b7fd163cbeb5de78504f3b58d915edc278b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I61bb0c2b1fd4dce2939bc4fe91a498a280802cb9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: Ieb640d93e6eb09eb58e5b2ab48a399991d453eb5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we delete QStyle, it will free up it's own internal
resources. Especially on macOS, this means releasing a lot
of NSViews and NSCells from the QMacStyle destructor. If we
did this from ~QtQuickControls2NativeStylePlugin, it would
happen when the plugin was unloaded from a Q_DESTRUCTOR_FUNCTION
in QLibrary, which is very late in the tear-down process, and
after qGuiApp has been set to nullptr, NSApplication has stopped
running, and perhaps also other static platform variables (e.g in
AppKit?) has been deleted. And to our best guess, this is also why
we see a crash in AppKit from the destructor in QMacStyle. So for
this reason, we delete QStyle from a post routine rather than from
the destructor.
Change-Id: I9dfb0d3394f14e5cd8b88d5a5fbbf3b73284faf1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In controls, it's seems to be undefined if the style should draw
a frame around TextArea or not. E.g the Imagine style do, but the
the Fusion style does not. This is a bit unfortunate, because
depending on how you use a TextArea, you might want a frame
around the TextArea itself, or the ScrollView around it (including
the scrollbars), or not at all (*). For this reason, we should
not draw a frame around the TextArea, but leave it to the user
to compose the (style independent) structure, e.g
Frame { ScrollView { TextArea{} } }
Frame { TextArea {} }.
TextArea {}
This patch will remove drawing a frame around TextArea from
the native style. Then at least Fusion, macOS and Windows
will work the same way. This also means that we can remove the
QQuickStyleItemTextArea, since we end up not using QStyle
at all for drawing a TextArea.
(*) Compared to Widgets, a QPlainTextEdit
inherits from QAbstractScrollArea, which inherits from QFrame.
In QFrame, you can choose frameShape, and even set it to NoFrame.
Change-Id: Icabfa294744e87ccf262855faa0992f2d71ec4cb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
After testing on Big Sur, it becomes clear that
the minimum size (which is also the size of the
nine patch image) needs to be larger in order for
the combobox to render correctly.
Change-Id: Iac70efa348afb7efb0af9453dd392b40ba3a9f89
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
| |
Change-Id: I54521f85aa821369ba3ff57fb037ae4996845c97
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
After testing on Big Sur, it becomes clear that
the minimum size (which is also the size of the
nine patch image) needs to be larger in order for
the text field to render correctly.
Change-Id: I74ede6415545f0ddee3fc2175772c1b07c2c3999
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
After running the "leaks" app in Instruments, several
places showed up to leak memory. This patch will add
auto release pools at those places to stop that
from happening.
Change-Id: If7f49290fde60e71d1a40c10bc3d538df6c1da5c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
| |
Change-Id: Idec0507a8bbdfc345e731a9e376ef8dd00534946
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: Iad09b9f6080994528d65dcddc9eda49dbba356f7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: Id80add4e7c3611f9a12695745300d335a015cb43
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: I0c9860eca383b45926fc2134a54807a845d6bc35
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In windows style, the focus rect is drawn when the button is drawn,
but we are only drawing the bevel, so the focus rect was not drawn.
We move the logic of drawing the focus rect so that it is drawn when
drawing the bevel instead.
Also, we have to set the QStyle::State_KeyboardFocusChange in order
for the focus rect to be drawn
Change-Id: I4463ae1dd0f23ecc5bb0a84c563fda33dc6e93c8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We should connect to the control instead of the QQuickStyleItem
This was also the case for the "enabled" and "window" properties
(however, they worked fine, since those properties are inherited by
the parent/child relationship)
Change-Id: Ibcc5dbe8ea10201db558a534e46233617093e9b7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
| |
Change-Id: Ie48002b083615afd4f8f8ab3b1303a8f5c39f81b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
Change 4013c4ee caused a regression after renaming layoutRect
to layoutMargins. This patch will fix the regression
in DefaultComboBox related to that.
Change-Id: I05774b582c750e4614c0a70926613114b259a515
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
| |
Change-Id: I3cf376c680557c3d43753f6f4c627344192eb30c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
| |
Change-Id: Ied2055866a67798ce60105e7251740a3e66b38db
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
| |
Having them just complicates setting debug flags from QML.
Add a separate debug flag "NinePatchMargins" in the drive-by.
Change-Id: I56e1cc6f36368976b9325829816ab5a1bdb1f4ba
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
We need to draw the debug rect using the calculated margins.
Otherwise the rect will be drawn wrong once the control
is resized.
Change-Id: Ieb188900c688205147f991b98b5aeee836571e3d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The layoutRect are, similar to contentRect, calculated based
on the minimumSize of the control. Since we don't know what
the actual layoutRect will be until a control is resized, we
use it instead to calculate what the margins should be between
the boundingRect() and layoutRect. We do the same for content
rect. This will allows us to calculate the correct margins
early on, before knowing what the end size of the control will be.
Change-Id: I26b0aedee28533a70fd8dc4918f962f41c4f5185
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
Take the opportunity to clean up the flags a bit, and
improve how we print the options to the console.
Change-Id: Ia6e81453bfd53a5bfe6328b7cb8f6abcbf2dbed1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
| |
This was wrongly added in 2275a0896c7b7e648641f4c6977a02006a581577,
but I didn't realize we already had qquickdrawutil.*.
Change-Id: I873c0e2fcd2cb6df46966c59882db3eff33bc744
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|