local f = CreateFrame("EventFrame", "OctoWowTrimhorizontalScrollBar", UIParent, "horizontalScrollBarTemplate")
Mixin(f, WowTrimScrollBarMixin)
f:SetSize(560, 8)
f.minThumbExtent = 23
-- Background texture
local background = f:CreateTexture(nil, "BACKGROUND")
background:SetPoint("TOPLEFT", 3, 0)
background:SetPoint("BOTTOMRIGHT", -3, 0)
background:SetColorTexture(0, 0, 0, 0.75)
-- Track frame
local track = CreateFrame("Frame", nil, f)
f.Track = track
track:SetPoint("TOPLEFT", 19, 0)
track:SetPoint("BOTTOMRIGHT", -19, 0)
track:EnableMouse(true)
-- Track textures
track.Begin = track:CreateTexture(nil, "ARTWORK", nil, 1)
track.Begin:SetAtlas("minimal-scrollbar-track-top", true)
track.Begin:SetPoint("TOPLEFT")
track.End = track:CreateTexture(nil, "ARTWORK", nil, 1)
track.End:SetAtlas("minimal-scrollbar-track-bottom", true)
track.End:SetPoint("TOPRIGHT")
track.Middle = track:CreateTexture(nil, "ARTWORK", nil, 1)
track.Middle:SetAtlas("!minimal-scrollbar-track-middle", true)
track.Middle:SetPoint("TOPLEFT", track.Begin, "TOPRIGHT")
track.Middle:SetPoint("BOTTOMRIGHT", track.End, "BOTTOMLEFT")
-- Thumb (scroll handle)
local thumb = CreateFrame("Button", nil, track)
track.Thumb = thumb
Mixin(thumb, MinimalScrollBarThumbScriptsMixin)
thumb:SetSize(0, 8)
thumb:EnableMouse(true)
thumb:SetHitRectInsets(4, 4, 4, 4)
thumb.isHorizontal = false
thumb.upBeginTexture = "minimal-scrollbar-small-thumb-top"
thumb.upMiddleTexture = "minimal-scrollbar-small-thumb-middle"
thumb.upEndTexture = "minimal-scrollbar-small-thumb-bottom"
thumb.overBeginTexture = "minimal-scrollbar-small-thumb-top-over"
thumb.overMiddleTexture = "minimal-scrollbar-small-thumb-middle-over"
thumb.overEndTexture = "minimal-scrollbar-small-thumb-bottom-over"
thumb.downBeginTexture = "minimal-scrollbar-small-thumb-top-down"
thumb.downMiddleTexture = "minimal-scrollbar-small-thumb-middle-down"
thumb.downEndTexture = "minimal-scrollbar-small-thumb-bottom-down"
thumb.mouseDownSoundKitID = SOUNDKIT.U_CHAT_SCROLL_BUTTON
-- Thumb textures
thumb.Middle = thumb:CreateTexture(nil, "BACKGROUND", nil, 1)
thumb.Middle:SetPoint("TOPLEFT", 5, 0)
thumb.Middle:SetPoint("BOTTOMRIGHT", -5, 0)
thumb.Begin = thumb:CreateTexture(nil, "BACKGROUND", nil, 2)
thumb.Begin:SetPoint("TOPLEFT")
thumb.End = thumb:CreateTexture(nil, "BACKGROUND", nil, 2)
thumb.End:SetPoint("TOPRIGHT")
-- Thumb scripts
thumb:SetScript("OnLoad", thumb.OnLoad)
thumb:SetScript("OnEnter", thumb.OnEnter)
thumb:SetScript("OnLeave", thumb.OnLeave)
thumb:SetScript("OnMouseDown", thumb.OnMouseDown)
thumb:SetScript("OnMouseUp", thumb.OnMouseUp)
thumb:SetScript("OnEnable", thumb.OnEnable)
thumb:SetScript("OnDisable", thumb.OnDisable)
-- Back button
local back = CreateFrame("Button", nil, f, "MinimalScrollBarStepperScripts")
f.Back = back
back:SetSize(11, 17)
back:SetPoint("LEFT")
back.direction = ScrollControllerMixin.Directions.Decrease
back.normalTexture = "minimal-scrollbar-arrow-top"
back.overTexture = "minimal-scrollbar-arrow-top-over"
back.downTexture = "minimal-scrollbar-arrow-top-down"
back.disabledTexture = "minimal-scrollbar-arrow-top"
back.mouseDownSoundKitID = SOUNDKIT.SCROLLBAR_STEP
back.Texture = back:CreateTexture(nil, "BACKGROUND")
back.Overlay = back:CreateTexture(nil, "OVERLAY")
back.Overlay:SetAtlas("UI-ScrollBar-ScrollLeftButton-Highlight", true)
back.Overlay:Hide()
-- Forward button
local forward = CreateFrame("Button", nil, f, "MinimalScrollBarStepperScripts")
f.Forward = forward
forward:SetSize(11, 17)
forward:SetPoint("RIGHT")
forward.direction = ScrollControllerMixin.Directions.Increase
forward.normalTexture = "minimal-scrollbar-arrow-bottom"
forward.overTexture = "minimal-scrollbar-arrow-bottom-over"
forward.downTexture = "minimal-scrollbar-arrow-bottom-down"
forward.disabledTexture = "minimal-scrollbar-bottom-top"
forward.mouseDownSoundKitID = SOUNDKIT.SCROLLBAR_STEP
forward.Texture = forward:CreateTexture(nil, "BACKGROUND")
forward.Overlay = forward:CreateTexture(nil, "OVERLAY")
forward.Overlay:SetAtlas("UI-ScrollBar-ScrollRightButton-Highlight", true)
forward.Overlay:Hide()
-- ScrollBar OnLoad
f:SetScript("OnLoad", f.OnLoad)