4import QGroundControl.Controls
6/// Works just like a regular MouseArea except:
7/// 1) It supports the ability to show touch extents based on QGroundControl.showTouchAreas
8/// 2) You can specify fillItem and it will automatically fill to the size and adjust touch areas on mobile
10 anchors.leftMargin: fillItem ? -_touchMarginHorizontal : 0
11 anchors.rightMargin: fillItem ? -_touchMarginHorizontal : 0
12 anchors.topMargin: fillItem ? -_touchMarginVertical : 0
13 anchors.bottomMargin: fillItem ? -_touchMarginVertical : 0
14 anchors.fill: fillItem ? fillItem : undefined
17 property bool debugMobile: false ///< Allows you to debug mobile sizing on desktop builds
19 property real _itemWidth: fillItem ? fillItem.width : width
20 property real _itemHeight: fillItem ? fillItem.height : height
21 property real _touchWidth: Math.max(_itemWidth, ScreenTools.minTouchPixels)
22 property real _touchHeight: Math.max(_itemHeight, ScreenTools.minTouchPixels)
23 property real _touchMarginHorizontal: debugMobile || ScreenTools.isMobile ? (_touchWidth - _itemWidth) / 2 : 0
24 property real _touchMarginVertical: debugMobile || ScreenTools.isMobile ? (_touchHeight - _itemHeight) / 2 : 0
29 border.width: QGroundControl.corePlugin.showTouchAreas ? 3 : 0