Skip to content

Commit

Permalink
Added an option to toggle between rounded and squared tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Mar 15, 2024
1 parent 47bad31 commit 2421b29
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
6 changes: 3 additions & 3 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ end
GameCooltip:SetOption("AlignAsBlizzTooltip", false)
GameCooltip:SetOption("AlignAsBlizzTooltipFrameHeightOffset", -6)
GameCooltip:SetOption("YSpacingMod", -6)
GameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

for index, t in ipairs(Targets) do
GameCooltip:AddLine(Details:GetOnlyName(t[1]), Details:ToK(t[2]) .. " (" .. format("%.1f", t[2]/total*100) .. "%)")
Expand Down Expand Up @@ -1182,7 +1182,7 @@ end
GameCooltip:SetOption("AlignAsBlizzTooltip", false)
GameCooltip:SetOption("AlignAsBlizzTooltipFrameHeightOffset", -6)
GameCooltip:SetOption("YSpacingMod", -6)
GameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

--Details:AddTooltipSpellHeaderText (Loc ["STRING_DAMAGE_FROM"], headerColor, #damage_taken_table, [[Interface\Addons\Details\images\icons]], 0.126953125, 0.1796875, 0, 0.0546875)
--Details:AddTooltipHeaderStatusbar (1, 1, 1, 0.5)
Expand Down Expand Up @@ -1617,7 +1617,7 @@ end
GameCooltip:SetOption("AlignAsBlizzTooltip", false)
GameCooltip:SetOption("AlignAsBlizzTooltipFrameHeightOffset", -6)
GameCooltip:SetOption("YSpacingMod", -6)
GameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

--local lineHeight = Details.tooltip.line_height

Expand Down
8 changes: 7 additions & 1 deletion core/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1674,11 +1674,17 @@
end
end

GameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()
GameCooltip:ShowCooltip()
end
end

function Details:AddRoundedCornerToTooltip()
if (Details.tooltip.rounded_corner) then
GameCooltip:ShowRoundedCorner()
end
end

function Details.gump:UpdateTooltip(whichRowLine, esta_barra, instancia)
if (IsShiftKeyDown()) then
return instancia:MontaTooltip(esta_barra, whichRowLine, "shift")
Expand Down
12 changes: 6 additions & 6 deletions frames/window_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,7 @@ local iconFrame_OnEnter = function(self)
GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_skyline]])
GameCooltip:SetOption("FixedHeight", height+11)
GameCooltip:SetOption("LineHeightSizeOffset", -8)
GameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()
GameCooltip:ShowCooltip()

self.unitname = name
Expand Down Expand Up @@ -6066,7 +6066,7 @@ local build_mode_list = function(self, deltaTime)
gameCooltip:AddMenu(1, function() instance:SetMode(4) end)
gameCooltip:AddIcon([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 32/256*3, 32/256*4, 0, 1)

gameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

--build raid plugins list
local raidPlugins = Details.RaidTables:GetAvailablePlugins()
Expand Down Expand Up @@ -6376,7 +6376,7 @@ local buildSegmentTooltip = function(self, deltaTime)
gameCooltip:SetOption("RightTextHeight", 12)
gameCooltip:SetOption("SubFollowButton", true)

gameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

local menuIndex = 0
Details.segments_amount = floor(Details.segments_amount)
Expand Down Expand Up @@ -9091,7 +9091,7 @@ end

Details:SetMenuOwner(self, self.instance)

gameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

gameCooltip:ShowCooltip()
end
Expand Down Expand Up @@ -9248,7 +9248,7 @@ local reportButton_OnEnter = function(self, motion, forced)

Details:SetTooltipMinWidth()

GameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

Details:CheckLastReportsIntegrity()

Expand Down Expand Up @@ -9354,7 +9354,7 @@ local attributeButton_OnEnter = function(self, motion, forced, from_click)
GameCooltip:SetOption("TextSize", Details.font_sizes.menus)
Details:SetMenuOwner(self, instancia)

GameCooltip:ShowRoundedCorner()
Details:AddRoundedCornerToTooltip()

GameCooltip:ShowCooltip()
end
Expand Down
11 changes: 11 additions & 0 deletions frames/window_options2_sections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4417,6 +4417,17 @@ do
desc = "Divisor Color",
},

{--rounded corner
type = "toggle",
get = function() return Details.tooltip.rounded_corner end,
set = function(self, fixedparam, value)
Details.tooltip.rounded_corner = value
afterUpdate()
end,
name = "Show Rounded Border",
desc = "Show Rounded Border",
},

{type = "blank"},

{--show amount
Expand Down
2 changes: 2 additions & 0 deletions functions/profiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,8 @@ local default_profile = {
header_statusbar = {0.3, 0.3, 0.3, 0.8, false, false, "WorldState Score"},
submenu_wallpaper = true,

rounded_corner = true,

anchored_to = 1,
anchor_screen_pos = {507.700, -350.500},
anchor_point = "bottom",
Expand Down

0 comments on commit 2421b29

Please sign in to comment.