mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
[GcodePreview]Fix background on dark theme (#29837)
This commit is contained in:
@@ -29,6 +29,14 @@ namespace Microsoft.PowerToys.PreviewHandler.Gcode
|
||||
/// </summary>
|
||||
private bool _infoBarAdded;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GcodePreviewHandlerControl"/> class.
|
||||
/// </summary>
|
||||
public GcodePreviewHandlerControl()
|
||||
{
|
||||
SetBackgroundColor(Settings.BackgroundColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start the preview on the Control.
|
||||
/// </summary>
|
||||
@@ -124,7 +132,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Gcode
|
||||
{
|
||||
_pictureBox = new PictureBox();
|
||||
_pictureBox.BackgroundImage = image;
|
||||
_pictureBox.BackgroundImageLayout = ImageLayout.Center;
|
||||
_pictureBox.BackgroundImageLayout = Width >= image.Width && Height >= image.Height ? ImageLayout.Center : ImageLayout.Zoom;
|
||||
_pictureBox.Dock = DockStyle.Fill;
|
||||
Controls.Add(_pictureBox);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user