Skip to content

Commit

Permalink
Add minimize button texture
Browse files Browse the repository at this point in the history
  • Loading branch information
marchc1 committed Jan 17, 2025
1 parent 0cbac32 commit eebf7ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/autorun/ponder_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if SERVER then
resource.AddFile("materials/ponder/ui/icon64/brightness_off.png")
resource.AddFile("materials/ponder/ui/icon64/oxygen_language.png")
resource.AddFile("materials/ponder/ui/icon128/back.png")
resource.AddFile("materials/ponder/ui/icon128/min.png")
resource.AddFile("materials/ponder/ui/progress/bar.png")
resource.AddFile("materials/ponder/ui/progress/grabby.png")
resource.AddFile("materials/ponder/ui/progress/left.png")
Expand Down
10 changes: 9 additions & 1 deletion lua/vgui/ponder_ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DEFINE_BASECLASS("Panel")
local padding = 64

local back = Material("ponder/ui/icon128/back.png", "mips smooth")
local min = Material("ponder/ui/icon128/min.png", "mips smooth")

function PANEL:Init()
self:SetSize(ScrW(), ScrH())
Expand All @@ -20,7 +21,6 @@ function PANEL:Init()
local minimize = self:Add("DButton")
minimize:SetSize(64, 64)
minimize:SetPos(ScrW() - 97 - (padding * 2), padding)
minimize:SetText("TempMin")

local nointeraction = false
local minimizeOpener
Expand Down Expand Up @@ -132,6 +132,14 @@ function PANEL:Init()
surface.DrawTexturedRectRotated(w2, h2, w, h, 0)
end

minimize:SetText("")
function minimize:Paint(w, h)
local w2, h2 = w / 2, h / 2
surface.SetMaterial(min)
surface.SetDrawColor(255, 255, 255, 255)
surface.DrawTexturedRectRotated(w2, h2, w, h, 0)
end

close:SetTooltipPanelOverride("Ponder.ControlTooltip")
close:SetTooltipDelay(0)

Expand Down
Binary file added materials/ponder/ui/icon128/min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eebf7ff

Please sign in to comment.