From 63538a46808961b351914bb8914d42bcdb06fcde Mon Sep 17 00:00:00 2001 From: fahminlb33 Date: Sat, 16 Oct 2021 20:18:01 +0700 Subject: [PATCH] Remove project and merge with KF app --- src/KFlearning.Control/FlatListBox.cs | 39 --------- src/KFlearning.Control/FlatTabControl.cs | 79 ------------------- .../KFlearning.Control.csproj | 35 -------- 3 files changed, 153 deletions(-) delete mode 100644 src/KFlearning.Control/FlatListBox.cs delete mode 100644 src/KFlearning.Control/FlatTabControl.cs delete mode 100644 src/KFlearning.Control/KFlearning.Control.csproj diff --git a/src/KFlearning.Control/FlatListBox.cs b/src/KFlearning.Control/FlatListBox.cs deleted file mode 100644 index 918448a..0000000 --- a/src/KFlearning.Control/FlatListBox.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace KFlearning.Control -{ - public class FlatListBox - { - public static void DrawItemHandler(object sender, DrawItemEventArgs e) - { - if (e.Index < 0) - { - return; - } - - e.DrawBackground(); - e.DrawFocusRectangle(); - - var listBox = (ListBox) sender; - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - - Rectangle bgRect = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); - - SolidBrush stateBrush = e.State.HasFlag(DrawItemState.Selected) - ? new SolidBrush(Color.FromArgb(35, 168, 109)) - : new SolidBrush(Color.FromArgb(51, 53, 55)); - - e.Graphics.FillRectangle(stateBrush, bgRect); - - e.Graphics.DrawString(" " + listBox.Items[e.Index], new Font("Segoe UI", 8), Brushes.White, e.Bounds.X, - e.Bounds.Y + 2); - e.Graphics.Dispose(); - } - } -} \ No newline at end of file diff --git a/src/KFlearning.Control/FlatTabControl.cs b/src/KFlearning.Control/FlatTabControl.cs deleted file mode 100644 index 122f3cd..0000000 --- a/src/KFlearning.Control/FlatTabControl.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace KFlearning.Control -{ - public class FlatTabControl : TabControl - { - private StringFormat CenterSF = new StringFormat - {Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center}; - - private Color BGColor = Color.FromArgb(60, 70, 73); - private Color BaseColor = Color.FromArgb(45, 47, 49); - private Color ActiveColor = Color.FromArgb(35, 168, 109); - - public FlatTabControl() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | - ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - BackColor = BGColor; - - Font = new Font("Segoe UI", 10); - SizeMode = TabSizeMode.Fixed; - ItemSize = new Size(120, 40); - } - - #region Overrides - - protected override void CreateHandle() - { - base.CreateHandle(); - Alignment = TabAlignment.Top; - } - - protected override void OnPaint(PaintEventArgs e) - { - using (var bitmap = new Bitmap(Width, Height)) - using (var g = Graphics.FromImage(bitmap)) - { - g.SmoothingMode = SmoothingMode.HighQuality; - g.PixelOffsetMode = PixelOffsetMode.HighQuality; - g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - g.Clear(BaseColor); - - try - { - SelectedTab.BackColor = BGColor; - } - catch - { - // ignore - } - - for (int i = 0; i < TabCount; i++) - { - var tabRect = GetTabRect(i); - var baseRect = new Rectangle(new Point(tabRect.Location.X + 2, tabRect.Location.Y), tabRect.Size); - var baseSize = new Rectangle(baseRect.Location, baseRect.Size); - - g.FillRectangle(new SolidBrush(BaseColor), baseSize); - if (i == SelectedIndex) - { - g.FillRectangle(new SolidBrush(ActiveColor), baseSize); - } - - g.DrawString(TabPages[i].Text, Font, Brushes.White, baseSize, CenterSF); - } - - base.OnPaint(e); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(bitmap, 0, 0); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/KFlearning.Control/KFlearning.Control.csproj b/src/KFlearning.Control/KFlearning.Control.csproj deleted file mode 100644 index 2f7e92f..0000000 --- a/src/KFlearning.Control/KFlearning.Control.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - net45 - Kodesiana - KFlearning - Fahmi Noor Fiqri, Kodesiana - 2.0.1 - https://github.com/fahminlb33/KFlearning - Git - Copyright (C) Fahmi Noor Fiqri, Kodesiana 2020 - https://github.com/fahminlb33/KFlearning/license.md - https://github.com/fahminlb33/KFlearning - x86 - - - DEBUG;TRACE - - - - - - - True - True - AppRes.resx - - - - - ResXFileCodeGenerator - AppRes.Designer.cs - - - \ No newline at end of file