Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0516a61
Merge pull request #239 from zarunbal/Development
Hirogen Jul 20, 2022
cb39ad4
added credits
Hirogen Jul 20, 2022
eab2cf8
update readme
Hirogen Jul 20, 2022
b60a6b0
Trying to apply a darker style
jlrouzies-mantu Jul 26, 2022
d59bff9
implement dark mode as setting
jlrouzies-mantu Jul 26, 2022
92c3a86
Converting more to dark mode
jlrouzies-mantu Jul 26, 2022
8a95220
Added more menu items
jlrouzies-mantu Jul 26, 2022
b0af787
move color mode to config
jlrouzies-mantu Jul 26, 2022
d3b758c
Change approach: update colors after initizalize
jlrouzies-mantu Jul 26, 2022
12df0bc
Set title bar dark mode
jlrouzies-mantu Jul 26, 2022
f898e2a
improve menus parsing
jlrouzies-mantu Jul 26, 2022
3461957
separate forms extensions and move to correct folder
jlrouzies-mantu Jul 26, 2022
c138681
update project file
jlrouzies-mantu Jul 26, 2022
a0407db
Apply dark / bright theme based on color palette
jlrouzies-mantu Jul 26, 2022
e2e98ea
Apply style to menu in datagrid
jlrouzies-mantu Jul 26, 2022
272fc32
Adjust default line background
jlrouzies-mantu Jul 26, 2022
52052e6
Color dataGrid columns, trying foreground no success
jlrouzies-mantu Jul 26, 2022
0a78ecd
Fixed specific separators
jlrouzies-mantu Jul 26, 2022
9e1ebfd
fix default text color
jlrouzies-mantu Jul 27, 2022
ab188a1
Apply theme to tabs menu and bookmarks
jlrouzies-mantu Jul 27, 2022
dbc112d
Improve menus hover colors
jlrouzies-mantu Jul 27, 2022
c22f57a
Apply style to tabs
jlrouzies-mantu Jul 27, 2022
7855d4b
Rename class
jlrouzies-mantu Jul 27, 2022
8b26241
Fixed menus borders and timeshift background
jlrouzies-mantu Jul 27, 2022
076c103
Moved tab code in region
jlrouzies-mantu Jul 27, 2022
027cd52
fix toolstrip visible border
jlrouzies-mantu Jul 27, 2022
a91007d
Apply style to no bookmarks background
jlrouzies-mantu Jul 27, 2022
875c8af
Apply style to more menu strips
jlrouzies-mantu Jul 27, 2022
f820fc5
Fixed pro filters alignment and logo for colors
jlrouzies-mantu Jul 27, 2022
face6f0
Fix filter textbox background
jlrouzies-mantu Jul 27, 2022
0d0791a
Apply color to bookmark cells
jlrouzies-mantu Jul 27, 2022
c70d908
Remove unused new comment code
jlrouzies-mantu Jul 28, 2022
6e88e19
Log error if happens
jlrouzies-mantu Jul 28, 2022
adbcd03
Small code cleaning
jlrouzies-mantu Jul 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change approach: update colors after initizalize
  • Loading branch information
jlrouzies-mantu committed Jul 26, 2022
commit d3b758cfd3ae075cb2052a2282bb304de2e4e322
38 changes: 38 additions & 0 deletions src/LogExpert/Config/ExtendedToolStripSeparator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LogExpert.Config
{
public class ExtendedToolStripSeparator : ToolStripSeparator
{
public ExtendedToolStripSeparator()
{
this.Paint += ExtendedToolStripSeparator_Paint;
}

private void ExtendedToolStripSeparator_Paint(object sender, PaintEventArgs e)
{
// Get the separator's width and height.
ToolStripSeparator toolStripSeparator = (ToolStripSeparator)sender;
int width = toolStripSeparator.Width;
int height = toolStripSeparator.Height;

// Choose the colors for drawing.
// I've used Color.White as the foreColor.
Color foreColor = Color.FromName(Config.ColorMode.foreColor.Name);
// Color.Teal as the backColor.
Color backColor = Color.FromName(Config.ColorMode.backgroundColor.Name);

// Fill the background.
e.Graphics.FillRectangle(new SolidBrush(backColor), 0, 0, width, height);

// Draw the line.
e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2);
}
}
}
66 changes: 57 additions & 9 deletions src/LogExpert/Controls/LogTabWindow/LogTabWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public partial class LogTabWindow : Form
public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNumbers)
{
InitializeComponent();

ChangeTheme(this.Controls);

_startupFileNames = fileNames;
this._instanceNumber = instanceNumber;
this._showInstanceNumbers = showInstanceNumbers;
Expand All @@ -83,7 +86,7 @@ public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNum
HilightGroupList = ConfigManager.Settings.hilightGroupList;

Rectangle led = new Rectangle(0, 0, 8, 2);

for (int i = 0; i < _leds.Length; ++i)
{
_leds[i] = led;
Expand All @@ -97,27 +100,27 @@ public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNum
_ledBrushes[2] = new SolidBrush(Color.FromArgb(255, 0, 220, 0));
_ledBrushes[3] = new SolidBrush(Color.FromArgb(255, 0, 220, 0));
_ledBrushes[4] = new SolidBrush(Color.FromArgb(255, 0, 220, 0));

_offLedBrush = new SolidBrush(Color.FromArgb(grayAlpha, 160, 160, 160));

_dirtyLedBrush = new SolidBrush(Color.FromArgb(255, 220, 0, 00));

_tailLedBrush[0] = new SolidBrush(Color.FromArgb(255, 50, 100, 250)); // Follow tail: blue-ish
_tailLedBrush[1] = new SolidBrush(Color.FromArgb(grayAlpha, 160, 160, 160)); // Don't follow tail: gray
_tailLedBrush[2] = new SolidBrush(Color.FromArgb(255, 220, 220, 0)); // Stop follow tail (trigger): yellow-ish

_syncLedBrush = new SolidBrush(Color.FromArgb(255, 250, 145, 30));

CreateIcons();

_tabStringFormat.LineAlignment = StringAlignment.Center;
_tabStringFormat.Alignment = StringAlignment.Near;

ToolStripControlHost host = new ToolStripControlHost(checkBoxFollowTail);

host.Padding = new Padding(20, 0, 0, 0);
host.BackColor = Color.FromKnownColor(KnownColor.Transparent);

int index = buttonToolStrip.Items.IndexOfKey("toolStripButtonTail");

toolStripEncodingASCIIItem.Text = Encoding.ASCII.HeaderName;
Expand Down Expand Up @@ -151,6 +154,51 @@ public LogTabWindow(string[] fileNames, int instanceNumber, bool showInstanceNum

#endregion

#region ColorTheme
public void ChangeTheme(Control.ControlCollection container)
{

foreach (Control component in container)
{
if (component is MenuStrip)
{
var menu = (MenuStrip)component;

foreach (ToolStripMenuItem item in menu.Items)
{
item.ForeColor = LogExpert.Config.ColorMode.foreColor;
item.BackColor = LogExpert.Config.ColorMode.backgroundColor;

try
{
foreach (dynamic children in item.DropDownItems)
{
children.ForeColor = LogExpert.Config.ColorMode.foreColor;
children.BackColor = LogExpert.Config.ColorMode.backgroundColor;
}
}
catch
{
// Ignore
}
}
}

if (component.Controls != null && component.Controls.Count > 0)
{
ChangeTheme(component.Controls);
component.BackColor = LogExpert.Config.ColorMode.backgroundColor;
component.ForeColor = LogExpert.Config.ColorMode.foreColor;
}
else
{
component.BackColor = LogExpert.Config.ColorMode.backgroundColor;
component.ForeColor = LogExpert.Config.ColorMode.foreColor;
}
}
}
#endregion

#region Delegates

private delegate void AddFileTabsDelegate(string[] fileNames);
Expand Down
Loading