mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
fix and changes
* win32 compilation fix * add buttons to miniwindow * dispatcher events fixes * ui fixes
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
BIN
modules/game/images/miniwindowbuttons.png
Normal file
BIN
modules/game/images/miniwindowbuttons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 551 B |
@@ -19,14 +19,45 @@ MiniWindow < UIMiniWindow
|
||||
height: 24
|
||||
image-border-bottom: 1
|
||||
|
||||
UIButton
|
||||
id: closeButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
margin-top: 5
|
||||
margin-right: 5
|
||||
size: 14 14
|
||||
image-source: /game/images/miniwindowbuttons.png
|
||||
image-clip: 14 0 14 14
|
||||
|
||||
$hover:
|
||||
image-clip: 14 14 14 14
|
||||
|
||||
$pressed:
|
||||
image-clip: 14 28 14 14
|
||||
|
||||
UIButton
|
||||
id: minimizeButton
|
||||
anchors.top: closeButton.top
|
||||
anchors.right: closeButton.left
|
||||
margin-right: 3
|
||||
size: 14 14
|
||||
image-source: /game/images/miniwindowbuttons.png
|
||||
image-clip: 0 0 14 14
|
||||
|
||||
$hover:
|
||||
image-clip: 0 14 14 14
|
||||
|
||||
$pressed:
|
||||
image-clip: 0 28 14 14
|
||||
|
||||
ResizeBorder
|
||||
id: bottomResizeBorder
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 2
|
||||
margin-bottom: 1
|
||||
height: 1
|
||||
minimum: 70
|
||||
background: #ffffff88
|
||||
|
||||
VerticalScrollBar
|
||||
id: miniwindowScrollBar
|
||||
@@ -37,7 +68,6 @@ MiniWindow < UIMiniWindow
|
||||
margin-top: 22
|
||||
margin-right: 2
|
||||
margin-bottom: 2
|
||||
fade-effect: false
|
||||
|
||||
MiniWindowContents < ScrollablePanel
|
||||
anchors.fill: parent
|
||||
|
@@ -1,36 +0,0 @@
|
||||
UIMiniWindow = extends(UIWindow)
|
||||
|
||||
function UIMiniWindow.create()
|
||||
local miniwindow = UIMiniWindow.internalCreate()
|
||||
return miniwindow
|
||||
end
|
||||
|
||||
function UIMiniWindow:onDragEnter(mousePos)
|
||||
local parent = self:getParent()
|
||||
if not parent then return false end
|
||||
|
||||
if parent:getClassName() == 'UIMiniWindowContainer' then
|
||||
local containerParent = parent:getParent()
|
||||
parent:removeChild(self)
|
||||
containerParent:addChild(self)
|
||||
end
|
||||
|
||||
local oldPos = self:getPosition()
|
||||
self.movingReference = { x = mousePos.x - oldPos.x, y = mousePos.y - oldPos.y }
|
||||
self:setPosition(oldPos)
|
||||
return true
|
||||
end
|
||||
|
||||
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
|
||||
-- TODO: drop on other interfaces
|
||||
end
|
||||
|
||||
function UIMiniWindow:onFocusChange(focused)
|
||||
-- miniwindows only raises when its outside MiniWindowContainers
|
||||
if not focused then return end
|
||||
local parent = self:getParent()
|
||||
if parent and parent:getClassName() ~= 'UIMiniWindowContainer' then
|
||||
self:raise()
|
||||
end
|
||||
end
|
||||
|
@@ -2,6 +2,7 @@ UIMiniWindow = extends(UIWindow)
|
||||
|
||||
function UIMiniWindow.create()
|
||||
local miniwindow = UIMiniWindow.internalCreate()
|
||||
miniwindow:setFocusable(false)
|
||||
return miniwindow
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user