diff options
| author | lempamo <[email protected]> | 2017-10-21 23:00:23 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-10-21 23:00:23 -0400 |
| commit | 84b7c410b36b9d859b98150be15641d7fa6a6442 (patch) | |
| tree | a53b170307151ed36acdd47f6ddac6cb9fe3e376 /Histacom2.Engine/UI | |
| parent | 54a3e8fe71f936580339e4a4a6fb650d57fbb5d1 (diff) | |
| download | histacom2-84b7c410b36b9d859b98150be15641d7fa6a6442.tar.gz histacom2-84b7c410b36b9d859b98150be15641d7fa6a6442.tar.bz2 histacom2-84b7c410b36b9d859b98150be15641d7fa6a6442.zip | |
more xp start menu icons
Diffstat (limited to 'Histacom2.Engine/UI')
| -rw-r--r-- | Histacom2.Engine/UI/ClassicLabel.cs | 2 | ||||
| -rw-r--r-- | Histacom2.Engine/UI/ClassicStartMenuItem.cs | 82 |
2 files changed, 73 insertions, 11 deletions
diff --git a/Histacom2.Engine/UI/ClassicLabel.cs b/Histacom2.Engine/UI/ClassicLabel.cs index 4ef1201..eba8dc6 100644 --- a/Histacom2.Engine/UI/ClassicLabel.cs +++ b/Histacom2.Engine/UI/ClassicLabel.cs @@ -36,8 +36,6 @@ namespace Histacom2.Engine.UI { get { - // add the drop shadow flag for automatically drawing - // a drop shadow around the form CreateParams cp = base.CreateParams; if (DropShadow) cp.ClassStyle |= CS_DROPSHADOW; return cp; diff --git a/Histacom2.Engine/UI/ClassicStartMenuItem.cs b/Histacom2.Engine/UI/ClassicStartMenuItem.cs index e009a35..aa465b2 100644 --- a/Histacom2.Engine/UI/ClassicStartMenuItem.cs +++ b/Histacom2.Engine/UI/ClassicStartMenuItem.cs @@ -10,41 +10,98 @@ namespace Histacom2.Engine.UI { public class ClassicStartMenuItem : ToolStripMenuItem { + private ClassicStartMenuItemLayout layout; + public ClassicStartMenuItemLayout LayoutStyle { + get + { + return layout; + } + set + { + layout = value; + Invalidate(); + } + } + + private string subtext = "Subtitle"; + public string SubTitle + { + get + { + return subtext; + } + set + { + subtext = value; + Invalidate(); + } + } + public ClassicStartMenuItem() { - + AutoSize = false; } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); + if (SaveSystem.currentTheme != null) e.Graphics.Clear(SaveSystem.currentTheme.threeDObjectsColor); else e.Graphics.Clear(BackColor); + if (Selected) { - if (SaveSystem.currentTheme != null) e.Graphics.Clear(SaveSystem.currentTheme.selectedBackColor); - else e.Graphics.Clear(Color.Navy); + if (SaveSystem.currentTheme != null) e.Graphics.FillRectangle(new SolidBrush(SaveSystem.currentTheme.selectedBackColor), new Rectangle(0, 0, Width, Image.Height)); + else e.Graphics.FillRectangle(Brushes.Navy, new Rectangle(0, 0, Width, Image.Height)); } e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; StringFormat sf = new StringFormat(); sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show; - - e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); + + int imgWidth = 0; + if (Image != null) { e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); imgWidth = Image.Width; } + if (Image != null) if (Height != Image.Height) if (layout == ClassicStartMenuItemLayout.CloseTitleWithLightSubtitle && Height != Image.Height + 8) { Height = Image.Height; } + if (!Selected) { - if (SaveSystem.currentTheme != null) { e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), Brushes.Black, 38, 11, sf); } + switch (layout) { + case ClassicStartMenuItemLayout.DistancedTitle: + e.Graphics.DrawString(Text, Font, new SolidBrush(ForeColor), imgWidth + 6, 11, sf); + break; + case ClassicStartMenuItemLayout.CloseTitle: + e.Graphics.DrawString(Text, Font, new SolidBrush(ForeColor), imgWidth + 2, 9, sf); + break; + case ClassicStartMenuItemLayout.CloseTitleWithLightSubtitle: + e.Graphics.DrawString(Text, Font, new SolidBrush(ForeColor), imgWidth + 2, 3, sf); + e.Graphics.DrawString(subtext, new Font(Font, FontStyle.Regular), Brushes.Gray, imgWidth + 2, 16, sf); + if (Image != null) if (Height != Image.Height + 8) Height = Image.Height + 8; + break; + } if (DropDownItems.Count > 0) { - e.Graphics.DrawPolygon(Pens.Black, new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) }); - e.Graphics.FillPolygon(Brushes.Black, new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) }); + e.Graphics.DrawPolygon(new Pen(ForeColor), new Point[] { new Point(Width - 16, 11), new Point(Width - 13, 14), new Point(Width - 16, 17) }); + e.Graphics.FillPolygon(new SolidBrush(ForeColor), new Point[] { new Point(Width - 16, 11), new Point(Width - 13, 14), new Point(Width - 16, 17) }); } } else { if (SaveSystem.currentTheme != null) { - e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), new SolidBrush(SaveSystem.currentTheme.selectedTextColor), 38, 11, sf); + switch (layout) + { + case ClassicStartMenuItemLayout.DistancedTitle: + e.Graphics.DrawString(Text, Font, new SolidBrush(SaveSystem.currentTheme.selectedTextColor), imgWidth + 6, 11, sf); + break; + case ClassicStartMenuItemLayout.CloseTitle: + e.Graphics.DrawString(Text, Font, new SolidBrush(SaveSystem.currentTheme.selectedTextColor), imgWidth + 2, 11, sf); + break; + case ClassicStartMenuItemLayout.CloseTitleWithLightSubtitle: + e.Graphics.DrawString(Text, Font, new SolidBrush(SaveSystem.currentTheme.selectedTextColor), imgWidth + 2, 3, sf); + if (Image != null) if (Height != Image.Height + 8) Height = Image.Height + 8; + break; + } + if (DropDownItems.Count > 0) { e.Graphics.DrawPolygon(new Pen(SaveSystem.currentTheme.selectedTextColor), new Point[] { new Point(121, 11), new Point(124, 14), new Point(121, 17) }); @@ -54,4 +111,11 @@ namespace Histacom2.Engine.UI } } } + public enum ClassicStartMenuItemLayout + { + DistancedTitle, + CloseTitle, + CloseTitleWithTwoLines, + CloseTitleWithLightSubtitle + } } |
