Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
1.0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdelrhman-AK committed Aug 12, 2022
1 parent b15f936 commit 253d40b
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 81 deletions.
2 changes: 2 additions & 0 deletions WinPaletter/ApplicationEvents.vb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Imports WinPaletter.XenonCore
Imports WinPaletter.Localizer
Imports System.ComponentModel
Imports System.Globalization
Imports System.Drawing.Text

Namespace My
Public Module WindowsVersions
Expand Down Expand Up @@ -36,6 +37,7 @@ Namespace My
Public allForms As List(Of Form)
Public appData As String = IO.Directory.GetParent(System.Windows.Forms.Application.LocalUserAppDataPath).FullName
Public curPath As String = appData & "\Cursors"
Public TextRenderingHint As TextRenderingHint = TextRenderingHint.SystemDefault

#End Region

Expand Down
6 changes: 6 additions & 0 deletions WinPaletter/ColorPickerDlg.vb
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ Public Class ColorPickerDlg
.Invalidate()
End With

ElseIf TypeOf ctrl Is RetroScrollBar Then
With TryCast(ctrl, RetroScrollBar)
If _Conditions.RetroButtonHilight Then .ButtonHilight = Color.FromArgb(255, ColorEditorManager1.Color) Else .BackColor = Color.FromArgb(255, ColorEditorManager1.Color)
.Invalidate()
End With

ElseIf TypeOf ctrl Is Panel Then

If _Conditions.RetroHighlight17BitFixer And TypeOf ctrl Is RetroPanel Then
Expand Down
86 changes: 48 additions & 38 deletions WinPaletter/GUI/RetroUI.vb
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Public Class RetroButton : Inherits Button
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim B As New Bitmap(Width, Height)
Dim G As Graphics = Graphics.FromImage(B)
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True

'################################################################################# Customizer
Expand Down Expand Up @@ -303,8 +303,8 @@ Public Class RetroCheckBox

Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
Dim G As Graphics = e.Graphics
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True

'################################################################################# Customizer
Expand Down Expand Up @@ -412,8 +412,8 @@ Public Class RetroRadioButton

Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
Dim G As Graphics = e.Graphics
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True

'################################################################################# Customizer
Expand Down Expand Up @@ -715,8 +715,8 @@ End Class
Dim G As Graphics = Graphics.FromImage(B)
G = Graphics.FromImage(B)
DoubleBuffered = True
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint

MyBase.OnPaint(e)
TB.ForeColor = ForeColor
Expand Down Expand Up @@ -777,25 +777,6 @@ Public Class RetroLabel : Inherits Label
DoubleBuffered = True
End Sub

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim B As New Bitmap(Width, Height)
Dim G As Graphics = Graphics.FromImage(B)
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
DoubleBuffered = True

G.Clear(BackColor)

Dim FColor As Color
If Enabled Then FColor = ForeColor Else FColor = ChangeColorBrightness(BackColor, -0.2)

If Not Enabled Then G.DrawString(Text, Font, New SolidBrush(ChangeColorBrightness(BackColor, 0.8)), New Rectangle(1, 1, Width, Height), StringAligner(TextAlign))
G.DrawString(Text, Font, New SolidBrush(FColor), New Rectangle(0, 0, Width, Height), StringAligner(TextAlign))

e.Graphics.DrawImage(B, New Point(0, 0))
G.Dispose() : B.Dispose()
End Sub

End Class
Public Class RetroGroupBox : Inherits GroupBox
Public Sub New()
Expand All @@ -811,8 +792,8 @@ Public Class RetroGroupBox : Inherits GroupBox
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim B As New Bitmap(Width, Height)
Dim G As Graphics = Graphics.FromImage(B)
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True
G.Clear(BackColor)

Expand Down Expand Up @@ -849,7 +830,7 @@ Public Class RetroSeparatorH : Inherits Control

Protected Overrides Sub OnPaint(e As PaintEventArgs)
G = e.Graphics
G.SmoothingMode = Drawing2D.SmoothingMode.HighSpeed
G.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
DoubleBuffered = True
MyBase.OnPaint(e)

Expand All @@ -874,7 +855,7 @@ Public Class RetroSeparatorV : Inherits Control

Protected Overrides Sub OnPaint(e As PaintEventArgs)
G = e.Graphics
G.SmoothingMode = Drawing2D.SmoothingMode.HighSpeed
G.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
DoubleBuffered = True
MyBase.OnPaint(e)
G.DrawLine(New Pen(ButtonShadow), New Point(0, 0), New Point(0, Height))
Expand All @@ -900,8 +881,8 @@ Public Class RetroPanel : Inherits Panel

Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
Dim G As Graphics = e.Graphics
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True

'################################################################################# Customizer
Expand Down Expand Up @@ -936,8 +917,8 @@ Public Class RetroPanelRaised : Inherits Panel

Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
Dim G As Graphics = e.Graphics
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True

'################################################################################# Customizer
Expand Down Expand Up @@ -982,8 +963,8 @@ Public Class RetroWindow : Inherits Panel
Public Property ButtonLight As Color = Color.FromArgb(192, 192, 192)
Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
Dim G As Graphics = e.Graphics
G.SmoothingMode = SmoothingMode.HighSpeed
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True

'################################################################################# Customizer
Expand All @@ -1010,6 +991,13 @@ Public Class RetroWindow : Inherits Panel

If Not Flat And Not UseItAsMenu Then G.DrawRectangle(New Pen(ColorBorder), ARect)

Dim F As Font
If My.Application.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit Then
F = New Font("Microsoft Sans Serif", 8, FontStyle.Bold)
Else
F = New Font("Segoe UI", 9, FontStyle.Regular)
End If

If Not UseItAsMenu Then
Dim RTL As Boolean = If(RightToLeft = 1, True, False)
Dim gr As New LinearGradientBrush(TRect, If(RTL, Color2, Color1), If(RTL, Color1, Color2), LinearGradientMode.Horizontal)
Expand All @@ -1018,8 +1006,30 @@ Public Class RetroWindow : Inherits Panel
Else
G.FillRectangle(New SolidBrush(Color1), TRect)
End If
G.DrawString(TitlebarText, New Font("Microsoft Sans Serif", 8, FontStyle.Bold), New SolidBrush(ForeColor), TRect, StringAligner(ContentAlignment.MiddleLeft, RTL))
G.DrawString(TitlebarText, F, New SolidBrush(ForeColor), TRect, StringAligner(ContentAlignment.MiddleLeft, RTL))
End If

End Sub
End Class
Public Class RetroScrollBar : Inherits Panel
Sub New()
DoubleBuffered = True
BackColor = Color.FromArgb(192, 192, 192)
BorderStyle = BorderStyle.None
End Sub

Public Property ButtonHilight As Color = Color.White
Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
Dim G As Graphics = e.Graphics
G.SmoothingMode = SmoothingMode.AntiAlias
G.TextRenderingHint = My.Application.TextRenderingHint
DoubleBuffered = True

'################################################################################# Customizer
Dim Rect As Rectangle = New Rectangle(0, 0, Width - 1, Height - 1)
'#################################################################################
G.Clear(BackColor)
Dim b As New HatchBrush(HatchStyle.Percent50, ButtonHilight, BackColor)
G.FillRectangle(b, Rect)
End Sub
End Class
Loading

0 comments on commit 253d40b

Please sign in to comment.