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

Loading…
Cancel
Save