Close popup windows when application state changes

Nobody is telling the popup to close. If it was, that was probably as a
side effect of the Qt::Popup flag on some platforms. Certainly not on
Windows.

We check for the application state as the application may use a popup
to signal the user about some event happening, and we don't want to close
the popup as soon as the user makes the application active again.

Task-number: QTBUG-36474
Change-Id: If41f7bec696105e3c7d8897e9af5fc075c7b8933
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Native MessageDialog: connect the new version of the clicked signal

After f212322a6ecb237d5fb53e56c6dafffb87e45f09 there was a warning on
connect, and it was not possible to dismiss a native MessageDialog
(for example on Android).

Change-Id: I12f62d5bdb61176ea2ff08c6be3731010cb47d45
Reviewed-by: BogDan Vatra <bogdan@kde.org>
MenuItem: Update platform menu item when checkable changes

This is required to inform the platform backend to change the menu
item's appearance.

Change-Id: I326ac2d79b4f9e7646c2c01b7f41662310736b18
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Simplify Slider's MouseArea

Change-Id: Ib7bc6a370a4cb2bac34d08f4191cca28b69a7185
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Popupmenu: update item under mouse upon press

We need to update item under mouse when doing a mouse press
since you don't have a guarantee that there will be a mouse
move before you eventually get a mouse release. This will
be the case on iOS (and probably other touch platforms).

Change-Id: Ia7220e9a822248ee7dc73b5530b04e858a0be47b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Replace module includes in dialogs

Replace a number of QtQml module inclusions with their more specific
counterparts, possibly leading to decreased compilation time.

Change-Id: I9b48b06e884d46c6440725a704951dc87e2e93db
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Fixed offset for overlay in moveable TableViewColumns

The Loader needs to be reparented in order to draw the overlay on
top of everything. In addition we need to take both the item offset and
the contentX into account. Note I also tweaked the actual drop offset
by headerRowDelegate.width/2 as that feels a bit more balanced.

[ChangeLog][QtQuickControls][TableView] Fixed an issue with
the header overlay offset while re-arranging TableViewColumns

Task-number: QTBUG-37180
Change-Id: Ia80049616bb30e1391948fdeaf3f8d68afd7ce3e
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Styling improvements for Calendar

Also
- added the property Calendar::frameVisible.
- moved the gridVisible property to CalendarStyle

Change-Id: I57da65af130098ac5d0b858c9f964e52e3ba6922
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Label should use SystemPalette.windowText

In themes with inversed colors text and windowText colors may differ,
and Label as QLabel's analog should use the correct one

Task-number: QTBUG-37468
Change-Id: Ie4f574e782b1c9274d86f45433c36ecab2989b97
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Menu: Estimate item height from first visible item

The first item could be hidden, or not a normal item,
thus returning an unproper height. The consequence in
the reported issue being that the popup's maximum height
would be that of a scroll indicator.

Task-number: QTBUG-37445
Change-Id: Ib06d25643cd11224d5eab0452dadd0f6d4119fb9
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Menu: Improved sloppy menus logic

Instead of relying on fixed angles, we now test that the current
mouse position is in the triangle defined by the previous mouse
position and the submenu's top-left and bottom-left corners. The
sloppy timer duration has also been increased to 1s.

Change-Id: I575346ac20b5da68ab8ebd6e3cf9a6ddba2b7a72
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
QtQuick.Dialogs Dialog: implicit geometry fixes

On platforms with in-scene dialogs (such as Android), implicitHeight
was updating too often, not at the optimal time, and not after
being set invisible.  The result was that if you added more buttons
while the dialog was invisible, it did not grow in height if needed.

Task-number: QTBUG-37285

Change-Id: I0b0ad230751361aed89b71b190f12e53d6c73a22
Reviewed-by: Liang Qi <liang.qi@digia.com>
Merge remote-tracking branch 'origin/release' into stable

Change-Id: Ib619455982ebb154ba5344765b11da5c04091409
Button's text should use SystemPalette.buttonText

In themes with inversed colors text and buttonText colors may differ,
and Button as QButton's analog should use the correct one.

Change-Id: I101e0c463faf5f99df0282486aef0d3411b41156
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Clean-up styling improvements for Calendar

This is a fix-up for 4569ed127c290bea8d165e15dc2eca525825c627 :
"verticalAlignment: Text.AlignVCenter" not needed for alread-centered text;
make previousMonth button center-in parent, similarly to nextMonth button;
drop dead code from HoverButton.

Change-Id: Iceb096944d084ecded70611e3da754150a0e098e
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Doc: Document signals (not handlers) under \qmlsignal

Task-number: QTBUG-35846

Change-Id: I358c3427429b669425f0065686da7e202568c84d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Slider: don't prevent stealing until drag threshold is exceeded

If a Slider is placed in a Flickable (or ListView, etc.),
preventStealing means that you cannot flick the flickable by dragging
over the Slider.  It's better to postpone setting that until we
detect whether the user is really attempting to drag the slider,
because we don't want to rule out use cases such as vertical sliders
in a horizontal ListView or vice-versa, so that you drag in
one direction to move the slider and in another direction to flick.
Platform drag threshold is exposed in Settings (from QStyleHints).
(reverts/refines c9665f3e2d1eb12f1cc5a569c20f5d569fafde7f)

Change-Id: I82feda6028f6effa5b26ad575a1933e48e971453
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
ScrollView: flick threshold comes from platform style

QStyleHints::startDragDistance is used as the standard drag or flick
threshold in QtQuick generally.  We should follow suit because it
may depend on platform characteristics such as screen resolution and
sensitivity of the input devices.

Change-Id: Ibbc7b4549351f795c10de792cb8fa3ff9f5ae58d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Doc: Append handler names to \qmlsignal documentation

Change-Id: I5e06bdf03ba1ba8e5fe7669f690420dc9a039129
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
MenuItem: Don't delete owned bound actions

They may be referenced from somewhere else, and
there's no reason not to keep them alive while
the MenuItem is alive.

Task-number: QTBUG-37554
Change-Id: Idaab616c856348c0b7eeb1a2e9fdc5bfc3f8a5fd
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>