XenocodeRCE

[GDI] New Steam theme

Aug 18th, 2015
1,100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 16.40 KB | None | 0 0
  1. Imports System.ComponentModel
  2. Imports System.Drawing.Drawing2D
  3.  
  4.  
  5. '--------------------- [ THEME ] ---------------------
  6. 'Name: New Steam theme
  7. 'Creator: .NETGuard
  8. 'Credit: iSynthesis
  9. 'Credit: Leumonic
  10. 'Credit: Aeonhack for the Themebase, as usual
  11. 'Credit: You, because you downloaded this theme.
  12. '-------------------- [ /THEME ] ---------------------
  13.  
  14. Class SteamTheme
  15.     Inherits ThemeContainer153
  16.  
  17.     Sub New()
  18.         ForeColor = Color.FromArgb(226, 226, 226)
  19.         Font = New Font("Segoe UI", 7)
  20.     End Sub
  21.  
  22.     Protected Overrides Sub ColorHook()
  23.  
  24.     End Sub
  25.  
  26.     Protected Overrides Sub PaintHook()
  27.         DrawGradient(Color.FromArgb(25, 54, 82), Color.FromArgb(29, 30, 31), ClientRectangle, 43)
  28.         DrawGradient(Color.FromArgb(25, 54, 82), Color.Transparent, ClientRectangle, -100)
  29.         G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), New Rectangle(1, 1, Width - 2, Height - 2))
  30.         DrawGradient(Color.FromArgb(30, 36, 44), Color.FromArgb(38, 38, 38), New Rectangle(1, 1, Width - 2, 35), 90S)
  31.         DrawText(New SolidBrush(Color.FromArgb(195, 193, 191)), HorizontalAlignment.Left, 7, 2)
  32.     End Sub
  33. End Class
  34.  
  35. Class SteamButton
  36.     Inherits ThemeControl153
  37.  
  38.     Private O As _Options
  39.     <Flags()> _
  40.     Enum _Options
  41.         _true
  42.         _false
  43.     End Enum
  44.     <Category("Activated")> _
  45.     Public Property Activated As _Options
  46.         Get
  47.             Return O
  48.         End Get
  49.         Set(value As _Options)
  50.             O = value
  51.         End Set
  52.     End Property
  53.     Sub New()
  54.         Font = New Font("Verdana", 7.25)
  55.        
  56.     End Sub
  57.  
  58.     Protected Overrides Sub ColorHook()
  59.  
  60.     End Sub
  61.  
  62.     Protected Overrides Sub PaintHook()
  63.         G.Clear(Color.FromArgb(38, 38, 38))
  64.        
  65.  
  66.          Select O
  67.             Case _Options._true
  68.  
  69.                 Select Case State
  70.                     Case 0
  71.                         DrawGradient(Color.FromArgb(79, 79, 79), Color.FromArgb(58, 58, 58), ClientRectangle, 90S)
  72.                     Case 1
  73.                         DrawGradient(Color.FromArgb(105, 105, 105), Color.FromArgb(61, 61, 61), ClientRectangle, 90S)
  74.                     Case 2
  75.                         DrawGradient(Color.FromArgb(39, 39, 39), Color.FromArgb(57, 57, 57), ClientRectangle, 90S)
  76.                 End Select
  77.                 DrawText(New SolidBrush(Color.FromArgb(195, 193, 191)), Text.ToUpper, HorizontalAlignment.Left, 4, 0)
  78.             Case _Options._false
  79.                 Select Case State
  80.                     Case 0
  81.                         DrawGradient(Color.FromArgb(44, 44, 44), Color.FromArgb(44, 44, 44), ClientRectangle, 90S)
  82.                     Case 1
  83.                         DrawGradient(Color.FromArgb(44, 44, 44), Color.FromArgb(44, 44, 44), ClientRectangle, 90S)
  84.                     Case 2
  85.                         DrawGradient(Color.FromArgb(44, 44, 44), Color.FromArgb(44, 44, 44), ClientRectangle, 90S)
  86.                 End Select
  87.                 DrawText(New SolidBrush(Color.FromArgb(115, 115, 115)), Text.ToUpper, HorizontalAlignment.Left, 4, 0)
  88.         End Select
  89.     End Sub
  90. End Class
  91.  
  92. Class SteamSeparator
  93.     Inherits ThemeControl153
  94.  
  95.     Protected Overrides Sub ColorHook()
  96.  
  97.     End Sub
  98.  
  99.     Protected Overrides Sub PaintHook()
  100.         G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), ClientRectangle)
  101.         DrawGradient(Color.FromArgb(107, 104, 101), Color.FromArgb(74, 72, 70), New Rectangle(0, Height / 2, Width, 1), 45S)
  102.     End Sub
  103. End Class
  104.  
  105. Class SteamProgressBar
  106.     Inherits ThemeControl153
  107.  
  108.     Private _Maximum As Integer
  109.     Public Property Maximum() As Integer
  110.         Get
  111.             Return _Maximum
  112.         End Get
  113.         Set(ByVal v As Integer)
  114.             Select Case v
  115.                 Case Is < _Value
  116.                     _Value = v
  117.             End Select
  118.             _Maximum = v
  119.             Invalidate()
  120.         End Set
  121.     End Property
  122.     Private _Value As Integer
  123.     Public Property Value() As Integer
  124.         Get
  125.             Select Case _Value
  126.                 Case 0
  127.                     Return 1
  128.                 Case Else
  129.                     Return _Value
  130.             End Select
  131.         End Get
  132.         Set(ByVal v As Integer)
  133.             Select Case v
  134.                 Case Is > _Maximum
  135.                     v = _Maximum
  136.             End Select
  137.             _Value = v
  138.             Invalidate()
  139.         End Set
  140.     End Property
  141.  
  142.     Sub New()
  143.         Transparent = True
  144.         BackColor = Color.Transparent
  145.         LockHeight = 18
  146.         Value = 0
  147.         Maximum = 100
  148.     End Sub
  149.  
  150.     Protected Overrides Sub PaintHook()
  151.         G.Clear(BackColor)
  152.         'Fill
  153.         Select Case _Value
  154.             Case Is > 2
  155.                 G.FillRectangle(New SolidBrush(Color.FromArgb(166, 164, 161)), New Rectangle(4, 4, CInt(_Value / _Maximum * Width) - 8, Height - 8))
  156.             Case Is > 0
  157.                 G.FillRectangle(New SolidBrush(Color.FromArgb(166, 164, 161)), New Rectangle(4, 4, CInt(_Value / _Maximum * Width) - 2, Height - 8))
  158.  
  159.         End Select
  160.  
  161.         DrawBorders(New Pen(New SolidBrush(Color.FromArgb(128, 124, 120))))
  162.         DrawCorners(BackColor)
  163.     End Sub
  164.  
  165.     Protected Overrides Sub ColorHook()
  166.  
  167.     End Sub
  168. End Class
  169.  
  170. Class SteamTextBox
  171.     Inherits ThemeControl153
  172.     Dim WithEvents txtbox As New TextBox
  173.  
  174.     Private _PassMask As Boolean
  175.     Public Property UsePasswordMask() As Boolean
  176.         Get
  177.             Return _PassMask
  178.         End Get
  179.         Set(ByVal v As Boolean)
  180.             _PassMask = v
  181.             Invalidate()
  182.         End Set
  183.     End Property
  184.     Private _maxchars As Integer
  185.     Public Property MaxCharacters() As Integer
  186.         Get
  187.             Return _maxchars
  188.         End Get
  189.         Set(ByVal v As Integer)
  190.             _maxchars = v
  191.         End Set
  192.     End Property
  193.  
  194.     Sub New()
  195.         txtbox.TextAlign = HorizontalAlignment.Left
  196.         txtbox.BorderStyle = BorderStyle.None
  197.         txtbox.Location = New Point(4, 4)
  198.         txtbox.Font = New Font("Segoe UI", 8)
  199.         Controls.Add(txtbox)
  200.         Text = ""
  201.         txtbox.Text = ""
  202.         Me.Size = New Size(135, 22)
  203.         Transparent = True
  204.         BackColor = Color.Transparent
  205.     End Sub
  206.  
  207.     Dim P1 As Pen
  208.  
  209.     Protected Overrides Sub ColorHook()
  210.     End Sub
  211.  
  212.     Protected Overrides Sub PaintHook()
  213.         G.Clear(Color.FromArgb(38, 38, 38))
  214.         Select Case UsePasswordMask
  215.             Case True
  216.                 txtbox.UseSystemPasswordChar = True
  217.             Case False
  218.                 txtbox.UseSystemPasswordChar = False
  219.         End Select
  220.         Size = New Size(Width, 22)
  221.         txtbox.BackColor = Color.FromArgb(38, 38, 38)
  222.         txtbox.ForeColor = Color.FromArgb(195, 193, 191)
  223.         txtbox.Font = Font
  224.         txtbox.Size = New Size(Width - 10, txtbox.Height - 10)
  225.         txtbox.MaxLength = MaxCharacters
  226.         DrawBorders(New Pen(New SolidBrush(Color.FromArgb(137, 137, 137))))
  227.         DrawCorners(BackColor)
  228.     End Sub
  229.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  230.         Text = txtbox.Text
  231.     End Sub
  232.     Sub TextChng() Handles MyBase.TextChanged
  233.         txtbox.Text = Text
  234.     End Sub
  235. End Class
  236.  
  237. <DefaultEvent("CheckedChanged")> Class SteamCheckBox : Inherits Control
  238.  
  239. #Region " Variables"
  240.  
  241.     Private W, H As Integer
  242.     Private State As MouseState = MouseState.None
  243.     Private O As _Options
  244.     Private _Checked As Boolean
  245.  
  246. #End Region
  247.  
  248. #Region " Properties"
  249.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  250.         MyBase.OnTextChanged(e)
  251.         Invalidate()
  252.     End Sub
  253.  
  254.     Property Checked() As Boolean
  255.         Get
  256.             Return _Checked
  257.         End Get
  258.         Set(ByVal value As Boolean)
  259.             _Checked = value
  260.             Invalidate()
  261.         End Set
  262.     End Property
  263.  
  264.     Event CheckedChanged(ByVal sender As Object)
  265.     Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  266.         _Checked = Not _Checked
  267.         RaiseEvent CheckedChanged(Me)
  268.         MyBase.OnClick(e)
  269.     End Sub
  270.  
  271.     <Flags> _
  272.     Enum _Options
  273.         Style1
  274.         Style2
  275.     End Enum
  276.  
  277.     <Category("Options")> _
  278.     Public Property Options As _Options
  279.         Get
  280.             Return O
  281.         End Get
  282.         Set(value As _Options)
  283.             O = value
  284.         End Set
  285.     End Property
  286.  
  287.     Protected Overrides Sub OnResize(e As EventArgs)
  288.         MyBase.OnResize(e)
  289.         Height = 22
  290.     End Sub
  291.  
  292. #Region " Colors"
  293.  
  294.     <Category("Colors")> _
  295.     Public Property BaseColor As Color
  296.         Get
  297.             Return _BaseColor
  298.         End Get
  299.         Set(value As Color)
  300.             _BaseColor = value
  301.         End Set
  302.     End Property
  303.  
  304.     <Category("Colors")> _
  305.     Public Property BorderColor As Color
  306.         Get
  307.             Return _BorderColor
  308.         End Get
  309.         Set(value As Color)
  310.             _BorderColor = value
  311.         End Set
  312.     End Property
  313.  
  314. #End Region
  315.  
  316. #Region " Mouse States"
  317.  
  318.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  319.         MyBase.OnMouseDown(e)
  320.         State = MouseState.Down : Invalidate()
  321.     End Sub
  322.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  323.         MyBase.OnMouseUp(e)
  324.         State = MouseState.Over : Invalidate()
  325.     End Sub
  326.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  327.         MyBase.OnMouseEnter(e)
  328.         State = MouseState.Over : Invalidate()
  329.     End Sub
  330.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  331.         MyBase.OnMouseLeave(e)
  332.         State = MouseState.None : Invalidate()
  333.     End Sub
  334.  
  335. #End Region
  336.  
  337. #End Region
  338.  
  339. #Region " Colors"
  340. #Region " Variables"
  341.     Friend G As Graphics, B As Bitmap
  342.     Friend _FlatColor As Color = Color.FromArgb(103, 103, 103)
  343.     Friend NearSF As New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near}
  344.     Friend CenterSF As New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center}
  345. #End Region
  346.     Private _BaseColor As Color = Color.FromArgb(38, 38, 38)
  347.     Private _BorderColor As Color = Color.FromArgb(103, 103, 103)
  348.     Private _TextColor As Color = Color.FromArgb(226, 226, 226)
  349.     Private checkcolor As Color = Color.FromArgb(226, 226, 226)
  350.  
  351. #End Region
  352.  
  353.     Sub New()
  354.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  355.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  356.         DoubleBuffered = True
  357.         BackColor = Color.FromArgb(38, 38, 38)
  358.         Cursor = Cursors.Hand
  359.         Font = New Font("Segoe UI", 8)
  360.         Size = New Size(112, 22)
  361.     End Sub
  362.  
  363.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  364.         B = New Bitmap(Width, Height) : G = Graphics.FromImage(B)
  365.         W = Width - 1 : H = Height - 1
  366.  
  367.         Dim Base As New Rectangle(0, 2, Height - 5, Height - 5)
  368.  
  369.         With G
  370.             .SmoothingMode = 2
  371.             .TextRenderingHint = 5
  372.             .Clear(BackColor)
  373.  
  374.             .FillRectangle(New SolidBrush(_BaseColor), Base)
  375.  
  376.             .DrawRectangle(New Pen(_BorderColor), Base)
  377.  
  378.             If Checked Then
  379.                 .DrawString("", New Font("Segoe UI Symbol", 10), New SolidBrush(checkcolor), New Rectangle(4, 6, H - 9, H - 10), CenterSF)
  380.             End If
  381.  
  382.             .DrawString(Text, Font, New SolidBrush(_TextColor), New Rectangle(25, 4.5, W, H), NearSF)
  383.  
  384.         End With
  385.  
  386.         MyBase.OnPaint(e)
  387.         G.Dispose()
  388.         e.Graphics.InterpolationMode = 7
  389.         e.Graphics.DrawImageUnscaled(B, 0, 0)
  390.         B.Dispose()
  391.     End Sub
  392. End Class
  393.  
  394. Class SteamClose
  395.     Inherits Control
  396.  
  397. #Region " Declarations "
  398.     Private _State As MouseState
  399. #End Region
  400.  
  401. #Region " Mouse States "
  402.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  403.         MyBase.OnMouseEnter(e)
  404.         _State = MouseState.Over
  405.         Invalidate()
  406.     End Sub
  407.  
  408.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  409.         MyBase.OnMouseLeave(e)
  410.         _State = MouseState.None
  411.         Invalidate()
  412.     End Sub
  413.  
  414.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  415.         MyBase.OnMouseDown(e)
  416.         _State = MouseState.Down
  417.         Invalidate()
  418.     End Sub
  419.  
  420.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  421.         MyBase.OnMouseUp(e)
  422.         _State = MouseState.Over
  423.         Invalidate()
  424.     End Sub
  425.  
  426.     Protected Overrides Sub OnClick(e As EventArgs)
  427.         MyBase.OnClick(e)
  428.         Environment.Exit(0)
  429.     End Sub
  430. #End Region
  431.  
  432.     Protected Overrides Sub OnResize(e As EventArgs)
  433.         MyBase.OnResize(e)
  434.         Size = New Size(12, 12)
  435.     End Sub
  436.  
  437.     Sub New()
  438.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  439.                 ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  440.         DoubleBuffered = True
  441.         Size = New Size(12, 12)
  442.     End Sub
  443.  
  444.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  445.         MyBase.OnPaint(e)
  446.         Dim G = e.Graphics
  447.         BackColor = Color.Transparent
  448.  
  449.         Dim _StringF As New StringFormat
  450.         _StringF.Alignment = StringAlignment.Center
  451.         _StringF.LineAlignment = StringAlignment.Center
  452.  
  453.         G.DrawString("✕", New Font("Segoe UI Symbol", 10.03, FontStyle.Bold), New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(175, 175, 175), Color.FromArgb(175, 175, 175)), New RectangleF(0, 0, Width, Height), _StringF)
  454.  
  455.         Select Case _State
  456.             Case MouseState.Over
  457.                 G.DrawString("✕", New Font("Segoe UI Symbol", 10.03, FontStyle.Bold), New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(226, 226, 226), Color.FromArgb(226, 226, 226)), New RectangleF(0, 0, Width, Height), _StringF)
  458.  
  459.             Case MouseState.Down
  460.                 G.DrawString("✕", New Font("Segoe UI Symbol", 10.03, FontStyle.Bold), New SolidBrush(Color.FromArgb(40, Color.Black)), New RectangleF(0, 0, Width, Height), _StringF)
  461.         End Select
  462.  
  463.     End Sub
  464.  
  465. End Class
  466.  
  467. Class SteamMinimize
  468.     Inherits Control
  469.  
  470. #Region " Declarations "
  471.     Private _State As MouseState
  472. #End Region
  473.  
  474. #Region " Mouse States "
  475.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  476.         MyBase.OnMouseEnter(e)
  477.         _State = MouseState.Over
  478.         Invalidate()
  479.     End Sub
  480.  
  481.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  482.         MyBase.OnMouseLeave(e)
  483.         _State = MouseState.None
  484.         Invalidate()
  485.     End Sub
  486.  
  487.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  488.         MyBase.OnMouseDown(e)
  489.         _State = MouseState.Down
  490.         Invalidate()
  491.     End Sub
  492.  
  493.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  494.         MyBase.OnMouseUp(e)
  495.         _State = MouseState.Over
  496.         Invalidate()
  497.     End Sub
  498.  
  499.     Protected Overrides Sub OnClick(e As EventArgs)
  500.         MyBase.OnClick(e)
  501.         FindForm.WindowState = FormWindowState.Minimized
  502.     End Sub
  503. #End Region
  504.  
  505.     Protected Overrides Sub OnResize(e As EventArgs)
  506.         MyBase.OnResize(e)
  507.         Size = New Size(12, 12)
  508.     End Sub
  509.  
  510.     Sub New()
  511.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  512.                 ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  513.         DoubleBuffered = True
  514.         Size = New Size(12, 12)
  515.     End Sub
  516.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  517.         MyBase.OnPaint(e)
  518.         Dim G = e.Graphics
  519.         BackColor = Color.Transparent
  520.         Dim _StringF As New StringFormat
  521.         _StringF.Alignment = StringAlignment.Center
  522.         _StringF.LineAlignment = StringAlignment.Center
  523.         G.DrawString("0", New Font("Marlett", 11), New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(175, 175, 175), Color.FromArgb(175, 175, 175)), New RectangleF(0, 0, Width, Height), _StringF)
  524.         Select Case _State
  525.             Case MouseState.Over
  526.                 G.DrawString("0", New Font("Marlett", 11), New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(226, 226, 226), Color.FromArgb(175, 175, 175)), New RectangleF(0, 0, Width, Height), _StringF)
  527.  
  528.             Case MouseState.Down
  529.                 G.DrawString("0", New Font("Marlett", 11), New SolidBrush(Color.FromArgb(40, Color.Black)), New RectangleF(0, 0, Width, Height), _StringF)
  530.         End Select
  531.     End Sub
  532. End Class
Advertisement
Add Comment
Please, Sign In to add comment