Skip to content

Commit

Permalink
Merge pull request #588 from robotboy655/slider
Browse files Browse the repository at this point in the history
Updated slider
  • Loading branch information
UnderscoreKilburn committed Jan 30, 2014
2 parents e54b017 + 450d2d2 commit 22f559f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions garrysmod/lua/vgui/dnumslider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local PANEL = {}
-----------------------------------------------------------]]
function PANEL:Init()

self.TextArea = self:Add( "DTextEntry" );
self.TextArea = self:Add( "DTextEntry" )
self.TextArea:Dock( RIGHT )
self.TextArea:SetDrawBackground( false )
self.TextArea:SetWide( 45 )
Expand All @@ -33,7 +33,6 @@ function PANEL:Init()

self.Label = vgui.Create ( "DLabel", self )
self.Label:Dock( LEFT )
self.Label:SetSize( 130 )
self.Label:SetMouseInputEnabled( true )

self.Scratch = self.Label:Add( "DNumberScratch" )
Expand Down Expand Up @@ -164,6 +163,15 @@ function PANEL:IsEditing()

end

--[[---------------------------------------------------------
Name: PerformLayout
-----------------------------------------------------------]]
function PANEL:PerformLayout()

self.Label:SetWide( self:GetWide() / 2.4 )

end

--[[---------------------------------------------------------
Name: SetConVar
-----------------------------------------------------------]]
Expand Down Expand Up @@ -296,7 +304,7 @@ function PANEL:PerformLayout()
self.Scratch:SetVisible( false )
self.Label:SetVisible( false )

self.Slider:StretchToParent(0,0,0,0)
self.Slider:StretchToParent(0,0,0,0)
self.Slider:SetSlideX( self.Scratch:GetFraction() )

end
Expand Down

0 comments on commit 22f559f

Please sign in to comment.