mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-26 13:01:33 +03:00
Button icons centralised by default
This commit is contained in:
parent
55ecd42596
commit
466a9ec9d6
@ -374,7 +374,7 @@ namespace DarkUI.Controls
|
|||||||
{
|
{
|
||||||
var stringSize = g.MeasureString(Text, Font, rect.Size);
|
var stringSize = g.MeasureString(Text, Font, rect.Size);
|
||||||
|
|
||||||
var x = 0;
|
var x = (ClientSize.Width / 2) - (Image.Size.Width / 2);
|
||||||
var y = (ClientSize.Height / 2) - (Image.Size.Height / 2);
|
var y = (ClientSize.Height / 2) - (Image.Size.Height / 2);
|
||||||
|
|
||||||
switch (TextImageRelation)
|
switch (TextImageRelation)
|
||||||
@ -388,7 +388,8 @@ namespace DarkUI.Controls
|
|||||||
y = y + ((int)(stringSize.Height / 2) + (ImagePadding / 2));
|
y = y + ((int)(stringSize.Height / 2) + (ImagePadding / 2));
|
||||||
break;
|
break;
|
||||||
case TextImageRelation.ImageBeforeText:
|
case TextImageRelation.ImageBeforeText:
|
||||||
textOffsetX = Image.Size.Width + ImagePadding;
|
textOffsetX = Image.Size.Width + (ImagePadding * 2);
|
||||||
|
x = ImagePadding;
|
||||||
break;
|
break;
|
||||||
case TextImageRelation.TextBeforeImage:
|
case TextImageRelation.TextBeforeImage:
|
||||||
x = x + (int)stringSize.Width;
|
x = x + (int)stringSize.Width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user