Opened 8 years ago

Closed 7 years ago

#441 closed defect (fixed)

tooltips for commands can be off the bottom of the screen

Reported by: Bluestone Owned by:
Priority: major Milestone:
Component: BAR Version:
Keywords: Cc:

Description

If I'm silly enough to move my mouse near the bottom of the button when issueing a command order

Btw the UI looks really nice!

Change History (4)

comment:1 by Bluestone, 8 years ago

Component: BA trunkBAR

comment:2 by Funkencool, 8 years ago

I'll get to this, because it bugs me too; I just have to decide where I'm going with all the tooltip stuff.

comment:3 by Jalmari Ikävalko, 7 years ago

I tried to do a quick fix for this as my first attempt of modifying the lua scripts.

From luaui/gui_chili_funks_cursortip.lua, the two if-statements under the comment:

    local function MakeToolTip()
           
            local tooltip               = tooltip
            local x,y                   = mousePosX,mousePosY
            local textwidth             = tip.font:GetTextWidth(tooltip)
            local textheight,_,numLines = tip.font:GetTextHeight(tooltip)
     
            -- Making sure the tooltip is within the boundaries of the screen
            if (x + 20 + textwidth + 10) > screenWidth then
                    x = screenWidth - 20 - textwidth - 10
            end
            if (y - 20 - (14 * numLines + 2)) < 0 then
                    y = 14 * numLines + 2 + 20
            end
     
            tipWindow:SetPos(x + 20, screenHeight - y + 20, textwidth + 10, 14 * numLines + 2)
           
            if tipWindow.hidden then tipWindow:Show() end
            tipWindow:BringToFront()
    end

Those magic numbers (+20, +10, +2..) are a little ugly. Fixing them, I assume, requires some variables for the padding and changing all the occurrences of constant numbers with those variables.

comment:4 by beherith, 7 years ago

Resolution: fixed
Status: newclosed

Committed [1855]

Note: See TracTickets for help on using tickets.