qtquick: add a way to disable the default mouse redirectors
So user can use his own
This commit is contained in:
@@ -21,6 +21,7 @@ Rectangle {
|
||||
readonly property int nonContentsHeight: titleBar.heightWhenVisible + tabbar.height
|
||||
property int contentsMargin: 2
|
||||
property int titleBarContentsMargin: 1
|
||||
properby bool hasCustomMouseEventRedirector: false
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -108,7 +109,8 @@ Rectangle {
|
||||
|
||||
onTabBarCppChanged: {
|
||||
if (tabBarCpp) {
|
||||
tabBarCpp.redirectMouseEvents(dragMouseArea)
|
||||
if (!root.hasCustomMouseEventRedirector)
|
||||
tabBarCpp.redirectMouseEvents(dragMouseArea)
|
||||
|
||||
// Setting just so the unit-tests can access the buttons
|
||||
tabBarCpp.tabBarQmlItem = this;
|
||||
|
||||
@@ -36,6 +36,9 @@ Rectangle {
|
||||
/// Don't set 'hight' directly in the overridden component
|
||||
property int heightWhenVisible: 30
|
||||
|
||||
/// Set to true if you're using a custom MouseEventRedirector in your code
|
||||
property bool hasCustomMouseEventRedirector: false
|
||||
|
||||
/// @brief Signal emitted by a TitleBar.qml component when the close button is clicked
|
||||
signal closeButtonClicked();
|
||||
|
||||
@@ -58,7 +61,8 @@ Rectangle {
|
||||
|
||||
onTitleBarCppChanged: {
|
||||
if (titleBarCpp) {
|
||||
titleBarCpp.redirectMouseEvents(dragMouseArea)
|
||||
if (!root.hasCustomMouseEventRedirector)
|
||||
titleBarCpp.redirectMouseEvents(dragMouseArea)
|
||||
|
||||
// Setting just so the unit-tests can access the buttons
|
||||
titleBarCpp.titleBarQmlItem = this;
|
||||
|
||||
Reference in New Issue
Block a user