Permalink
Browse files

Small panel fixes

Fixes DProperties + sign not updating and fixed that one small error
Garry left in vertical scrollbar.

Oh, and no semicolons.
  • Loading branch information...
1 parent 3feb9a5 commit df3efc20f9854b433b1455b2055ed49ecbf672fc @robotboy655 robotboy655 committed Mar 3, 2014
Showing with 12 additions and 10 deletions.
  1. +10 −8 garrysmod/lua/vgui/dproperties.lua
  2. +2 −2 garrysmod/lua/vgui/dvscrollbar.lua
@@ -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,
@@ -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
@@ -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 )
@@ -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
@@ -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
@@ -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,
@@ -186,7 +188,7 @@ function PANEL:GetCanvas()
end
- return self.Canvas;
+ return self.Canvas
end
@@ -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
@@ -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

0 comments on commit df3efc2

Please sign in to comment.