Skip to content

Commit

Permalink
Small panel fixes
Browse files Browse the repository at this point in the history
Fixes DProperties + sign not updating and fixed that one small error
Garry left in vertical scrollbar.

Oh, and no semicolons.
  • Loading branch information
robotboy655 committed Mar 3, 2014
1 parent 3feb9a5 commit df3efc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions garrysmod/lua/vgui/dproperties.lua
Expand Up @@ -8,11 +8,11 @@ local tblRow = vgui.RegisterTable( {

self:Dock( TOP )

self.Label = self:Add( "DLabel" )
self.Label = self:Add( "DLabel" )
self.Label:Dock( LEFT )
self.Label:DockMargin( 4, 2, 2, 2 )

self.Container = self:Add( "Panel" )
self.Container = self:Add( "Panel" )
self.Container:Dock( FILL )

end,
Expand All @@ -28,7 +28,7 @@ local tblRow = vgui.RegisterTable( {

self.Container:Clear()

local Name = "DProperty_" .. type;
local Name = "DProperty_" .. type

self.Inner = self.Container:Add( Name )
if ( !IsValid( self.Inner ) ) then self.Inner = self.Container:Add( "DProperty_Generic" ) end
Expand Down Expand Up @@ -57,7 +57,7 @@ local tblRow = vgui.RegisterTable( {

local Skin = self:GetSkin()
if ( !IsValid( self.Inner ) ) then return end
local editing = self.Inner:IsEditing();
local editing = self.Inner:IsEditing()

if ( editing ) then
surface.SetDrawColor( Skin.Colours.Properties.Column_Selected )
Expand All @@ -70,9 +70,9 @@ local tblRow = vgui.RegisterTable( {
surface.DrawRect( 0, h-1, w, 1 )

if ( editing ) then
self.Label:SetTextColor( Skin.Colours.Properties.Label_Selected );
self.Label:SetTextColor( Skin.Colours.Properties.Label_Selected )
else
self.Label:SetTextColor( Skin.Colours.Properties.Label_Normal );
self.Label:SetTextColor( Skin.Colours.Properties.Label_Normal )
end

end
Expand Down Expand Up @@ -100,9 +100,11 @@ local tblCategory = vgui.RegisterTable( {
self.Expand:Dock( LEFT )
self.Expand:SetSize( 16, 16 )
self.Expand:DockMargin( 0, 4, 0, 4 )
self.Expand:SetExpanded( true )
self.Expand.DoClick = function()

self.Container:SetVisible( !self.Container:IsVisible() )
self.Expand:SetExpanded( self.Container:IsVisible() )
self:InvalidateLayout()

end
Expand All @@ -126,7 +128,7 @@ local tblCategory = vgui.RegisterTable( {
self:SizeToChildren( false, true )

local Skin = self:GetSkin()
self.Label:SetTextColor( Skin.Colours.Properties.Title );
self.Label:SetTextColor( Skin.Colours.Properties.Title )
self.Label:DockMargin( 4, 0, 0, 0 )

end,
Expand Down Expand Up @@ -186,7 +188,7 @@ function PANEL:GetCanvas()

end

return self.Canvas;
return self.Canvas

end

Expand Down
4 changes: 2 additions & 2 deletions garrysmod/lua/vgui/dvscrollbar.lua
Expand Up @@ -169,7 +169,7 @@ function PANEL:AddScroll( dlta )
dlta = dlta * 25
self:SetScroll( self:GetScroll() + dlta )
return OldScroll == self:GetScroll()
return OldScroll != self:GetScroll()
end
Expand Down Expand Up @@ -210,7 +210,7 @@ function PANEL:AnimateTo( scrll, length, delay, ease )
anim.TargetPos = scrll
anim.Think = function( anim, pnl, fraction )
pnl:SetScroll( Lerp( fraction, anim.StartPos, anim.TargetPos ) );
pnl:SetScroll( Lerp( fraction, anim.StartPos, anim.TargetPos ) )
end
Expand Down

0 comments on commit df3efc2

Please sign in to comment.