Skip to content

Commit

Permalink
Merge pull request #337 from Krypton-Suite/alpah-333-MaximisedCutOff
Browse files Browse the repository at this point in the history
- Make sure values can accept a 16*16 icon
  • Loading branch information
PWagner1 authored Sep 12, 2021
2 parents 2b7e9f9 + 1b79cf4 commit ee7a4b5
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 45 deletions.
3 changes: 2 additions & 1 deletion Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* Fixed [#315](https://github.com/Krypton-Suite/Standard-Toolkit/issues/315), When adding a new KContextmenu, How do you change it's name etc
- Sort out the Callback actions that were removed
* Fixed [#323](https://github.com/Krypton-Suite/Standard-Toolkit/issues/323), `KryptonCheckButton` Click removes image

* Fixed [#333](https://github.com/Krypton-Suite/Standard-Toolkit/issues/333), Krypton Form - ButtonSpec (And Icon), are Cut Off when maximised

=======

## 2021-09-01 - Build 2109 - September 2021 (Canary)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ public static Padding GetWindowBorders(CreateParams cp)
PI.AdjustWindowRectEx(ref rect, cp.Style, false, cp.ExStyle);

// Return the per side border values
return new Padding(-rect.left, -rect.top, rect.right, rect.bottom);
return new Padding(-rect.left, Math.Max(16,-rect.top), rect.right, rect.bottom);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class PaletteOffice2007Base : PaletteBase
private static readonly Padding _contentPaddingHeader2 = new(2, 1, 2, 1);
private static readonly Padding _contentPaddingDock = new(2, 2, 2, 1);
private static readonly Padding _contentPaddingCalendar = new(2);
private static readonly Padding _contentPaddingHeaderForm = new(5, 2, 3, 0);
private static readonly Padding _contentPaddingHeaderForm = new(10, 6, 3, 0); // 10 is from the RealWindowFrameSize +1
private static readonly Padding _contentPaddingLabel = new(3, 1, 3, 1);
private static readonly Padding _contentPaddingLabel2 = new(8, 2, 8, 2);
private static readonly Padding _contentPaddingButtonCalendar = new(-1);
Expand All @@ -49,7 +49,7 @@ public abstract class PaletteOffice2007Base : PaletteBase
private static readonly Padding _metricPaddingRibbon = new(0, 1, 1, 1);
private static readonly Padding _metricPaddingRibbonAppButton = new(3, 0, 3, 0);
private static readonly Padding _metricPaddingHeader = new(0, 3, 1, 3);
private static readonly Padding _metricPaddingHeaderForm = new(0);
private static readonly Padding _metricPaddingHeaderForm = new(0, 3, 0, -3); // Move the Maximised Form buttons down a bit
private static readonly Padding _metricPaddingInputControl = new(0, 1, 0, 1);
private static readonly Padding _metricPaddingBarInside = new(3);
private static readonly Padding _metricPaddingBarTabs = new(0);
Expand Down Expand Up @@ -2804,7 +2804,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
case PaletteMetricInt.CheckButtonGap:
return 5;
case PaletteMetricInt.HeaderButtonEdgeInsetForm:
return 4;
return 9; // Needs to be the RealWindowBorderWidth Offset - No idea how to get it at this point
case PaletteMetricInt.HeaderButtonEdgeInsetInputControl:
return 1;
case PaletteMetricInt.HeaderButtonEdgeInsetPrimary:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class PaletteOffice2010Base : PaletteBase
private static readonly Padding _contentPaddingHeader2 = new(2, 1, 2, 1);
private static readonly Padding _contentPaddingDock = new(2, 2, 2, 1);
private static readonly Padding _contentPaddingCalendar = new(2);
private static readonly Padding _contentPaddingHeaderForm = new(5, 2, 3, 0);
private static readonly Padding _contentPaddingHeaderForm = new(10, 6, 3, 0); // 10 is from the RealWindowFrameSize +1
private static readonly Padding _contentPaddingLabel = new(3, 1, 3, 1);
private static readonly Padding _contentPaddingLabel2 = new(8, 2, 8, 2);
private static readonly Padding _contentPaddingButtonInputControl = new(0);
Expand All @@ -48,7 +48,7 @@ public abstract class PaletteOffice2010Base : PaletteBase
private static readonly Padding _metricPaddingRibbon = new(0, 1, 1, 1);
private static readonly Padding _metricPaddingRibbonAppButton = new(3, 0, 3, 0);
private static readonly Padding _metricPaddingHeader = new(0, 3, 1, 3);
private static readonly Padding _metricPaddingHeaderForm = new(0);
private static readonly Padding _metricPaddingHeaderForm = new(0, 3, 0, -3); // Move the Maximised Form buttons down a bit
private static readonly Padding _metricPaddingInputControl = new(0, 1, 0, 1);
private static readonly Padding _metricPaddingBarInside = new(3);
private static readonly Padding _metricPaddingBarTabs = new(0);
Expand Down Expand Up @@ -2748,7 +2748,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
case PaletteMetricInt.CheckButtonGap:
return 5;
case PaletteMetricInt.HeaderButtonEdgeInsetForm:
return 4;
return 9; // Needs to be the RealWindowBorderWidth Offset - No idea how to get it at this point
case PaletteMetricInt.HeaderButtonEdgeInsetInputControl:
return 1;
case PaletteMetricInt.HeaderButtonEdgeInsetPrimary:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class PaletteOffice2013Base : PaletteBase
private static readonly Padding _contentPaddingHeader2 = new(2, 1, 2, 1);
private static readonly Padding _contentPaddingDock = new(2, 2, 2, 1);
private static readonly Padding _contentPaddingCalendar = new(2);
private static readonly Padding _contentPaddingHeaderForm = new(5, 2, 3, 0);
private static readonly Padding _contentPaddingHeaderForm = new(10, 6, 3, 0); // 10 is from the RealWindowFrameSize +1
private static readonly Padding _contentPaddingLabel = new(3, 1, 3, 1);
private static readonly Padding _contentPaddingLabel2 = new(8, 2, 8, 2);
private static readonly Padding _contentPaddingButtonInputControl = new(0);
Expand All @@ -48,7 +48,7 @@ public abstract class PaletteOffice2013Base : PaletteBase
private static readonly Padding _metricPaddingRibbon = new(0, 1, 1, 1);
private static readonly Padding _metricPaddingRibbonAppButton = new(3, 0, 3, 0);
private static readonly Padding _metricPaddingHeader = new(0, 3, 1, 3);
private static readonly Padding _metricPaddingHeaderForm = new(0);
private static readonly Padding _metricPaddingHeaderForm = new(0, 3, 0, -3); // Move the Maximised Form buttons down a bit
private static readonly Padding _metricPaddingInputControl = new(0, 1, 0, 1);
private static readonly Padding _metricPaddingBarInside = new(3);
private static readonly Padding _metricPaddingBarTabs = new(0);
Expand Down Expand Up @@ -114,22 +114,22 @@ public abstract class PaletteOffice2013Base : PaletteBase
private static readonly Color _formCloseCheckedTracking1 = Color.FromArgb(255, 132, 130);
private static readonly Color _formCloseCheckedTracking2 = Color.FromArgb(255, 132, 130);
private static readonly Color[] _appButtonNormal = { Color.FromArgb(243, 245, 248),
Color.FromArgb(214, 220, 231),
Color.FromArgb(188, 198, 211),
Color.FromArgb(254, 254, 255),
Color.FromArgb(214, 220, 231),
Color.FromArgb(188, 198, 211),
Color.FromArgb(254, 254, 255),
Color.FromArgb(206, 213, 225)
};

private static readonly Color[] _appButtonTrack = { Color.FromArgb(255, 251, 230),
private static readonly Color[] _appButtonTrack = { Color.FromArgb(255, 251, 230),
Color.FromArgb(248, 230, 143),
Color.FromArgb(238, 213, 126),
Color.FromArgb(254, 247, 129),
Color.FromArgb(238, 213, 126),
Color.FromArgb(254, 247, 129),
Color.FromArgb(240, 201, 41)
};

private static readonly Color[] _appButtonPressed = { Color.FromArgb(235, 227, 196),
private static readonly Color[] _appButtonPressed = { Color.FromArgb(235, 227, 196),
Color.FromArgb(228, 198, 149),
Color.FromArgb(166, 97, 7),
Color.FromArgb(166, 97, 7),
Color.FromArgb(242, 155, 57),
Color.FromArgb(236, 136, 9)
};
Expand Down Expand Up @@ -2793,7 +2793,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
case PaletteMetricInt.CheckButtonGap:
return 5;
case PaletteMetricInt.HeaderButtonEdgeInsetForm:
return 4;
return 9; // Needs to be the RealWindowBorderWidth Offset - No idea how to get it at this point
case PaletteMetricInt.HeaderButtonEdgeInsetInputControl:
return 1;
case PaletteMetricInt.HeaderButtonEdgeInsetPrimary:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class PaletteOffice365Base : PaletteBase
private static readonly Padding _contentPaddingHeader2 = new(2, 1, 2, 1);
private static readonly Padding _contentPaddingDock = new(2, 2, 2, 1);
private static readonly Padding _contentPaddingCalendar = new(2);
private static readonly Padding _contentPaddingHeaderForm = new(5, 2, 3, 0);
private static readonly Padding _contentPaddingHeaderForm = new(10, 6, 3, 0); // 10 is from the RealWindowFrameSize +1
private static readonly Padding _contentPaddingLabel = new(3, 1, 3, 1);
private static readonly Padding _contentPaddingLabel2 = new(8, 2, 8, 2);
private static readonly Padding _contentPaddingButtonInputControl = new(0);
Expand All @@ -49,7 +49,7 @@ public abstract class PaletteOffice365Base : PaletteBase
private static readonly Padding _metricPaddingRibbon = new(0, 1, 1, 1);
private static readonly Padding _metricPaddingRibbonAppButton = new(3, 0, 3, 0);
private static readonly Padding _metricPaddingHeader = new(0, 3, 1, 3);
private static readonly Padding _metricPaddingHeaderForm = new(0);
private static readonly Padding _metricPaddingHeaderForm = new(0, 3, 0, -3); // Move the Maximised Form buttons down a bit
private static readonly Padding _metricPaddingInputControl = new(0, 1, 0, 1);
private static readonly Padding _metricPaddingBarInside = new(3);
private static readonly Padding _metricPaddingBarTabs = new(0);
Expand Down Expand Up @@ -114,24 +114,24 @@ public abstract class PaletteOffice365Base : PaletteBase
private static readonly Color _formCloseChecked2 = Color.FromArgb(255, 132, 130);
private static readonly Color _formCloseCheckedTracking1 = Color.FromArgb(255, 132, 130);
private static readonly Color _formCloseCheckedTracking2 = Color.FromArgb(255, 132, 130);
private static readonly Color[] _appButtonNormal = { Color.FromArgb(243, 245, 248),
Color.FromArgb(214, 220, 231),
Color.FromArgb(188, 198, 211),
Color.FromArgb(254, 254, 255),
private static readonly Color[] _appButtonNormal = { Color.FromArgb(243, 245, 248),
Color.FromArgb(214, 220, 231),
Color.FromArgb(188, 198, 211),
Color.FromArgb(254, 254, 255),
Color.FromArgb(206, 213, 225)
};

private static readonly Color[] _appButtonTrack = { Color.FromArgb(255, 251, 230),
Color.FromArgb(248, 230, 143),
Color.FromArgb(238, 213, 126),
Color.FromArgb(254, 247, 129),
private static readonly Color[] _appButtonTrack = { Color.FromArgb(255, 251, 230),
Color.FromArgb(248, 230, 143),
Color.FromArgb(238, 213, 126),
Color.FromArgb(254, 247, 129),
Color.FromArgb(240, 201, 41)
};

private static readonly Color[] _appButtonPressed = { Color.FromArgb(235, 227, 196),
Color.FromArgb(228, 198, 149),
Color.FromArgb(166, 97, 7),
Color.FromArgb(242, 155, 57),
private static readonly Color[] _appButtonPressed = { Color.FromArgb(235, 227, 196),
Color.FromArgb(228, 198, 149),
Color.FromArgb(166, 97, 7),
Color.FromArgb(242, 155, 57),
Color.FromArgb(236, 136, 9)
};

Expand Down Expand Up @@ -2809,7 +2809,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
case PaletteMetricInt.CheckButtonGap:
return 5;
case PaletteMetricInt.HeaderButtonEdgeInsetForm:
return 4;
return 9; // Needs to be the RealWindowBorderWidth Offset - No idea how to get it at this point
case PaletteMetricInt.HeaderButtonEdgeInsetInputControl:
return 1;
case PaletteMetricInt.HeaderButtonEdgeInsetPrimary:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class PaletteProfessionalSystem : PaletteBase
private static readonly Padding _contentPaddingHeader2 = new(3, 2, 3, 2);
private static readonly Padding _contentPaddingHeader3 = new(2, 1, 2, 1);
private static readonly Padding _contentPaddingCalendar = new(2);
private static readonly Padding _contentPaddingHeaderForm = new(5, 1, 3, 1);
private static readonly Padding _contentPaddingHeaderForm = new(10, 6, 3, 1); // 10 is from the RealWindowFrameSize +1
private static readonly Padding _contentPaddingLabel = new(3, 2, 3, 2);
private static readonly Padding _contentPaddingLabel2 = new(8, 2, 8, 2);
private static readonly Padding _contentPaddingButtonCalendar = new(0);
Expand All @@ -49,7 +49,7 @@ public class PaletteProfessionalSystem : PaletteBase
private static readonly Padding _metricPaddingRibbon = new(0, 1, 1, 1);
private static readonly Padding _metricPaddingRibbonAppButton = new(3, 0, 3, 0);
private static readonly Padding _metricPaddingHeader = new(0, 3, 1, 3);
private static readonly Padding _metricPaddingHeaderForm = new(0, 0, 0, 0);
private static readonly Padding _metricPaddingHeaderForm = new(0, 3, 0, -3); // Move the Maximised Form buttons down a bit
private static readonly Padding _metricPaddingBarInside = new(3, 3, 3, 3);
private static readonly Padding _metricPaddingBarTabs = new(0, 0, 0, 0);
private static readonly Padding _metricPaddingBarOutside = new(0, 0, 0, 3);
Expand Down Expand Up @@ -2541,7 +2541,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
case PaletteMetricInt.CheckButtonGap:
return 5;
case PaletteMetricInt.HeaderButtonEdgeInsetForm:
return 4;
return 9; // Needs to be the RealWindowBorderWidth Offset - No idea how to get it at this point
case PaletteMetricInt.HeaderButtonEdgeInsetInputControl:
return 1;
case PaletteMetricInt.HeaderButtonEdgeInsetPrimary:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class PaletteSparkleBase : PaletteBase
private static readonly Padding _contentPaddingHeader2 = new(3, 2, 2, 2);
private static readonly Padding _contentPaddingHeader3 = new(2, 1, 2, 1);
private static readonly Padding _contentPaddingCalendar = new(2);
private static readonly Padding _contentPaddingHeaderForm = new(5, -3, 3, -3);
private static readonly Padding _contentPaddingHeaderForm = new(10, -3, 3, -3); // 10 is from the RealWindowFrameSize +1
private static readonly Padding _contentPaddingLabel = new(3, 1, 3, 1);
private static readonly Padding _contentPaddingLabel2 = new(8, 2, 8, 2);
private static readonly Padding _contentPaddingButtonInputControl = new(0);
Expand All @@ -48,7 +48,7 @@ public class PaletteSparkleBase : PaletteBase
private static readonly Padding _metricPaddingRibbon = new(0, 1, 1, 1);
private static readonly Padding _metricPaddingRibbonAppButton = new(3, 0, 3, 0);
private static readonly Padding _metricPaddingHeader = new(0, 3, 1, 3);
private static readonly Padding _metricPaddingHeaderForm = new(0);
private static readonly Padding _metricPaddingHeaderForm = new(0, 3, 0, -3); // Move the Maximised Form buttons down a bit
private static readonly Padding _metricPaddingInputControl = new(0, 1, 0, 1);
private static readonly Padding _metricPaddingBarInside = new(3);
private static readonly Padding _metricPaddingBarTabs = new(0);
Expand Down Expand Up @@ -2703,7 +2703,7 @@ public override int GetMetricInt(PaletteState state, PaletteMetricInt metric)
case PaletteMetricInt.CheckButtonGap:
return 5;
case PaletteMetricInt.HeaderButtonEdgeInsetForm:
return 4;
return 9; // Needs to be the RealWindowBorderWidth Offset - No idea how to get it at this point
case PaletteMetricInt.HeaderButtonEdgeInsetInputControl:
return 1;
case PaletteMetricInt.HeaderButtonEdgeInsetPrimary:
Expand Down Expand Up @@ -3034,8 +3034,8 @@ public override Image GetButtonSpecImage(PaletteButtonSpecStyle style,
PaletteState.Tracking => _sparkleHelpHover,
_ => _sparkleHelpI
};
//return state == PaletteState.Disabled ? _sparkleHelpI : _sparkleHelpA;

//return state == PaletteState.Disabled ? _sparkleHelpI : _sparkleHelpA;

case PaletteButtonSpecStyle.Close:
return _buttonSpecClose;
Expand Down
Loading

0 comments on commit ee7a4b5

Please sign in to comment.