comparison Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua @ 18:a0dcdcaec1ea v7.3.0.018

- toc update. - libs update.
author Tercio
date Tue, 17 Oct 2017 10:02:01 -0200
parents ce416064d8a1
children
comparison
equal deleted inserted replaced
17:da84a5064a5a 18:a0dcdcaec1ea
1 --[[----------------------------------------------------------------------------- 1 --[[-----------------------------------------------------------------------------
2 ColorPicker Widget 2 ColorPicker Widget
3 -------------------------------------------------------------------------------]] 3 -------------------------------------------------------------------------------]]
4 local Type, Version = "ColorPicker", 21 4 local Type, Version = "ColorPicker", 23
5 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) 5 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end 6 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 7
8 -- Lua APIs 8 -- Lua APIs
9 local pairs = pairs 9 local pairs = pairs
49 local function ColorSwatch_OnClick(frame) 49 local function ColorSwatch_OnClick(frame)
50 HideUIPanel(ColorPickerFrame) 50 HideUIPanel(ColorPickerFrame)
51 local self = frame.obj 51 local self = frame.obj
52 if not self.disabled then 52 if not self.disabled then
53 ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG") 53 ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG")
54 ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10)
54 ColorPickerFrame:SetClampedToScreen(true) 55 ColorPickerFrame:SetClampedToScreen(true)
55 56
56 ColorPickerFrame.func = function() 57 ColorPickerFrame.func = function()
57 local r, g, b = ColorPickerFrame:GetColorRGB() 58 local r, g, b = ColorPickerFrame:GetColorRGB()
58 local a = 1 - OpacitySliderFrame:GetValue() 59 local a = 1 - OpacitySliderFrame:GetValue()
143 colorSwatch:SetPoint("LEFT") 144 colorSwatch:SetPoint("LEFT")
144 145
145 local texture = frame:CreateTexture(nil, "BACKGROUND") 146 local texture = frame:CreateTexture(nil, "BACKGROUND")
146 texture:SetWidth(16) 147 texture:SetWidth(16)
147 texture:SetHeight(16) 148 texture:SetHeight(16)
148 texture:SetTexture(1, 1, 1) 149 texture:SetColorTexture(1, 1, 1)
149 texture:SetPoint("CENTER", colorSwatch) 150 texture:SetPoint("CENTER", colorSwatch)
150 texture:Show() 151 texture:Show()
151 152
152 local checkers = frame:CreateTexture(nil, "BACKGROUND") 153 local checkers = frame:CreateTexture(nil, "BACKGROUND")
153 checkers:SetWidth(14) 154 checkers:SetWidth(14)