Skip to content

Commit 5b50a9c

Browse files
authored
Merge branch 'alpha' into 2503-feature-request-add-the-ability-to-create-zip-files-for-binaries
2 parents 45712af + 01f9097 commit 5b50a9c

File tree

42 files changed

+688
-662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+688
-662
lines changed

Documents/Changelog/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
## 2025-11-xx - Build 2511 (V10 - alpha) - November 2025
66
* Implemented [#2503](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2503), Add the ability to create zip files for binaries
7+
* Implemented [#952](https://github.com/Krypton-Suite/Standard-Toolkit/issues/952), Place built NuGet packages into separate directory
78
* Implemented [#892](https://github.com/Krypton-Suite/Standard-Toolkit/issues/892), `KryptonButton` UAC Shield icons need to match the OS style
89
* Resolved [#2514](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2514), `KryptonPanel.OnPaint` does not call base.
910
* Resolved [#2508](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2508), Add internal `InDesignMode()` extension methods to both `Control` and `Component` classes.

Scripts/Project-Files/canary.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<Target Name="CleanPackages">
3131
<ItemGroup>
32-
<NugetPkgs Include="..\..\..\Bin\Canary\*.nupkg" />
32+
<NugetPkgs Include="..\..\..\Bin\Packages\Canary\*.nupkg" />
3333
</ItemGroup>
3434
<Delete Files="@(NugetPkgs)" />
3535
</Target>
@@ -54,7 +54,7 @@
5454

5555
<Target Name="Push">
5656
<ItemGroup>
57-
<NugetPkgs Include="..\..\..\Bin\Canary\*.$(LibraryVersion).nupkg" />
57+
<NugetPkgs Include="..\..\..\Bin\Packages\Canary\*.$(LibraryVersion).nupkg" />
5858
</ItemGroup>
5959
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
6060
</Target>

Scripts/Project-Files/installer.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<Target Name="CleanPackages">
3131
<ItemGroup>
32-
<NugetPkgs Include="..\..\..\Bin\Installer\*.nupkg" />
32+
<NugetPkgs Include="..\..\..\Bin\Packages\Installer\*.nupkg" />
3333
</ItemGroup>
3434
<Delete Files="@(NugetPkgs)" />
3535
</Target>
@@ -54,7 +54,7 @@
5454

5555
<Target Name="Push">
5656
<ItemGroup>
57-
<NugetPkgs Include="..\..\..\Bin\Installer\*.$(LibraryVersion).nupkg" />
57+
<NugetPkgs Include="..\..\..\Bin\Packages\Installer\*.$(LibraryVersion).nupkg" />
5858
</ItemGroup>
5959
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
6060
</Target>

Scripts/build.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<Target Name="CleanPackages">
3333
<ItemGroup>
34-
<NugetPkgs Include="..\Bin\Release\*.nupkg" />
34+
<NugetPkgs Include="..\Bin\Packages\Release\*.nupkg" />
3535
</ItemGroup>
3636
<Delete Files="@(NugetPkgs)" />
3737
</Target>
@@ -72,7 +72,7 @@
7272

7373
<Target Name="Push">
7474
<ItemGroup>
75-
<NugetPkgs Include="..\Bin\Release\*.$(LibraryVersion).nupkg" />
75+
<NugetPkgs Include="..\Bin\Packages\Release\*.$(LibraryVersion).nupkg" />
7676
</ItemGroup>
7777
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
7878
</Target>

Scripts/canary.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<Target Name="CleanPackages">
3333
<ItemGroup>
34-
<NugetPkgs Include="..\Bin\Canary\*.nupkg" />
34+
<NugetPkgs Include="..\Bin\Packages\Canary\*.nupkg" />
3535
</ItemGroup>
3636
<Delete Files="@(NugetPkgs)" />
3737
</Target>
@@ -57,7 +57,7 @@
5757

5858
<Target Name="Push">
5959
<ItemGroup>
60-
<NugetPkgs Include="..\Bin\Canary\*.$(LibraryVersion).nupkg" />
60+
<NugetPkgs Include="..\Bin\Packages\Canary\*.$(LibraryVersion).nupkg" />
6161
</ItemGroup>
6262
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
6363
</Target>

Scripts/installer.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<Target Name="CleanPackages">
3131
<ItemGroup>
32-
<NugetPkgs Include="..\Bin\Installer\*.nupkg" />
32+
<NugetPkgs Include="..\Bin\Packages\Installer\*.nupkg" />
3333
</ItemGroup>
3434
<Delete Files="@(NugetPkgs)" />
3535
</Target>
@@ -54,7 +54,7 @@
5454

5555
<Target Name="Push">
5656
<ItemGroup>
57-
<NugetPkgs Include="..\Bin\Installer\*.$(LibraryVersion).nupkg" />
57+
<NugetPkgs Include="..\Bin\Packages\Installer\*.$(LibraryVersion).nupkg" />
5858
</ItemGroup>
5959
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
6060
</Target>

Scripts/nightly.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
<Target Name="CleanPackages">
3535
<ItemGroup>
36-
<NugetPkgs Include="..\Bin\Nightly\*.nupkg" />
36+
<NugetPkgs Include="..\Bin\Packages\Nightly\*.nupkg" />
3737
</ItemGroup>
3838
<Delete Files="@(NugetPkgs)" />
3939
</Target>
@@ -58,7 +58,7 @@
5858

5959
<Target Name="Push">
6060
<ItemGroup>
61-
<NugetPkgs Include="..\Bin\Nightly\*.$(LibraryVersion).nupkg" />
61+
<NugetPkgs Include="..\Bin\Packages\Nightly\*.$(LibraryVersion).nupkg" />
6262
</ItemGroup>
6363
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
6464
</Target>

Source/Krypton Components/Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
<Version>$(LibraryVersion)</Version>
2121
</PropertyGroup>
2222

23+
<!-- Configure NuGet package output to separate directory for easier management -->
24+
<PropertyGroup>
25+
<PackageOutputPath>$(MSBuildThisFileDirectory)..\..\Bin\Packages\$(Configuration)\</PackageOutputPath>
26+
</PropertyGroup>
27+
2328
<Choose>
2429
<When Condition="'$(Configuration)' == 'Canary'">
2530
<ItemGroup>

Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialog/Elements/KryptonTaskDialogElementBase.cs

Lines changed: 114 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#region BSD License
1+
#region BSD License
22
/*
3-
*
4-
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
5-
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
63
*
74
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
85
* Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac, Ahmed Abdelhameed, tobitege et al. 2025 - 2025. All rights reserved.
@@ -29,6 +26,8 @@ public abstract class KryptonTaskDialogElementBase :
2926
private KryptonPanel _panel;
3027
private bool _panelVisible;
3128
private KryptonTaskDialogDefaults _taskDialogDefaults;
29+
private Bitmap _separator;
30+
private (int FontMinValue, int FontMaxValue, int Adjust75, int Adjust50, int Adjust25) _separatorValues;
3231
#endregion
3332

3433
#region Events
@@ -51,24 +50,32 @@ public KryptonTaskDialogElementBase(KryptonTaskDialogDefaults taskDialogDefaults
5150
{
5251
// Set the data
5352
_taskDialogDefaults = taskDialogDefaults;
53+
_disposed = false;
54+
55+
_separatorValues.FontMinValue = 50;
56+
_separatorValues.FontMaxValue = 255 - 50;
57+
_separatorValues.Adjust75 = 75;
58+
_separatorValues.Adjust50 = 50;
59+
_separatorValues.Adjust25 = 25;
5460

5561
// Although OnGlobalPaletteChanged synchronizes palette changes with the elements,
5662
// The initialisation is done here.
5763
Palette = KryptonManager.CurrentGlobalPalette;
58-
// Execute OnGlobalPaletteChanged once to set the initial palette and wire the PalettePaint event.
59-
OnGlobalPaletteChanged(null!, null!);
6064
// From there the event handler will take over.
6165
KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
6266

63-
_disposed = false;
64-
6567
_panel = new()
6668
{
67-
Margin = new Padding(0),
68-
Padding = new Padding(0),
69+
Margin = _taskDialogDefaults.NullPadding,
70+
Padding = _taskDialogDefaults.NullMargin,
6971
Visible = false
72+
7073
};
71-
_panelVisible = false;
74+
75+
_panelVisible = false;
76+
_separator = CreateSeparator();
77+
_panel.Paint += OnPanelPaint;
78+
Palette.PalettePaint += OnPalettePaint;
7279

7380
LayoutDirty = false;
7481
}
@@ -115,6 +122,7 @@ protected virtual void OnGlobalPaletteChanged(object? sender, EventArgs e)
115122
if (Palette is not null)
116123
{
117124
Palette.PalettePaint += OnPalettePaint;
125+
_separator = CreateSeparator();
118126
}
119127
}
120128
#endregion
@@ -190,6 +198,23 @@ public sealed override string ToString()
190198
#endregion
191199

192200
#region Public
201+
/// <summary>
202+
/// Displays a separator line at the top of the element.
203+
/// </summary>
204+
public bool ShowSeparator
205+
{
206+
get => field;
207+
208+
set
209+
{
210+
if (field != value)
211+
{
212+
field = value;
213+
_panel.Invalidate();
214+
}
215+
}
216+
}
217+
193218
/// <summary>
194219
/// Returns if the element's layout needs a refresh when visible or before the dialog will be displayed.
195220
/// </summary>
@@ -206,6 +231,11 @@ public sealed override string ToString()
206231
#endregion
207232

208233
#region Private
234+
private void OnPanelPaint(object? sender, PaintEventArgs e)
235+
{
236+
PaintSeparator();
237+
}
238+
209239
private void OnBackColorsChanged()
210240
{
211241
if (BackColor1 != Color.Empty && BackColor2 != Color.Empty)
@@ -228,13 +258,86 @@ protected virtual void OnVisibleChanged()
228258
}
229259
#endregion
230260

261+
#region Private Separator
262+
private Bitmap CreateSeparator()
263+
{
264+
(Color color1, Color color2) colors = GetSeparatorColors();
265+
266+
int width = Defaults.ClientWidth - Defaults.PanelLeft - Defaults.PanelRight;
267+
Rectangle rectangle = new Rectangle(0, 0, width, 2);
268+
Rectangle rectangleTop = new Rectangle(0, 0, width, 1);
269+
Rectangle rectangleBottom = new Rectangle(0, 1, width, 1);
270+
271+
using Bitmap bitmap = new Bitmap(rectangle.Width, rectangle.Height);
272+
using Brush brush1 = new SolidBrush(colors.color1);
273+
using Brush brush2 = new SolidBrush(colors.color2);
274+
using Graphics graphics = Graphics.FromImage(bitmap);
275+
276+
graphics.FillRectangle(brush1, rectangleTop);
277+
graphics.FillRectangle(brush2, rectangleBottom);
278+
279+
return bitmap.Clone(rectangle, bitmap.PixelFormat);
280+
}
281+
282+
private void PaintSeparator()
283+
{
284+
if (ShowSeparator)
285+
{
286+
using Graphics graphics = Panel.CreateGraphics();
287+
graphics.DrawImage(_separator, Defaults.PanelLeft, 0);
288+
}
289+
}
290+
291+
private (Color, Color) GetSeparatorColors()
292+
{
293+
Color color1;
294+
Color color2;
295+
296+
// If BackColor1 has been set use this for the separator, otherwise fall back to theme colours.
297+
Color tmp = this.BackColor1 != Color.Empty
298+
? this.BackColor1
299+
: Panel.GetResolvedPalette().GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal);
300+
301+
if (tmp.R > _separatorValues.FontMaxValue && tmp.G > _separatorValues.FontMaxValue && tmp.B > _separatorValues.FontMaxValue)
302+
{
303+
// If the colour reaches an upper bound it can't be made lighter.
304+
color1 = Color.FromArgb(tmp.R - _separatorValues.Adjust75, tmp.G - _separatorValues.Adjust75, tmp.B - _separatorValues.Adjust75);
305+
color2 = Color.White;
306+
}
307+
else if (tmp.R < _separatorValues.FontMinValue && tmp.G < _separatorValues.FontMinValue && tmp.B < _separatorValues.FontMinValue)
308+
{
309+
// If the colour reaches a lower bound, it can't be made darker.
310+
color2 = ControlPaint.Light(tmp);
311+
color1 = ControlPaint.Light(Color.LightSlateGray);
312+
}
313+
else if (tmp.R > 150 && tmp.G > 150 && tmp.B > 150)
314+
{
315+
// Colours that are somewhere in the middle need different handling
316+
int r = Math.Min(tmp.R - _separatorValues.Adjust50, 255);
317+
int g = Math.Min(tmp.G - _separatorValues.Adjust50, 255);
318+
int b = Math.Min(tmp.B - _separatorValues.Adjust50, 255);
319+
320+
color1 = Color.FromArgb(r, g, b);
321+
color2 = Color.LightGray;
322+
}
323+
else
324+
{
325+
color1 = ControlPaint.Dark(tmp);
326+
color2 = ControlPaint.Light(tmp);
327+
}
328+
329+
return (color1, color2);
330+
}
331+
#endregion
332+
231333
#region IDispose
232334
/// <inheritdoc/>
233335
protected virtual void Dispose(bool disposing)
234336
{
235337
if (!_disposed && disposing)
236338
{
237339
KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged;
340+
_panel.Paint -= OnPanelPaint;
238341

239342
if (Palette is not null)
240343
{

Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonTaskDialog/Elements/KryptonTaskDialogElementCheckBox.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#region BSD License
1+
#region BSD License
22
/*
3-
*
4-
* Original BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
5-
* © Component Factory Pty Ltd, 2006 - 2016, (Version 4.5.0.0) All rights reserved.
63
*
74
* New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
85
* Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac, Ahmed Abdelhameed, tobitege et al. 2025 - 2025. All rights reserved.

0 commit comments

Comments
 (0)