diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-11-07 14:11:26 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-14 11:05:10 +0100 |
commit | e88bdffe644e53912dfbce95117555cb6a87bfd2 (patch) | |
tree | 43b34dfad7bdcbfdf0ac2ea322b580933bbeb2a3 /src/controls/Private/MenuContentScroller.qml | |
parent | 6cfba0c37dcdbe13681f8241d9d2989d1ac05db8 (diff) | |
download | qtquickcontrols-e88bdffe644e53912dfbce95117555cb6a87bfd2.tar.gz |
Introducing styling for Menu, MenuBar
MenuStyle
We expose the frame and item properties together with some
convenience properties (basically color related).
The menu item data is exposed via a styleData object, similarly to
what's done in TabViewStyle.
In addition, we introduce MenuStyle.menuItem which brings some
convenience when it comes to overriding subcontrols of the menu item.
MenuBarStyle
We expose background and menuBarItem. The menubar item's properties
are accessible through the styleData property in scope.
Style cascading
Additionally, MenuBarStyle has a menuStyle property that will apply
to all its menus and their submenus. Similarly, assigning a style
to a Menu object, will apply it to its submenus. It's still possible
to override the parent menu's style by declaring its own.
[ChangeLog][QtQuickControls][Styles]Menu and MenuBar are now styleable
Change-Id: Ib724b7a6426bdfce5da314620d51dfaa76f76500
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/controls/Private/MenuContentScroller.qml')
-rw-r--r-- | src/controls/Private/MenuContentScroller.qml | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/controls/Private/MenuContentScroller.qml b/src/controls/Private/MenuContentScroller.qml index 30a8825a..e18132bb 100644 --- a/src/controls/Private/MenuContentScroller.qml +++ b/src/controls/Private/MenuContentScroller.qml @@ -39,27 +39,36 @@ ****************************************************************************/ import QtQuick 2.1 +import QtQuick.Controls 1.1 MouseArea { - property string direction + id: scrollIndicator + property int direction: 0 anchors { - top: direction === "up" ? parent.top : undefined - bottom: direction === "down" ? parent.bottom : undefined + top: direction === Qt.UpArrow ? parent.top : undefined + bottom: direction === Qt.DownArrow ? parent.bottom : undefined } hoverEnabled: visible - height: scrollerLoader.item.height + height: scrollerLoader.height width: parent.width Loader { id: scrollerLoader - sourceComponent: menuItemDelegate - property int index: -1 - property var modelData: { - "visible": true, - "scrollerDirection": direction, + width: parent.width + sourceComponent: scrollIndicatorStyle + // Extra property values for desktop style + property var __menuItem: null + property var styleData: { + "index": -1, + "type": MenuItemType.ScrollIndicator, + "text": "", + "selected": scrollIndicator.containsMouse, + "scrollerDirection": scrollIndicator.direction, + "checkable": false, + "checked": false, "enabled": true } } |