Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the resize issue on classic, potentially also other clients. #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Lua.diagnostics.globals": [
"HybridScrollFrame_CreateButtons",
"HybridScrollFrame_GetOffset",
"HybridScrollFrame_Update",
"SlashCmdList",
"ColorPickerFrame"
]
}
35 changes: 35 additions & 0 deletions ViragDevTool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,19 @@ end
-----------------------------------------------------------------------------------------------
-- UI
-----------------------------------------------------------------------------------------------


function ViragDevTool:OnUpdate()
if self.isUiUpdateEnabled then
self:DragResizeColumn(self.wndRef.columnResizer, true)
self:UpdateMainTableUI(true)
self:UpdateSideBarUI()
end
end




function ViragDevTool:UpdateUI()
self:UpdateMainTableUI()
self:UpdateSideBarUI()
Expand Down Expand Up @@ -595,7 +608,13 @@ function ViragDevTool:UpdateMainTableUI(force)

HybridScrollFrame_Update(scrollFrame, totalRowsCount * buttons[1]:GetHeight(), scrollFrame:GetHeight());

-- local scrollWidth = scrollFrame:GetWidth()
-- local parentWidth = self.wndRef:GetWidth()
-- local scrollChildWidth = scrollFrame.scrollChild:GetWidth()
-- print(string.format("Parent: %s, Scroll %s, Child %s", parentWidth, scrollWidth, scrollChildWidth))

scrollFrame.scrollChild:SetWidth(scrollFrame:GetWidth())

end

function ViragDevTool:UpdateScrollFrameRowSize(scrollFrame)
Expand Down Expand Up @@ -1052,6 +1071,22 @@ end
function ViragDevTool:OnLoad(mainFrame)
self.wndRef = mainFrame

self.wndRef.resize:HookScript("OnMouseDown", function()
self.isUiUpdateEnabled = true;
end)
self.wndRef.resize:HookScript("OnMouseUp", function()
self.isUiUpdateEnabled = false;
end)

self.wndRef:SetScript("OnUpdate", function()
if not self.wndRef:IsVisible() then
return
end
if self.isUiUpdateEnabled then
self:OnUpdate()
end
end)

self.wndRef:RegisterEvent("ADDON_LOADED")
self.wndRef:RegisterEvent("PLAYER_ENTERING_WORLD") --VARIABLES_LOADED
self.wndRef:SetScript("OnEvent", function(this, event, addonName, ...)
Expand Down
33 changes: 22 additions & 11 deletions ViragDevTool.xml
Original file line number Diff line number Diff line change
Expand Up @@ -313,25 +313,32 @@

ViragDevTool:OnLoad(self)
self:SetUserPlaced(true)
self:SetMinResize(635, 200);
self:SetMaxResize(UIParent:GetWidth(), UIParent:GetHeight());

self.resize:Init(self, 500, 300, 1100, 800)
self:RegisterForDrag("LeftButton");
</OnLoad>

</OnLoad>

<OnDragStart>
self:StartMoving()
-- self.columnResizer:
</OnDragStart>

<OnDragStop>
self.isMoving = false
self:StopMovingOrSizing();
self:StopMovingOrSizing()
</OnDragStop>

</Scripts>
<Frames>
<!--DRAG-RESIZE CORNER BUTTON-->
<Button name="$parentResizeButton" parentKey="resizeButton">

<Button parentKey="resize" inherits="PanelResizeButtonTemplate">
<Size x="16" y="16"/>
<Anchors>
<Anchor point="BOTTOMRIGHT" x="0" y="0"/>
</Anchors>
</Button>


<!-- <Button name="$parentResizeButton" parentKey="resizeButton">
<Size x="16" y="16"/>
<Anchors>
<Anchor point="BOTTOMRIGHT" relativeTo="$parent"/>
Expand Down Expand Up @@ -374,7 +381,10 @@
<NormalTexture file="Interface\ChatFrame\UI-ChatIM-SizeGrabber-Up"/>
<HighlightTexture file="Interface\ChatFrame\UI-ChatIM-SizeGrabber-Highlight"/>
<PushedTexture file="Interface\ChatFrame\UI-ChatIM-SizeGrabber-Down"/>
</Button>
</Button> -->



<!--LABEL FOR FUNCTION ARGUMENTS-->
<Button text="Arguments:" inherits="ViragDevToolButtonTemplate" name="$parentFNCallLabelButton"
parentKey="clearFnArgsButton">
Expand All @@ -394,7 +404,8 @@
<EditBox name="$parentTextArea" inherits="ViragDevToolEditBoxTemplate" autoFocus="false"
parentKey="editbox">
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentResizeButton" relativePoint="LEFT" x="-14"/>
<Anchor point="RIGHT" relativeKey="$parent.resize" relativePoint="LEFT" x="-14"/>
<!-- <Anchor point="RIGHT" relativeTo="$parentResizeButton" relativePoint="LEFT" x="-14"/> -->
<Anchor point="LEFT" relativeTo="$parentFNCallLabelButton" relativePoint="RIGHT" x="10"/>
</Anchors>
<Scripts>
Expand Down Expand Up @@ -685,4 +696,4 @@
</Frame>


</Ui>
</Ui>