76
87
function test_doHighlightWhenPressed() {
77
88
baseMenu.highlightWhenPressed = true;
78
89
mousePress(baseMenu, baseMenu.width/2, baseMenu.height/2)
79
compare(Qt.colorEqual(baseMenu.highlightColor, theme.palette.highlighted.background), true)
90
compare(Qt.colorEqual(baseMenu.highlightColor, baseMenu.menuStyle.highlightColor), true)
80
91
mouseRelease(baseMenu)
83
94
function test_showDivider() {
84
compare(baseMenu.showDivider, false)
85
95
compare(baseMenu.divider.visible, false)
87
baseMenu.showDivider = true
88
compare(baseMenu.showDivider, true)
97
baseMenu.divider.visible = true
89
98
compare(baseMenu.divider.visible, true)
91
baseMenu.showDivider = false
100
baseMenu.divider.visible = false
92
101
compare(baseMenu.divider.visible, false)
93
compare(baseMenu.showDivider, false)
96
104
function test_hideDivider() {
97
compare(dividerMenu.showDivider, true)
98
105
compare(dividerMenu.divider.visible, true)
100
dividerMenu.showDivider = false
101
compare(dividerMenu.showDivider, false)
107
dividerMenu.divider.visible = false
102
108
compare(dividerMenu.divider.visible, false)
104
dividerMenu.showDivider = true
110
dividerMenu.divider.visible = true
105
111
compare(dividerMenu.divider.visible, true)
106
compare(dividerMenu.showDivider, true)
109
function test_hideDividerLegacy() {
110
legacyDividerMenu.showDivider = false
111
compare(legacyDividerMenu.showDivider, false)
112
compare(legacyDividerMenu.divider.visible, false)
114
legacyDividerMenu.showDivider = true
115
compare(legacyDividerMenu.divider.visible, true)
116
compare(legacyDividerMenu.showDivider, true)
114
function test_noMenuHeight() {
115
compare(baseMenu.height > baseMenu.menuHeight, true)
118
function test_dividerMenuHeight() {
119
menuHeightMenu.divider.visible = true
120
compare(menuHeightMenu.height, menuHeightMenu.menuHeight + dividerMenu.divider.height)
123
function test_noDividerMenuHeight() {
124
menuHeightMenu.divider.visible = false
125
compare(menuHeightMenu.height, menuHeightMenu.menuHeight)
119
128
function test_clickEvent() {
178
187
mouseClick(removeAction, removeAction.width/2, removeAction.height/2)
179
188
tryCompare(signalSpy, "count", 1)
191
function test_pointerMode() {
192
compare(pointerModeMenu.menuStyle, PointerStyle, "menuStyle doesn't match Pointer")
195
function test_touchMode() {
196
compare(touchModeMenu.menuStyle, TouchStyle, "menuStyle doesn't match Touch")