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