Permalink
Browse files

Add an horizontal divider for spawnmenu

ContentSidebar and spawnicons are separated using this, and both can be resized horizontally. (Useful for the tiny static sidebar)
  • Loading branch information...
1 parent 8e2dd3a commit c1ff7ce99bb1209330d1e3a13d7da1ba09d33f8b @Tenrys Tenrys committed Feb 28, 2014
Showing with 12 additions and 2 deletions.
  1. +12 −2 garrysmod/gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/content.lua
@@ -1,4 +1,3 @@
-
include( "ContentIcon.lua" )
include( "PostProcessIcon.lua" )
@@ -38,6 +37,15 @@ function PANEL:Init()
self.ContentNavBar:SetSize( 190, 10 );
self.ContentNavBar:DockMargin( 0, 0, 4, 0 )
+
+ self.HorizontalDivider = vgui.Create( "DHorizontalDivider", self );
+ self.HorizontalDivider:Dock( FILL );
+ self.HorizontalDivider:SetLeftWidth( 175 )
+ self.HorizontalDivider:SetLeftMin( 175 )
+ self.HorizontalDivider:SetRightMin( 450 )
+
+ self.HorizontalDivider:SetLeft( self.ContentNavBar );
+
end
function PANEL:EnableModify()
@@ -62,7 +70,9 @@ function PANEL:SwitchPanel( panel )
self.SelectedPanel:Dock( FILL )
self.SelectedPanel:SetVisible( true )
self:InvalidateParent()
-
+
+ self.HorizontalDivider:SetRight( self.SelectedPanel );
+
end

0 comments on commit c1ff7ce

Please sign in to comment.