fix useWith mouse conflict with resize borders
This commit is contained in:
parent
5201071707
commit
0e46df3f29
|
@ -40,7 +40,9 @@ MainWindow
|
||||||
|
|
||||||
LineEdit
|
LineEdit
|
||||||
id: serverHostLineEdit
|
id: serverHostLineEdit
|
||||||
tooltip: Only protocol 8.6 is supported
|
tooltip: |-
|
||||||
|
Make sure that your client uses
|
||||||
|
the correct game protocol version
|
||||||
anchors.left: serverLabel.left
|
anchors.left: serverLabel.left
|
||||||
anchors.right: serverLabel.right
|
anchors.right: serverLabel.right
|
||||||
anchors.top: serverLabel.bottom
|
anchors.top: serverLabel.bottom
|
||||||
|
|
|
@ -1,19 +1,29 @@
|
||||||
Mouse = {}
|
Mouse = {}
|
||||||
|
|
||||||
|
local cursorChanged = true
|
||||||
|
|
||||||
function Mouse.setTargetCursor()
|
function Mouse.setTargetCursor()
|
||||||
g_window.setMouseCursor('/core_styles/cursors/targetcursor.png', {x=9,y=9})
|
g_window.setMouseCursor('/core_styles/cursors/targetcursor.png', {x=9,y=9})
|
||||||
|
cursorChanged = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function Mouse.setHorizontalCursor()
|
function Mouse.setHorizontalCursor()
|
||||||
g_window.setMouseCursor('/core_styles/cursors/horizontal.png', {x=9,y=4})
|
g_window.setMouseCursor('/core_styles/cursors/horizontal.png', {x=9,y=4})
|
||||||
|
cursorChanged = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function Mouse.setVerticalCursor()
|
function Mouse.setVerticalCursor()
|
||||||
g_window.setMouseCursor('/core_styles/cursors/vertical.png', {x=4,y=9})
|
g_window.setMouseCursor('/core_styles/cursors/vertical.png', {x=4,y=9})
|
||||||
|
cursorChanged = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function Mouse.restoreCursor()
|
function Mouse.restoreCursor()
|
||||||
g_window.restoreMouseCursor()
|
g_window.restoreMouseCursor()
|
||||||
|
cursorChanged = false
|
||||||
|
end
|
||||||
|
|
||||||
|
function Mouse.isCursorChanged()
|
||||||
|
return cursorChanged
|
||||||
end
|
end
|
||||||
|
|
||||||
function Mouse.isPressed()
|
function Mouse.isPressed()
|
||||||
|
|
|
@ -10,7 +10,7 @@ end
|
||||||
|
|
||||||
function UIResizeBorder:onHoverChange(hovered)
|
function UIResizeBorder:onHoverChange(hovered)
|
||||||
if hovered then
|
if hovered then
|
||||||
if g_ui.getDraggingWidget() then return end
|
if Mouse.isCursorChanged() or Mouse.isPressed() then return end
|
||||||
if self:getWidth() > self:getHeight() then
|
if self:getWidth() > self:getHeight() then
|
||||||
Mouse.setVerticalCursor()
|
Mouse.setVerticalCursor()
|
||||||
self.vertical = true
|
self.vertical = true
|
||||||
|
|
|
@ -9,7 +9,7 @@ end
|
||||||
|
|
||||||
function UISplitter:onHoverChange(hovered)
|
function UISplitter:onHoverChange(hovered)
|
||||||
if hovered then
|
if hovered then
|
||||||
if g_ui.getDraggingWidget() then return end
|
if Mouse.isCursorChanged() or Mouse.isPressed() then return end
|
||||||
if self:getWidth() > self:getHeight() then
|
if self:getWidth() > self:getHeight() then
|
||||||
Mouse.setVerticalCursor()
|
Mouse.setVerticalCursor()
|
||||||
self.vertical = true
|
self.vertical = true
|
||||||
|
|
|
@ -65,6 +65,7 @@ IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInf
|
||||||
OPTION(CRASH_HANDLER "Generate crash reports" ON)
|
OPTION(CRASH_HANDLER "Generate crash reports" ON)
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "Debug information: OFF")
|
MESSAGE(STATUS "Debug information: OFF")
|
||||||
|
OPTION(CRASH_HANDLER "Generate crash reports" OFF)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(CMAKE_BUILD_TYPE STREQUAL "Release")
|
IF(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
|
|
Loading…
Reference in New Issue