Skip to content

Commit

Permalink
Fix obsoletes
Browse files Browse the repository at this point in the history
  • Loading branch information
xezno committed Dec 6, 2022
1 parent c03a41c commit fac5ef3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ _bakeresourcecache/
*.vpost_c

# Allowlist
!*_dev.vpk
!*_dev.vpk
tm-manifest.json
4 changes: 2 additions & 2 deletions code/Progress/ProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public static void Draw( Rect rect, float progress, Color color, float curve = 2
Paint.DrawRect( rect, curve );

// process
var prect = rect.Contract( 1 );
prect.width *= progress;
var prect = rect.Shrink( 1 );
prect.Width *= progress;
Paint.SetBrush( color );
Paint.DrawRect( prect, curve - 1 );
}
Expand Down
22 changes: 11 additions & 11 deletions code/Progress/ProgressRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,43 +89,43 @@ protected override void OnPaint()
Paint.ClearPen();
Paint.SetBrush( Theme.Grey.WithAlpha( 0.1f ) );
var r = rect;
r.height = 1;
r.Height = 1;
Paint.DrawRect( r );

Paint.SetPen( color.WithAlpha( 0.3f ) );
var iconRect = Paint.DrawIcon( rect.Contract( 16, 0 ), IconText, 32, TextFlag.LeftCenter );
var iconRect = Paint.DrawIcon( rect.Shrink( 16, 0 ), IconText, 32, TextFlag.LeftCenter );

var contentRect = LocalRect;
contentRect.left += iconRect.right + 16;
contentRect.right -= 16.0f;
contentRect.Left += iconRect.Right + 16;
contentRect.Right -= 16.0f;

if ( cancelButton != null && cancelButton.Visible )
{
contentRect.right = cancelButton.Position.x - 16.0f;
contentRect.Right = cancelButton.Position.x - 16.0f;
}

var barRect = contentRect;
barRect.top += (contentRect.height / 2.0f);
barRect.height = 6.0f;
barRect.top -= barRect.height / 2.0f;
barRect.Top += (contentRect.Height / 2.0f);
barRect.Height = 6.0f;
barRect.Top -= barRect.Height / 2.0f;
ProgressBar.Draw( barRect, Progress, color );

Paint.SetDefaultFont( 8 );
Paint.SetPen( Theme.White.WithAlpha( 0.9f ) );
Paint.DrawText( contentRect.Contract( 4, 11 ), Title, TextFlag.Left | TextFlag.Top );
Paint.DrawText( contentRect.Shrink( 4, 11 ), Title, TextFlag.Left | TextFlag.Top );

if ( !string.IsNullOrEmpty( BottomRight ) )
{
Paint.SetDefaultFont( 8 );
Paint.SetPen( Theme.White.WithAlpha( 0.7f ) );
Paint.DrawText( contentRect.Contract( 4, 11 ), BottomRight, TextFlag.Bottom | TextFlag.Right );
Paint.DrawText( contentRect.Shrink( 4, 11 ), BottomRight, TextFlag.Bottom | TextFlag.Right );
}

if ( !string.IsNullOrEmpty( BottomLeft ) )
{
Paint.SetDefaultFont( 8 );
Paint.SetPen( Theme.White.WithAlpha( 0.7f ) );
Paint.DrawText( contentRect.Contract( 4, 11 ), BottomLeft, TextFlag.Bottom | TextFlag.Left );
Paint.DrawText( contentRect.Shrink( 4, 11 ), BottomLeft, TextFlag.Bottom | TextFlag.Left );
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/Progress/ProgressWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ protected override void OnPaint()
Paint.Antialiasing = true;
Paint.SetPen( Theme.ControlBackground.Darken( 0.4f ), 2.0f );
Paint.SetBrush( Theme.ControlBackground );
Paint.DrawRect( LocalRect.Contract( 1 ), 0.0f );
Paint.DrawRect( LocalRect.Shrink( 1 ), 0.0f );
}
}

0 comments on commit fac5ef3

Please sign in to comment.