diff options
| author | MichaelTheShifter <[email protected]> | 2016-07-20 09:40:36 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-07-20 09:40:36 -0400 |
| commit | d40fed5ce2bc806a91245adb18039634eac13ed0 (patch) | |
| tree | f1d7168aee6db109ac2c738ad18c9db667a6ba69 /source/ShiftUI/Theming/ThemeElementsMemphis.cs | |
| parent | f1856e8ed30ed882229fd3fa2a4038122a5fb441 (diff) | |
| download | shiftos-c--d40fed5ce2bc806a91245adb18039634eac13ed0.tar.gz shiftos-c--d40fed5ce2bc806a91245adb18039634eac13ed0.tar.bz2 shiftos-c--d40fed5ce2bc806a91245adb18039634eac13ed0.zip | |
Move ShiftUI source code to ShiftOS
This'll be a lot easier to work on.
Diffstat (limited to 'source/ShiftUI/Theming/ThemeElementsMemphis.cs')
| -rw-r--r-- | source/ShiftUI/Theming/ThemeElementsMemphis.cs | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/source/ShiftUI/Theming/ThemeElementsMemphis.cs b/source/ShiftUI/Theming/ThemeElementsMemphis.cs new file mode 100644 index 0000000..1a2e892 --- /dev/null +++ b/source/ShiftUI/Theming/ThemeElementsMemphis.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ShiftUI.Theming.Default; +using System.Drawing; +using ShiftUI.ShiftOS; + +namespace ShiftUI.Theming +{ + class ThemeElementsMemphis : ThemeElementsDefault + { + + public ThemeElementsMemphis() + { + } + + public override ButtonPainter ButtonPainter + { + get + { + return new Memphis.ButtonPainter(); + } + } + } + + namespace Memphis + { + internal class ButtonPainter : Default.ButtonPainter + { + + #region Buttons + #region Standard Button + public override void Draw(Graphics g, Rectangle bounds, ButtonThemeState state, Color backColor, Color foreColor) + { + bool is_themecolor = backColor.ToArgb() == ThemeEngine.Current.ColorControl.ToArgb() || backColor == Color.Empty ? true : false; + CPColor cpcolor = is_themecolor ? CPColor.Empty : ResPool.GetCPColor(backColor); + Pen pen; + + switch (state) + { + case ButtonThemeState.Disabled: + case ButtonThemeState.Normal: + case ButtonThemeState.Entered: + case ButtonThemeState.Default: + pen = new Pen(foreColor, Application.CurrentSkin.ButtonBorderWidth); + g.DrawRectangle(pen, bounds); + break; + case ButtonThemeState.Pressed: + g.FillRectangle(new SolidBrush(backColor), bounds); + pen = new Pen(foreColor, Application.CurrentSkin.ButtonBorderWidth); + g.DrawRectangle(pen, bounds); + break; + } + } + #endregion + + #region FlatStyle Button + public override void DrawFlat(Graphics g, Rectangle bounds, ButtonThemeState state, Color backColor, Color foreColor, FlatButtonAppearance appearance) + { + Draw(g, bounds, state, backColor, foreColor); + } + #endregion + + #region Popup Button + public override void DrawPopup(Graphics g, Rectangle bounds, ButtonThemeState state, Color backColor, Color foreColor) + { + Draw(g, bounds, state, backColor, foreColor); + } + #endregion + #endregion + + private static Color ChangeIntensity(Color baseColor, float percent) + { + int H, I, S; + + WidgetPaint.Color2HBS(baseColor, out H, out I, out S); + int NewIntensity = Math.Min(255, (int)(I * percent)); + + return WidgetPaint.HBS2Color(H, NewIntensity, S); + } + + } + } +} |
