aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickpopup_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Implement accessibility support for Popup and MenuJ-P Nurmi2016-02-251-0/+8
| | | | | | Change-Id: I55067bb1cb9888be8e0e991fb73c9365d93d04f4 Task-number: QTBUG-51316 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* QQuickPopup: add some missing propertiesJ-P Nurmi2016-02-061-3/+27
| | | | | Change-Id: I7df64587bf3ba289ba027f6dbe9872362532ec41 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Make popups work without ApplicationWindow, to some degreev5.6.0-rc1v5.6.0J-P Nurmi2016-01-301-0/+1
| | | | | | | | | | | | | | Using ApplicationWindow is highly recommended. First of all, with a plain Window, QQuickPopup attempts to set a high z-value, but cannot guarantee correct stacking order. Secondly, we cannot provide style- specific background dimming for modal popups, because it is styled as part of ApplicationWindow. Last but not least, QQuickPopup has to install a window-level event filter, which is far less efficient than how event handling done in QQuickOverlay. Change-Id: I08915abce7a1764177b92f7539eef77c054a405a Task-number: QTBUG-49921 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add Popup::marginsJ-P Nurmi2016-01-301-0/+31
| | | | | | | | | | | | Allow specifying margins around the popup that are taken into account while positioning the popup. For example, the Material style draws a drop shadow that goes outside the popups bounds. This allows it to specify margins so that the drop shadow doesn't get clipped. Other use case is to specify the margins so that the popup doesn't overlap with window header or footer. Change-Id: I018d961259fa8b960d86b77de01413eefb75a59b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add QQuickPopup::popupItem()J-P Nurmi2016-01-281-0/+2
| | | | | | | | | | | | | | Even though I didn't want to expose this, because I'm still hoping we could make QQuickPopup inherit QQuickControl in the future, the fact that QQuickPopupPrivate::get(popup)->popupItem was used in so many places is a good indicator that accessing the popup item is often required when dealing with popups. In any case, this is C++ only API and not exposed to QML, so it's not that big deal... and we can always deprecate it later and make it return "this" should the item plans come true. Change-Id: I6b99a499327d838ee61eae70f8ebf8e77f00ae39 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Replace Popup::pressed|releasedOutside with close policy flagsJ-P Nurmi2016-01-281-8/+6
| | | | | Change-Id: I3e09c4e2b6cbbe39bdf9e943905664e5dc1fe954 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add Popup::closePolicyJ-P Nurmi2016-01-281-0/+16
| | | | | Change-Id: Ie3d0f50a59aeaab36ec388af897cbf2596269ce3 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add Popup::transformOriginJ-P Nurmi2016-01-251-0/+12
| | | | | Change-Id: I4a52468234f0479c1b8feb102e07686e3235ba3f Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add Popup::setVisible()J-P Nurmi2016-01-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | This allows nice bindings such as: Slider { id: slider Popup { y: -height - 1 x: -width / 2 + slider.handle.width / 2 parent: slider.handle visible: slider.pressed // <--- Label { text: slider.position.toFixed(2) } } } Change-Id: Iebde004205636de31d0f0dd0f6404f0755aaf0df Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Popup: add implicit & content sizesJ-P Nurmi2016-01-231-4/+31
| | | | | | | Behaves the same way than the Pane/Frame/GroupBox container controls. Change-Id: I370f3961b77a363a63a0a64fc629cc5da6dfd53f Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Add Popup::parentJ-P Nurmi2016-01-231-0/+7
| | | | | | | | | | | | | | | The parent defaults to the QML parent object where Popup is declared. Popup::x/y are relative to the parent, and the popup also automatically follows the parent as appropriate. QQuickPopupPositioner has been adapted from Qt Quick Controls 1. It was called QQuickScenePosListener, and it was implemented for the text selection handle popups. ComboBox's popup now follows the control eg. when scrolling, but the below/above positioning feature is temporarily gone missing. It will be restored in a follow up commit. Change-Id: I8a6b58cd74e07f33930abc35d0ab9da056685128 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Forward input events from the internal QQuickPopupItem to QQuickPopupJ-P Nurmi2016-01-221-0/+12
| | | | | | | | | Popup accepts/blocks all input events by default, to avoid them leaking throgh. Subclasses may override the event handlers to implement eg. key navigation (menu). Change-Id: I726b6a3f61a397e4f95d736c6617dd77a35b01dc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Refactor PopupJ-P Nurmi2016-01-221-0/+71
| | | | | | | | | | | Added relevant properties to make it almost like a Control: x, y, width, height, padding, background... This change makes popup use an internal item where the style/user-supplied contentItem and background are re-parented. This way we can provide a default style (background) for Popup. Change-Id: I3e7933562464c5c852e4ba4bc37d9ac25691c714 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add QQuickPopup::contentItemChange()J-P Nurmi2016-01-221-0/+2
| | | | | | | | | Works the same way than QQuickControl::contentItemChange(). This is more efficient and correct (in theory, supports changing the content item at run time) than connecting to the contentItemChanged() signal. Change-Id: I09db809760ddf2c7d62cc2937a6b821f0cd4dad7 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add QQuickPopup::isComponentComplete()J-P Nurmi2016-01-211-1/+7
| | | | | | | Needed for the next commit. Change-Id: Icb34d6f772dd1ab662b050580aa776fdc78afa49 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Replace Q_DECLARE_TYPEINFO(T, Q_COMPLEX_TYPE) by QML_DECLARE_TYPE(T)J-P Nurmi2015-12-211-0/+3
| | | | | | | | | | | Q_COMPLEX_TYPE tells Qt containers that the type has a ctor/dtor and that it may not be moved in memory using memcpy(). QML types are never stored by value in Qt containers (non-copyable QObjects), so the type info declaration is superfluous. QML_DECLARE_TYPE, however, is useful (QTBUG-49920) and consistently used for all QtQuick types. Change-Id: I3bd1718b306fa7af85a623fa7a17e1b9653d2152 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Just tidy up QQuickPopup a bitJ-P Nurmi2015-12-191-6/+4
| | | | | Change-Id: Ibc8097299f0796f943682f0c1de628a8da87e430 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Rename Popup transitionsJ-P Nurmi2015-12-191-8/+8
| | | | | | | | | Use Android-inspired enter & exit, which eliminates the need of using a "transition" suffix, and also less prone to appear in auto-completion when new users try to open/show/close/hide popups. Change-Id: I3a448d3e9be33fbfffbf08488858aa63a70233f2 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Popup: rename show()/hide() to open()/close()J-P Nurmi2015-12-141-3/+3
| | | | | | | | | QML popups have traditionally used more explicit open() and close(). Renaming them to show() and hide() at this stage doesn't seem to have any real advantages. Change-Id: I1e7c8c4817c67e62cef965525e00f5bf125a7d76 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Rename Panel to PopupJ-P Nurmi2015-12-091-0/+121
Popup is a more descriptive name. Furthermore, this name change opens the door for another type called Pane. It gives the appropriate background color for the current style & theme. Change-Id: Idb91d37e807f62e870b50f0b656e84ee2d43a9fb Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>