-
Notifications
You must be signed in to change notification settings - Fork 184
Dark theme #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Dark theme #252
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
0516a61
Merge pull request #239 from zarunbal/Development
Hirogen cb39ad4
added credits
Hirogen eab2cf8
update readme
Hirogen b60a6b0
Trying to apply a darker style
jlrouzies-mantu d59bff9
implement dark mode as setting
jlrouzies-mantu 92c3a86
Converting more to dark mode
jlrouzies-mantu 8a95220
Added more menu items
jlrouzies-mantu b0af787
move color mode to config
jlrouzies-mantu d3b758c
Change approach: update colors after initizalize
jlrouzies-mantu 12df0bc
Set title bar dark mode
jlrouzies-mantu f898e2a
improve menus parsing
jlrouzies-mantu 3461957
separate forms extensions and move to correct folder
jlrouzies-mantu c138681
update project file
jlrouzies-mantu a0407db
Apply dark / bright theme based on color palette
jlrouzies-mantu e2e98ea
Apply style to menu in datagrid
jlrouzies-mantu 272fc32
Adjust default line background
jlrouzies-mantu 52052e6
Color dataGrid columns, trying foreground no success
jlrouzies-mantu 0a78ecd
Fixed specific separators
jlrouzies-mantu 9e1ebfd
fix default text color
jlrouzies-mantu ab188a1
Apply theme to tabs menu and bookmarks
jlrouzies-mantu dbc112d
Improve menus hover colors
jlrouzies-mantu c22f57a
Apply style to tabs
jlrouzies-mantu 7855d4b
Rename class
jlrouzies-mantu 8b26241
Fixed menus borders and timeshift background
jlrouzies-mantu 076c103
Moved tab code in region
jlrouzies-mantu 027cd52
fix toolstrip visible border
jlrouzies-mantu a91007d
Apply style to no bookmarks background
jlrouzies-mantu 875c8af
Apply style to more menu strips
jlrouzies-mantu f820fc5
Fixed pro filters alignment and logo for colors
jlrouzies-mantu face6f0
Fix filter textbox background
jlrouzies-mantu 0d0791a
Apply color to bookmark cells
jlrouzies-mantu c70d908
Remove unused new comment code
jlrouzies-mantu 6e88e19
Log error if happens
jlrouzies-mantu adbcd03
Small code cleaning
jlrouzies-mantu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Runtime.InteropServices; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace LogExpert.Config | ||
| { | ||
| public static class ColorMode | ||
| { | ||
| // Bright Theme | ||
| // https://paletton.com/#uid=15-0u0k00sH00kJ0pq+00RL00RL | ||
| private static System.Drawing.Color BrightBookmarkDefaultSystemColor = System.Drawing.SystemColors.Control; // Important: only supports SystemColors | ||
| private static System.Drawing.Color LessBrightBackgroundColor = System.Drawing.Color.FromArgb(208, 205, 206); | ||
| private static System.Drawing.Color BrightBackgroundColor = System.Drawing.Color.FromArgb(221, 221, 221); | ||
| private static System.Drawing.Color BrighterBackgroundColor = System.Drawing.Color.FromArgb(253, 253, 253); | ||
| private static System.Drawing.Color BrightForeColor = System.Drawing.Color.FromArgb(0, 0, 0); | ||
|
|
||
| // Dark Theme | ||
| // https://paletton.com/#uid=15-0u0k005U0670008J003Y003Y | ||
| private static System.Drawing.Color DarkBookmarkDefaultSystemColor = System.Drawing.SystemColors.ControlDarkDark; // Important: only supports SystemColors | ||
| private static System.Drawing.Color LessLessDarkBackgroundColor = System.Drawing.Color.FromArgb(90, 90, 90); | ||
| private static System.Drawing.Color LessDarkBackgroundColor = System.Drawing.Color.FromArgb(67, 67, 67); | ||
| private static System.Drawing.Color DarkBackgroundColor = System.Drawing.Color.FromArgb(45, 45, 45); | ||
| private static System.Drawing.Color DarkerBackgroundColor = System.Drawing.Color.FromArgb(30, 30, 30); | ||
| private static System.Drawing.Color DarkForeColor = System.Drawing.Color.FromArgb(255, 255, 255); | ||
|
|
||
| // Default | ||
| public static System.Drawing.Color BackgroundColor = LessBrightBackgroundColor; | ||
| public static System.Drawing.Color DockBackgroundColor = BrighterBackgroundColor; | ||
| public static System.Drawing.Color BookmarksDefaultBackgroundColor = BrightBookmarkDefaultSystemColor; | ||
| public static System.Drawing.Color ForeColor = BrightForeColor; | ||
| public static System.Drawing.Color MenuBackgroundColor = BrighterBackgroundColor; | ||
| public static System.Drawing.Color HoverMenuBackgroundColor = LessBrightBackgroundColor; | ||
| public static System.Drawing.Color ActiveTabColor = BrighterBackgroundColor; | ||
| public static System.Drawing.Color InactiveTabColor = LessBrightBackgroundColor; | ||
| public static System.Drawing.Color TabsBackgroundStripColor = LessBrightBackgroundColor; | ||
|
|
||
|
|
||
| public static bool DarkModeEnabled = false; | ||
|
|
||
| public static void LoadColorMode() | ||
| { | ||
| var preferences = Config.ConfigManager.Settings.preferences; | ||
|
|
||
| if (preferences.darkMode) | ||
| { | ||
| SetDarkMode(); | ||
| } | ||
| else | ||
| { | ||
| SetBrightMode(); | ||
| } | ||
| } | ||
|
|
||
| private static void SetDarkMode() | ||
| { | ||
| BackgroundColor = DarkBackgroundColor; | ||
| ForeColor = DarkForeColor; | ||
| MenuBackgroundColor = DarkerBackgroundColor; | ||
| DockBackgroundColor = LessDarkBackgroundColor; | ||
| HoverMenuBackgroundColor = LessDarkBackgroundColor; | ||
| BookmarksDefaultBackgroundColor = DarkBookmarkDefaultSystemColor; | ||
| TabsBackgroundStripColor = LessDarkBackgroundColor; | ||
| ActiveTabColor = LessLessDarkBackgroundColor; | ||
| InactiveTabColor = LessDarkBackgroundColor; | ||
| DarkModeEnabled = true; | ||
| } | ||
|
|
||
| private static void SetBrightMode() | ||
| { | ||
| BackgroundColor = BrightBackgroundColor; | ||
| ForeColor = BrightForeColor; | ||
| MenuBackgroundColor = BrighterBackgroundColor; | ||
| DockBackgroundColor = BrighterBackgroundColor; | ||
| BookmarksDefaultBackgroundColor = BrightBookmarkDefaultSystemColor; | ||
| HoverMenuBackgroundColor = LessBrightBackgroundColor; | ||
| TabsBackgroundStripColor = BrighterBackgroundColor; | ||
| ActiveTabColor = BrighterBackgroundColor; | ||
| InactiveTabColor = LessBrightBackgroundColor; | ||
| DarkModeEnabled = false; | ||
| } | ||
|
|
||
| #region TitleBarDarkMode | ||
| [DllImport("dwmapi.dll")] | ||
| private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize); | ||
|
|
||
| private const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19; | ||
| private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20; | ||
|
|
||
| public static bool UseImmersiveDarkMode(IntPtr handle, bool enabled) | ||
| { | ||
|
|
||
| var attribute = DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1; | ||
| if (IsWindows10OrGreater(18985)) | ||
| { | ||
| attribute = DWMWA_USE_IMMERSIVE_DARK_MODE; | ||
| } | ||
|
|
||
| int useImmersiveDarkMode = enabled ? 1 : 0; | ||
| return DwmSetWindowAttribute(handle, (int)attribute, ref useImmersiveDarkMode, sizeof(int)) == 0; | ||
|
|
||
| } | ||
|
|
||
| private static bool IsWindows10OrGreater(int build = -1) | ||
| { | ||
| return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= build; | ||
| } | ||
|
|
||
| #endregion TitleBarDarkMode | ||
|
|
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.