[Feature] Dark mode (#21), version 1.0.15.0

This commit is contained in:
Markus Hofknecht 2020-08-07 15:24:25 +02:00
parent de4fb95df3
commit 274682d26e
13 changed files with 287 additions and 125 deletions

View file

@ -633,7 +633,6 @@ namespace SystemTrayMenu.Business
if (IsActive() &&
menus[0].IsUsable)
{
menus[0].SetTitleColorActive();
AsList.ForEach(m => m.ShowWithFade());
timerStillActiveCheck.Start();
}

View file

@ -9,11 +9,20 @@ namespace SystemTrayMenu
internal static class AppColors
{
internal static readonly Color Blue = Color.FromArgb(204, 232, 255);
internal static readonly Color DarkModeBlue = Color.FromArgb(51, 51, 51);
internal static readonly Color BlueBorder = Color.FromArgb(153, 209, 255);
internal static readonly Color DarkModeBlueBorder = Color.FromArgb(20, 29, 75);
internal static readonly Color Green = Color.FromArgb(194, 245, 222);
internal static readonly Color DarkModeGreen = Color.FromArgb(20, 65, 42);
internal static readonly Color GreenBorder = Color.FromArgb(153, 255, 165);
internal static readonly Color DarkModeGreenBorder = Color.FromArgb(20, 75, 85);
internal static readonly Color Red = Color.FromArgb(255, 204, 232);
internal static readonly Color Yellow = Color.LightYellow;
internal static readonly Color DarkModeRed = Color.FromArgb(75, 24, 52);
internal static readonly Color Azure = Color.Azure;
internal static readonly Color DarkModeAzure = DarkModeBackColor1;
internal static readonly Color DarkModeBackColor3 = Color.FromArgb(25, 25, 25);
internal static readonly Color DarkModeBackColor2 = Color.FromArgb(32, 32, 32);
internal static readonly Color DarkModeBackColor1 = Color.FromArgb(43, 43, 43);
}
}

View file

@ -8,6 +8,7 @@ namespace SystemTrayMenu
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using Microsoft.Win32;
using SystemTrayMenu.UserInterface.FolderBrowseDialog;
using SystemTrayMenu.Utilities;
@ -15,6 +16,9 @@ namespace SystemTrayMenu
{
public const string Language = "en";
private static bool readDarkModeDone = false;
private static bool isDarkModeFromFirstCall = false;
public static string Path => Properties.Settings.Default.PathDirectory;
public static void UpgradeIfNotUpgraded()
@ -95,5 +99,37 @@ namespace SystemTrayMenu
Process.Start(browserPath, "https://github.com/Hofknecht/SystemTrayMenu#FAQ");
}
}
internal static bool IsDarkMode()
{
bool isDarkMode = false;
if (readDarkModeDone)
{
isDarkMode = isDarkModeFromFirstCall;
}
else
{
if (Properties.Settings.Default.IsDarkModeAlwaysOn || IsDarkModeActive())
{
isDarkModeFromFirstCall = true;
isDarkMode = true;
}
readDarkModeDone = true;
}
return isDarkMode;
}
/// <summary>
/// Read the OS setting whether dark mode is enabled.
/// </summary>
/// <returns>true = Dark mode; false = Light mode.</returns>
private static bool IsDarkModeActive()
{
// Check: AppsUseLightTheme (REG_DWORD)
// 0 = Dark mode, 1 = Light mode
return Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme", 1).ToString() == "0";
}
}
}

View file

@ -15,12 +15,110 @@ namespace SystemTrayMenu
internal const float MaxMenuWidth = 300;
internal static readonly Color File = Color.White;
internal static readonly Color Folder = Color.White;
internal static readonly Color ColorSelectedItem = AppColors.Blue;
internal static readonly Color ColorSelectedItemBorder = AppColors.BlueBorder;
internal static readonly Color ColorOpenFolder = AppColors.Green;
internal static readonly Color ColorOpenFolderBorder = AppColors.GreenBorder;
internal static readonly Color ColorTitleWarning = AppColors.Red;
internal static readonly Color ColorTitleSelected = AppColors.Yellow;
internal static readonly Color ColorTitleBackground = AppColors.Azure;
public static Color ColorSelectedItem
{
get
{
if (Config.IsDarkMode())
{
return AppColors.DarkModeBlue;
}
else
{
return AppColors.Blue;
}
}
}
public static Color ColorSelectedItemBorder
{
get
{
if (Config.IsDarkMode())
{
return AppColors.DarkModeBlueBorder;
}
else
{
return AppColors.BlueBorder;
}
}
}
public static Color ColorOpenFolder
{
get
{
if (Config.IsDarkMode())
{
return AppColors.DarkModeGreen;
}
else
{
return AppColors.Green;
}
}
}
public static Color ColorOpenFolderBorder
{
get
{
if (Config.IsDarkMode())
{
return AppColors.DarkModeGreenBorder;
}
else
{
return AppColors.GreenBorder;
}
}
}
public static Color ColorTitleWarning
{
get
{
if (Config.IsDarkMode())
{
return AppColors.DarkModeRed;
}
else
{
return AppColors.Red;
}
}
}
public static Color ColorTitleSelected
{
get
{
if (Config.IsDarkMode())
{
return AppColors.DarkModeBlue;
}
else
{
return AppColors.Blue;
}
}
}
public static Color ColorTitleBackground
{
get
{
if (Config.IsDarkMode())
{
return AppColors.DarkModeAzure;
}
else
{
return AppColors.Azure;
}
}
}
}
}

View file

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.14.4")]
[assembly: AssemblyFileVersion("1.0.14.4")]
[assembly: AssemblyVersion("1.0.15.0")]
[assembly: AssemblyFileVersion("1.0.15.0")]

View file

@ -111,5 +111,17 @@ namespace SystemTrayMenu.Properties {
this["OpenItemWithOneClick"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool IsDarkModeAlwaysOn {
get {
return ((bool)(this["IsDarkModeAlwaysOn"]));
}
set {
this["IsDarkModeAlwaysOn"] = value;
}
}
}
}

View file

@ -23,5 +23,8 @@
<Setting Name="OpenItemWithOneClick" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="IsDarkModeAlwaysOn" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -123,6 +123,15 @@ namespace SystemTrayMenu.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Dark Mode always active.
/// </summary>
internal static string Dark_Mode_always_active {
get {
return ResourceManager.GetString("Dark Mode always active", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Exit.
/// </summary>

View file

@ -204,4 +204,7 @@
<data name="Single click to start item" xml:space="preserve">
<value>Öffnen durch einfachen Klick</value>
</data>
<data name="Dark Mode always active" xml:space="preserve">
<value>Dark Mode immer aktiv</value>
</data>
</root>

View file

@ -204,4 +204,7 @@
<data name="Single click to start item" xml:space="preserve">
<value>Single-click to open an item</value>
</data>
<data name="Dark Mode always active" xml:space="preserve">
<value>Dark Mode always active</value>
</data>
</root>

View file

@ -11,6 +11,7 @@ namespace SystemTrayMenu.UserInterface
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using Microsoft.Win32;
using SystemTrayMenu.DataClasses;
using SystemTrayMenu.DllImports;
using SystemTrayMenu.Utilities;
@ -58,7 +59,6 @@ namespace SystemTrayMenu.UserInterface
textBoxSearch.Focus();
NativeMethods.User32ShowInactiveTopmost(this);
NativeMethods.ForceForegroundWindow(Handle);
SetTitleColorActive();
}
}
else
@ -81,10 +81,29 @@ namespace SystemTrayMenu.UserInterface
SetDoubleBuffer(dgv, true);
Color foreColor = Color.Black;
Color backColor = Color.White;
if (Config.IsDarkMode())
{
foreColor = Color.White;
labelTitle.ForeColor = foreColor;
labelTitle.BackColor = AppColors.DarkModeBackColor1;
backColor = AppColors.DarkModeBackColor2;
tableLayoutPanel.BackColor = backColor;
dgv.BackgroundColor = backColor;
textBoxSearch.ForeColor = foreColor;
textBoxSearch.BackColor = AppColors.DarkModeBackColor3;
pictureBoxSearch.BackColor = AppColors.DarkModeBackColor3;
tableLayoutPanelSearch.BackColor = AppColors.DarkModeBackColor3;
}
DataGridViewCellStyle dgvCellStyle = new DataGridViewCellStyle
{
SelectionBackColor = MenuDefines.ColorSelectedItem,
SelectionForeColor = Color.Black,
SelectionForeColor = foreColor,
ForeColor = foreColor,
BackColor = backColor,
};
dgv.DefaultCellStyle = dgvCellStyle;
@ -378,11 +397,6 @@ namespace SystemTrayMenu.UserInterface
Location = new Point(x, y);
}
internal void SetTitleColorActive()
{
labelTitle.ForeColor = Color.Black;
}
internal void KeyPressedSearch(string letter)
{
textBoxSearch.Text += letter;

View file

@ -53,20 +53,19 @@ namespace SystemTrayMenu.UserInterface
this.buttonOk = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.tabPageExpert = new System.Windows.Forms.TabPage();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.labelHideTaskbarForm = new System.Windows.Forms.Label();
this.labelOpenItemWithOneClick = new System.Windows.Forms.Label();
this.tableLayoutPanelExpert = new System.Windows.Forms.TableLayoutPanel();
this.checkBoxOpenItemWithOneClick = new System.Windows.Forms.CheckBox();
this.checkBoxHideTaskbarForm = new System.Windows.Forms.CheckBox();
this.checkBoxDarkModeAlwaysOn = new System.Windows.Forms.CheckBox();
this.tableLayoutPanelMain.SuspendLayout();
this.tabControlExpert.SuspendLayout();
this.tabPageGeneral.SuspendLayout();
this.tableLayoutPanelGeneral.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.tableLayoutPanelBottom.SuspendLayout();
this.tabPageExpert.SuspendLayout();
this.tableLayoutPanel6.SuspendLayout();
this.tableLayoutPanelExpert.SuspendLayout();
this.tableLayoutPanelBottom.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanelMain
@ -85,12 +84,12 @@ namespace SystemTrayMenu.UserInterface
this.tableLayoutPanelMain.Size = new System.Drawing.Size(401, 275);
this.tableLayoutPanelMain.TabIndex = 0;
//
// tabControl1
// tabControlExpert
//
this.tabControlExpert.Controls.Add(this.tabPageGeneral);
this.tabControlExpert.Controls.Add(this.tabPageExpert);
this.tabControlExpert.Location = new System.Drawing.Point(3, 3);
this.tabControlExpert.Name = "tabControl1";
this.tabControlExpert.Name = "tabControlExpert";
this.tabControlExpert.SelectedIndex = 0;
this.tabControlExpert.Size = new System.Drawing.Size(395, 240);
this.tabControlExpert.TabIndex = 0;
@ -328,6 +327,61 @@ namespace SystemTrayMenu.UserInterface
this.tableLayoutPanel2.Size = new System.Drawing.Size(100, 0);
this.tableLayoutPanel2.TabIndex = 0;
//
// tabPageExpert
//
this.tabPageExpert.Controls.Add(this.tableLayoutPanelExpert);
this.tabPageExpert.Location = new System.Drawing.Point(4, 22);
this.tabPageExpert.Name = "tabPageExpert";
this.tabPageExpert.Size = new System.Drawing.Size(387, 214);
this.tabPageExpert.TabIndex = 1;
this.tabPageExpert.Text = "tabPageExpert";
this.tabPageExpert.UseVisualStyleBackColor = true;
//
// tableLayoutPanelExpert
//
this.tableLayoutPanelExpert.AutoSize = true;
this.tableLayoutPanelExpert.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanelExpert.ColumnCount = 3;
this.tableLayoutPanelExpert.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelExpert.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelExpert.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 12F));
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxDarkModeAlwaysOn, 0, 2);
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxOpenItemWithOneClick, 0, 1);
this.tableLayoutPanelExpert.Controls.Add(this.checkBoxHideTaskbarForm, 0, 0);
this.tableLayoutPanelExpert.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanelExpert.Name = "tableLayoutPanelExpert";
this.tableLayoutPanelExpert.RowCount = 4;
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelExpert.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanelExpert.Size = new System.Drawing.Size(215, 112);
this.tableLayoutPanelExpert.TabIndex = 1;
//
// checkBoxOpenItemWithOneClick
//
this.checkBoxOpenItemWithOneClick.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBoxOpenItemWithOneClick.AutoSize = true;
this.checkBoxOpenItemWithOneClick.Location = new System.Drawing.Point(9, 31);
this.checkBoxOpenItemWithOneClick.Margin = new System.Windows.Forms.Padding(9, 7, 9, 0);
this.checkBoxOpenItemWithOneClick.Name = "checkBoxOpenItemWithOneClick";
this.checkBoxOpenItemWithOneClick.Size = new System.Drawing.Size(185, 17);
this.checkBoxOpenItemWithOneClick.TabIndex = 106;
this.checkBoxOpenItemWithOneClick.Text = "checkBoxOpenItemWithOneClick";
this.checkBoxOpenItemWithOneClick.UseVisualStyleBackColor = true;
//
// checkBoxHideTaskbarForm
//
this.checkBoxHideTaskbarForm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBoxHideTaskbarForm.AutoSize = true;
this.checkBoxHideTaskbarForm.Location = new System.Drawing.Point(9, 7);
this.checkBoxHideTaskbarForm.Margin = new System.Windows.Forms.Padding(9, 7, 9, 0);
this.checkBoxHideTaskbarForm.Name = "checkBoxHideTaskbarForm";
this.checkBoxHideTaskbarForm.Size = new System.Drawing.Size(185, 17);
this.checkBoxHideTaskbarForm.TabIndex = 107;
this.checkBoxHideTaskbarForm.Text = "checkBoxShowTaskbarForm";
this.checkBoxHideTaskbarForm.UseVisualStyleBackColor = true;
//
// tableLayoutPanelBottom
//
this.tableLayoutPanelBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
@ -376,84 +430,17 @@ namespace SystemTrayMenu.UserInterface
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
//
// tabPageExpert
// checkBoxDarkModeAlwaysOn
//
this.tabPageExpert.Controls.Add(this.tableLayoutPanel6);
this.tabPageExpert.Location = new System.Drawing.Point(4, 22);
this.tabPageExpert.Name = "tabPageExpert";
this.tabPageExpert.Size = new System.Drawing.Size(387, 214);
this.tabPageExpert.TabIndex = 1;
this.tabPageExpert.Text = "tabPageExpert";
this.tabPageExpert.UseVisualStyleBackColor = true;
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.AutoSize = true;
this.tableLayoutPanel6.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanel6.ColumnCount = 3;
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 12F));
this.tableLayoutPanel6.Controls.Add(this.labelHideTaskbarForm, 0, 0);
this.tableLayoutPanel6.Controls.Add(this.labelOpenItemWithOneClick, 0, 1);
this.tableLayoutPanel6.Controls.Add(this.checkBoxOpenItemWithOneClick, 1, 1);
this.tableLayoutPanel6.Controls.Add(this.checkBoxHideTaskbarForm, 1, 0);
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 3;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(361, 88);
this.tableLayoutPanel6.TabIndex = 1;
//
// labelShowTaskbarForm
//
this.labelHideTaskbarForm.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.labelHideTaskbarForm.AutoSize = true;
this.labelHideTaskbarForm.Location = new System.Drawing.Point(3, 5);
this.labelHideTaskbarForm.Name = "labelShowTaskbarForm";
this.labelHideTaskbarForm.Size = new System.Drawing.Size(118, 13);
this.labelHideTaskbarForm.TabIndex = 104;
this.labelHideTaskbarForm.Text = "labelShowTaskbarForm";
//
// labelOpenItemWithOneClick
//
this.labelOpenItemWithOneClick.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.labelOpenItemWithOneClick.AutoSize = true;
this.labelOpenItemWithOneClick.Location = new System.Drawing.Point(3, 29);
this.labelOpenItemWithOneClick.Name = "labelOpenItemWithOneClick";
this.labelOpenItemWithOneClick.Size = new System.Drawing.Size(140, 13);
this.labelOpenItemWithOneClick.TabIndex = 105;
this.labelOpenItemWithOneClick.Text = "labelOpenItemWithOneClick";
//
// checkBoxOpenItemWithOneClick
//
this.checkBoxOpenItemWithOneClick.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBoxOpenItemWithOneClick.AutoSize = true;
this.checkBoxOpenItemWithOneClick.Location = new System.Drawing.Point(155, 31);
this.checkBoxOpenItemWithOneClick.Margin = new System.Windows.Forms.Padding(9, 7, 9, 0);
this.checkBoxOpenItemWithOneClick.Name = "checkBoxOpenItemWithOneClick";
this.checkBoxOpenItemWithOneClick.Size = new System.Drawing.Size(185, 17);
this.checkBoxOpenItemWithOneClick.TabIndex = 106;
this.checkBoxOpenItemWithOneClick.Text = "checkBoxOpenItemWithOneClick";
this.checkBoxOpenItemWithOneClick.UseVisualStyleBackColor = true;
//
// checkBoxShowTaskbarForm
//
this.checkBoxHideTaskbarForm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBoxHideTaskbarForm.AutoSize = true;
this.checkBoxHideTaskbarForm.Location = new System.Drawing.Point(155, 7);
this.checkBoxHideTaskbarForm.Margin = new System.Windows.Forms.Padding(9, 7, 9, 0);
this.checkBoxHideTaskbarForm.Name = "checkBoxShowTaskbarForm";
this.checkBoxHideTaskbarForm.Size = new System.Drawing.Size(185, 17);
this.checkBoxHideTaskbarForm.TabIndex = 107;
this.checkBoxHideTaskbarForm.Text = "checkBoxShowTaskbarForm";
this.checkBoxHideTaskbarForm.UseVisualStyleBackColor = true;
this.checkBoxDarkModeAlwaysOn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBoxDarkModeAlwaysOn.AutoSize = true;
this.checkBoxDarkModeAlwaysOn.Location = new System.Drawing.Point(9, 55);
this.checkBoxDarkModeAlwaysOn.Margin = new System.Windows.Forms.Padding(9, 7, 9, 0);
this.checkBoxDarkModeAlwaysOn.Name = "checkBoxDarkModeAlwaysOn";
this.checkBoxDarkModeAlwaysOn.Size = new System.Drawing.Size(185, 17);
this.checkBoxDarkModeAlwaysOn.TabIndex = 108;
this.checkBoxDarkModeAlwaysOn.Text = "checkBoxDarkModeAlwaysOn";
this.checkBoxDarkModeAlwaysOn.UseVisualStyleBackColor = true;
//
// SettingsForm
//
@ -482,12 +469,12 @@ namespace SystemTrayMenu.UserInterface
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel5.ResumeLayout(false);
this.tableLayoutPanel5.PerformLayout();
this.tableLayoutPanelBottom.ResumeLayout(false);
this.tableLayoutPanelBottom.PerformLayout();
this.tabPageExpert.ResumeLayout(false);
this.tabPageExpert.PerformLayout();
this.tableLayoutPanel6.ResumeLayout(false);
this.tableLayoutPanel6.PerformLayout();
this.tableLayoutPanelExpert.ResumeLayout(false);
this.tableLayoutPanelExpert.PerformLayout();
this.tableLayoutPanelBottom.ResumeLayout(false);
this.tableLayoutPanelBottom.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -518,10 +505,9 @@ namespace SystemTrayMenu.UserInterface
private System.Windows.Forms.Label labelHotkey;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelGeneral;
private System.Windows.Forms.TabPage tabPageExpert;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.Label labelHideTaskbarForm;
private System.Windows.Forms.Label labelOpenItemWithOneClick;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelExpert;
private System.Windows.Forms.CheckBox checkBoxOpenItemWithOneClick;
private System.Windows.Forms.CheckBox checkBoxHideTaskbarForm;
private System.Windows.Forms.CheckBox checkBoxDarkModeAlwaysOn;
}
}

View file

@ -35,10 +35,9 @@ namespace SystemTrayMenu.UserInterface
checkBoxAutostart.Text = Translator.GetText("Launch on startup");
labelHotkey.Text = Translator.GetText("Hotkey");
labelLanguage.Text = Translator.GetText("Language");
labelHideTaskbarForm.Text = string.Empty;
checkBoxHideTaskbarForm.Text = Translator.GetText("Hide Taskbar Icon");
labelOpenItemWithOneClick.Text = string.Empty;
checkBoxOpenItemWithOneClick.Text = Translator.GetText("Single click to start item");
checkBoxDarkModeAlwaysOn.Text = Translator.GetText("Dark Mode always active");
buttonOk.Text = Translator.GetText("buttonOk");
buttonCancel.Text = Translator.GetText("buttonCancel");
}
@ -81,19 +80,9 @@ namespace SystemTrayMenu.UserInterface
}
}
InitializeHideTaskbarForm();
void InitializeHideTaskbarForm()
{
checkBoxHideTaskbarForm.Checked =
Properties.Settings.Default.HideTaskbarForm;
}
InitializeOpenItemWithOneClick();
void InitializeOpenItemWithOneClick()
{
checkBoxOpenItemWithOneClick.Checked =
Properties.Settings.Default.OpenItemWithOneClick;
}
checkBoxHideTaskbarForm.Checked = Properties.Settings.Default.HideTaskbarForm;
checkBoxOpenItemWithOneClick.Checked = Properties.Settings.Default.OpenItemWithOneClick;
checkBoxDarkModeAlwaysOn.Checked = Properties.Settings.Default.IsDarkModeAlwaysOn;
}
public string NewHotKey => newHotKey;
@ -309,6 +298,7 @@ namespace SystemTrayMenu.UserInterface
{
Properties.Settings.Default.HideTaskbarForm = checkBoxHideTaskbarForm.Checked;
Properties.Settings.Default.OpenItemWithOneClick = checkBoxOpenItemWithOneClick.Checked;
Properties.Settings.Default.IsDarkModeAlwaysOn = checkBoxDarkModeAlwaysOn.Checked;
}
private void ButtonCancel_Click(object sender, EventArgs e)