added multimonitor support

- cursor fix @input
- now you are able to add bigger monitors - still in beta
Some features are still missing: checking if monitors are connected/disconnected,
resizing by destroying the blocks
This commit is contained in:
Robert Jelic
2022-09-05 23:00:38 +02:00
parent a3291544ac
commit cf4f15e659
5 changed files with 290 additions and 27 deletions

View File

@@ -61,7 +61,7 @@ return function(name)
textX = tostring(val):len() + 1
wIndex = math.max(1, textX-self:getWidth()+1)
local obx, oby = self:getAnchorPosition()
self.parent:setCursor(true, obx + textX - wIndex, oby+math.floor(self.height/2), self.fgColor)
self.parent:setCursor(true, obx + textX - wIndex, oby+math.floor(self:getHeight()/2), self.fgColor)
end
end
self:updateDraw()
@@ -179,7 +179,7 @@ return function(name)
local obx, oby = self:getAnchorPosition()
local val = tostring(base.getValue())
local cursorX = (textX <= val:len() and textX - 1 or val:len()) - (wIndex - 1)
local inpX = self:getX()
if (cursorX > inpX + w - 1) then
cursorX = inpX + w - 1
@@ -251,7 +251,7 @@ return function(name)
wIndex = 1
end
end
self.parent:setCursor(true, obx + textX - wIndex, oby+math.max(math.ceil(h/2-1, 1)), self.fgColor)
self.parent:setCursor(true, ax + textX - wIndex, ay+math.max(math.ceil(h/2-1, 1)), self.fgColor)
return true
end
end,
@@ -346,7 +346,7 @@ return function(name)
end
end
if(self:isFocused())then
self.parent:setCursor(true, obx + textX - wIndex, oby+math.max(math.ceil(self:getHeight()/2-1, 1)), self.fgColor)
self.parent:setCursor(true, obx + textX - wIndex, oby+math.floor(self:getHeight()/2), self.fgColor)
end
end
end