Update types in IconToggle

main
JeffyLikesApples 11 months ago
parent 1fb0258dcc
commit e50fc7f72e
  1. 10
      DiesalGUI-2.0/Objects/IconToggle.lua

@ -97,8 +97,7 @@ local methods = {
---@param value boolean
SetChecked = function(self, value)
self.settings.checked = value
self.check:SetText(value and DiesalStyle.MaterialIcon("check_box") or
DiesalStyle.MaterialIcon("check_box_outline_blank"))
self.check:SetText(value and DiesalStyle.MaterialIcon("check_box") or DiesalStyle.MaterialIcon("check_box_outline_blank"))
self.frame:SetChecked(value)
self[self.settings.disabled and "Disable" or "Enable"](self)
@ -113,6 +112,9 @@ local methods = {
Disable = function(self)
self.settings.disabled = true
local r, g, b = DiesalTools.GetColor(checkBoxStyle.disabled.color)
---@cast r number
---@cast g number
---@cast b number
self.check:SetTextColor(r, g, b, 1)
--DiesalStyle:StyleTexture(self.check, self.checkBoxStyle and self.checkBoxStyle.disabled or checkBoxStyle.disabled)
self.frame:Disable()
@ -122,6 +124,9 @@ local methods = {
Enable = function(self)
self.settings.disabled = false
local r, g, b = DiesalTools.GetColor(checkBoxStyle.enabled.color)
---@cast r number
---@cast g number
---@cast b number
self.check:SetTextColor(r, g, b, 1)
--DiesalStyle:StyleTexture(self.check, self.checkBoxStyle and self.checkBoxStyle.enabled or checkBoxStyle.enabled)
self.frame:Enable()
@ -184,7 +189,6 @@ local function Constructor()
-- ~~ Construct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--local check = self:CreateRegion("Texture", "check", frame)
---@type Diesal.GUI.Region.FontString
local check = self:CreateRegion("FontString", "check", frame)
check:SetAllPoints(frame, true)
--check:SetAllPoints(frame, true)

Loading…
Cancel
Save