Merge pull request #692 from mRemoteNG/pr/671

Pr/671 fixes
This commit is contained in:
Sean Kaim
2017-09-05 10:02:10 -07:00
committed by GitHub
43 changed files with 472 additions and 625 deletions

View File

@@ -5,7 +5,6 @@ using WeifenLuo.WinFormsUI.Docking;
using mRemoteNG.App;
using System.Threading;
using System.Globalization;
using mRemoteNG.Themes;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.App.Info;
using mRemoteNG.Messages;

View File

@@ -19,7 +19,7 @@ namespace mRemoteNG {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Language {

View File

@@ -2591,4 +2591,5 @@ This page will walk you through the process of upgrading your connections file o
</data>
<data name="strOptionsThemeErrorNoThemes" xml:space="preserve">
<value>No themes are loaded, check that the default mremoteNG themes exist in the slash themes folder</value>
</data>
</root>

View File

@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace mRemoteNG.Themes
{
@@ -19,7 +16,7 @@ namespace mRemoteNG.Themes
key = _key;
value = _value;
}
public String Key
public string Key
{
get
{
@@ -51,8 +48,8 @@ namespace mRemoteNG.Themes
{
#region Private Variables
//Collection for color values that are not loaded by dock panels (list, buttons,panel content, etc)
private Dictionary<String, Color> _extendedColors;
private Dictionary<String, Color> _default;
private Dictionary<string, Color> _extendedColors;
private Dictionary<string, Color> _default;
#endregion
#region Constructors
@@ -77,25 +74,20 @@ namespace mRemoteNG.Themes
/// </summary>
/// <param name="colorKey"></param>
/// <returns></returns>
public Color getColor(String colorKey)
public Color getColor(string colorKey)
{
Color retColor= Color.Empty;
retColor = _extendedColors.ContainsKey(colorKey) ? _extendedColors[colorKey]:Color.Empty;
var retColor = _extendedColors.ContainsKey(colorKey) ? _extendedColors[colorKey]:Color.Empty;
//Invisible colors are not good, might indicate missing color from the palette as is represented by 00000000
if(retColor == Color.Empty || retColor.A == 0)
if (retColor != Color.Empty && retColor.A != 0) return retColor;
if(_default != null)
{
if(_default != null)
{
retColor = _default.ContainsKey(colorKey) ? _default[colorKey] : Color.Empty;
}
//why are we here?, just avoid a crash
if(retColor == Color.Empty)
{
//Fail to pink , because why not
retColor = Color.Pink;
}
retColor = _default.ContainsKey(colorKey) ? _default[colorKey] : Color.Empty;
}
//why are we here?, just avoid a crash
if(retColor == Color.Empty)
{
//Fail to pink , because why not
retColor = Color.Pink;
}
return retColor;
@@ -122,7 +114,7 @@ namespace mRemoteNG.Themes
_extendedColors[colorKey]= inColor;
}
public Dictionary<String, Color> DefaultColorPalette
public Dictionary<string, Color> DefaultColorPalette
{
get
{
@@ -135,7 +127,7 @@ namespace mRemoteNG.Themes
}
public Dictionary<String, Color> ExtColorPalette
public Dictionary<string, Color> ExtColorPalette
{
get
{

View File

@@ -1,16 +1,8 @@
using mRemoteNG.Themes;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Collections;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Resources;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace mRemoteNG.Themes
{
@@ -35,16 +27,17 @@ namespace mRemoteNG.Themes
//Load the colors for the mRemoteNG own components as Dockpanel only have a menus and docks palette
public ExtendedColorPalette getColors()
{
ExtendedColorPalette newPalette = new ExtendedColorPalette();
var newPalette = new ExtendedColorPalette();
newPalette.setDefault(_defaultPalette);
ResourceSet resourceSet = mRemoteNG.ColorMapTheme.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
var resourceSet = ColorMapTheme.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
//
foreach (DictionaryEntry entry in resourceSet)
{
string colorName = entry.Key.ToString();
String xmlQueryPath = (String)entry.Value;
XmlNodeList colorNodeList = _xml.DocumentElement.FirstChild.SelectNodes(xmlQueryPath);
String color = colorNodeList.Count > 0 ? colorNodeList[0].Value : null;
var colorName = entry.Key.ToString();
var xmlQueryPath = (string)entry.Value;
if (_xml.DocumentElement == null) continue;
var colorNodeList = _xml.DocumentElement.FirstChild.SelectNodes(xmlQueryPath);
var color = colorNodeList != null && colorNodeList.Count > 0 ? colorNodeList[0].Value : null;
if (color != null )
{
newPalette.addColor(colorName , ColorTranslator.FromHtml($"#{color}"));
@@ -62,23 +55,20 @@ namespace mRemoteNG.Themes
/// <returns></returns>
public byte[] mergePalette(ExtendedColorPalette colorPalette)
{
ResourceSet resourceSet = mRemoteNG.ColorMapTheme.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
var resourceSet = ColorMapTheme.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
foreach (DictionaryEntry entry in resourceSet)
{
string colorName = entry.Key.ToString();
String xmlQueryPath = (String)entry.Value;
XmlNodeList colorNodeList = _xml.DocumentElement.FirstChild.SelectNodes(xmlQueryPath);
if(colorNodeList.Count > 0)
{
Color paletteColor = colorPalette.getColor(colorName);
colorNodeList[0].Value = string.Format("FF{0:X2}{1:X2}{2:X2}", paletteColor.R, paletteColor.G, paletteColor.B);
}
var colorName = entry.Key.ToString();
var xmlQueryPath = (string)entry.Value;
var colorNodeList = _xml.DocumentElement?.FirstChild.SelectNodes(xmlQueryPath);
if (colorNodeList == null || colorNodeList.Count <= 0) continue;
var paletteColor = colorPalette.getColor(colorName);
colorNodeList[0].Value = $"FF{paletteColor.R:X2}{paletteColor.G:X2}{paletteColor.B:X2}";
}
MemoryStream ms = new MemoryStream();
var ms = new MemoryStream();
_xml.Save(ms);
byte[] bytes = ms.ToArray();
var bytes = ms.ToArray();
return bytes;
}

View File

@@ -1,7 +1,5 @@
using mRemoteNG.Tools;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using WeifenLuo.WinFormsUI.Docking;
@@ -51,13 +49,17 @@ namespace mRemoteNG.Themes
#region Public Methods
public object Clone()
{
ThemeInfo clonedObj;
ExtendedColorPalette extPalette = new ExtendedColorPalette();
extPalette.ExtColorPalette = _extendedPalette.ExtColorPalette.ToDictionary(entry => entry.Key,entry => entry.Value);
extPalette.DefaultColorPalette = _extendedPalette.DefaultColorPalette;
clonedObj = new ThemeInfo(_name, _theme, _URI, _version, extPalette);
clonedObj.IsExtendable = _isExtendable;
clonedObj.IsThemeBase = _isThemeBase;
var extPalette = new ExtendedColorPalette
{
ExtColorPalette =
_extendedPalette.ExtColorPalette.ToDictionary(entry => entry.Key, entry => entry.Value),
DefaultColorPalette = _extendedPalette.DefaultColorPalette
};
var clonedObj = new ThemeInfo(_name, _theme, _URI, _version, extPalette)
{
IsExtendable = _isExtendable,
IsThemeBase = _isThemeBase
};
return clonedObj;
}
@@ -72,7 +74,7 @@ namespace mRemoteNG.Themes
get { return _name; }
set
{
if (_name == value)
if (string.Equals(_name, value, StringComparison.InvariantCulture))
{
return;
}
@@ -85,7 +87,7 @@ namespace mRemoteNG.Themes
get { return _theme; }
set
{
if (_theme == value)
if (value != null && _theme == value)
{
return;
}
@@ -98,7 +100,7 @@ namespace mRemoteNG.Themes
get { return _URI; }
set
{
if (_URI == value)
if (value != null && _URI == value)
{
return;
}
@@ -111,7 +113,7 @@ namespace mRemoteNG.Themes
get { return _version; }
set
{
if (_version == value)
if (Equals(_version, value))
{
return;
}
@@ -124,7 +126,7 @@ namespace mRemoteNG.Themes
get { return _extendedPalette; }
set
{
if (_extendedPalette == value)
if (_extendedPalette != null && _extendedPalette == value)
{
return;
}

View File

@@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using WeifenLuo.WinFormsUI.Docking;
@@ -18,8 +17,8 @@ namespace mRemoteNG.Themes
private ThemeInfo _activeTheme;
private Hashtable themes;
private bool _themeActive = false;
private static ThemeManager themeInstance = null;
private bool _themeActive;
private static ThemeManager themeInstance;
#endregion
@@ -33,8 +32,8 @@ namespace mRemoteNG.Themes
private void SetActive()
{
if (themes[mRemoteNG.Settings.Default.ThemeName] != null)
ActiveTheme = (ThemeInfo) themes[mRemoteNG.Settings.Default.ThemeName];
if (themes[Settings.Default.ThemeName] != null)
ActiveTheme = (ThemeInfo) themes[Settings.Default.ThemeName];
else
ActiveTheme = DefaultTheme;
}
@@ -211,7 +210,7 @@ namespace mRemoteNG.Themes
}
}
public ThemeInfo DefaultTheme
private ThemeInfo DefaultTheme
{
get
{

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
//Taken from https://www.codeproject.com/Tips/447319/Resolve-DesignMode-for-a-user-control
@@ -27,17 +24,14 @@ namespace mRemoteNG.Tools
/// <returns>True if in design mode, otherwise false</returns>
private static bool ResolveDesignMode(System.Windows.Forms.Control control)
{
System.Reflection.PropertyInfo designModeProperty;
bool designMode;
// Get the protected property
designModeProperty = control.GetType().GetProperty(
"DesignMode",
System.Reflection.BindingFlags.Instance
| System.Reflection.BindingFlags.NonPublic);
var designModeProperty = control.GetType().GetProperty(
"DesignMode",
BindingFlags.Instance
| BindingFlags.NonPublic);
// Get the controls DesignMode value
designMode = (bool)designModeProperty.GetValue(control, null);
var designMode = designModeProperty != null && (bool)designModeProperty.GetValue(control, null);
// Test the parent if it exists
if (control.Parent != null)

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections;
using System.Windows.Forms;
using mRemoteNG.App;
using mRemoteNG.Connection.Protocol.Http;
using mRemoteNG.Connection.Protocol.RDP;

View File

@@ -1,5 +1,4 @@
using mRemoteNG.Themes;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
@@ -21,7 +20,7 @@ namespace mRemoteNG.UI.Controls.Base
OUT
}
public NGButton() : base()
public NGButton()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}
@@ -106,7 +105,7 @@ namespace mRemoteNG.UI.Controls.Base
e.Graphics.FillRectangle(new SolidBrush(back), e.ClipRectangle);
e.Graphics.DrawRectangle(new Pen(border, 1), 0, 0, base.Width - 1, base.Height - 1);
e.Graphics.DrawRectangle(new Pen(border, 1), 0, 0, Width - 1, Height - 1);
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
//Warning. the app doesnt use many images in buttons so this positions are kinda tailored just for the used by the app
@@ -117,7 +116,7 @@ namespace mRemoteNG.UI.Controls.Base
e.Graphics.DrawImageUnscaled(Image, Width / 2 - (int)stringSize.Width / 2 - Image.Width + 2, Height / 2 - Image.Height/2);
}
TextRenderer.DrawText(e.Graphics, this.Text, Font, ClientRectangle, fore, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
TextRenderer.DrawText(e.Graphics, Text, Font, ClientRectangle, fore, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
}
}
}

View File

@@ -1,11 +1,5 @@
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls.Base
@@ -15,7 +9,7 @@ namespace mRemoteNG.UI.Controls.Base
{
private ThemeManager _themeManager;
public NGCheckBox() : base()
public NGCheckBox()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}
@@ -35,36 +29,32 @@ namespace mRemoteNG.UI.Controls.Base
base.OnCreateControl();
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
if (!_themeManager.ThemingActive) return;
_mice = MouseState.OUT;
MouseEnter += (sender, args) =>
{
_mice = MouseState.HOVER;
Invalidate();
};
MouseLeave += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
MouseDown += (sender, args) =>
{
if (args.Button != MouseButtons.Left) return;
_mice = MouseState.DOWN;
Invalidate();
};
MouseUp += (sender, args) =>
{
_mice = MouseState.OUT;
MouseEnter += (sender, args) =>
{
_mice = MouseState.HOVER;
Invalidate();
};
MouseLeave += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
MouseDown += (sender, args) =>
{
if (args.Button == MouseButtons.Left)
{
_mice = MouseState.DOWN;
Invalidate();
}
};
MouseUp += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
Invalidate();
}
};
Invalidate();
}
@@ -76,17 +66,16 @@ namespace mRemoteNG.UI.Controls.Base
return;
}
//Get the colors
Color back;
Color fore;
Color glyph;
Color checkBack;
Color checkBorder;
back = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Background");
var back = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Background");
if (Enabled)
{
glyph = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Glyph");
fore = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Text");
// ReSharper disable once SwitchStatementMissingSomeCases
switch (_mice)
{
case MouseState.HOVER:
@@ -110,9 +99,9 @@ namespace mRemoteNG.UI.Controls.Base
e.Graphics.Clear(Parent.BackColor);
using (Pen p = new Pen(checkBorder))
using (var p = new Pen(checkBorder))
{
Rectangle boxRect = new Rectangle(0, Height / 2 - 7, 11, 11);
var boxRect = new Rectangle(0, Height / 2 - 7, 11, 11);
e.Graphics.FillRectangle(new SolidBrush(back), boxRect);
e.Graphics.DrawRectangle(p, boxRect);
}
@@ -122,7 +111,7 @@ namespace mRemoteNG.UI.Controls.Base
e.Graphics.DrawString("ü", new Font("Wingdings", 9f), new SolidBrush(glyph), -1, 1);
}
Rectangle textRect = new Rectangle(16, 0, Width - 16, Height);
var textRect = new Rectangle(16, 0, Width - 16, Height);
TextRenderer.DrawText(e.Graphics, Text, Font, textRect, fore, Parent.BackColor, TextFormatFlags.PathEllipsis);

View File

@@ -1,16 +1,12 @@
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls.Base
{
//Extended ComboBox class, the NGComboBox onPaint completely repaint the control as does the item painting
//warning: THe DropDown style rendering is glitchy in this control, only use DropDownList or correct the rendering method
class NGComboBox : ComboBox
internal class NGComboBox : ComboBox
{
private ThemeManager _themeManager;
public enum MouseState
@@ -21,7 +17,7 @@ namespace mRemoteNG.UI.Controls.Base
}
public MouseState _mice { get; set; }
public NGComboBox() : base()
public NGComboBox()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}
@@ -31,47 +27,43 @@ namespace mRemoteNG.UI.Controls.Base
base.OnCreateControl();
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
if (!_themeManager.ThemingActive) return;
_themeManager = ThemeManager.getInstance();
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Background");
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Foreground");
DrawMode = DrawMode.OwnerDrawFixed;
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.UserPaint, true);
DrawItem += NG_DrawItem;
_mice = MouseState.OUT;
MouseEnter += (sender, args) =>
{
_themeManager = ThemeManager.getInstance();
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Background");
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Foreground");
DrawMode = DrawMode.OwnerDrawFixed;
SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.UserPaint, true);
DrawItem += NG_DrawItem;
_mice = MouseState.OUT;
MouseEnter += (sender, args) =>
{
_mice = MouseState.HOVER;
Invalidate();
};
MouseLeave += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
MouseDown += (sender, args) =>
{
if (args.Button == MouseButtons.Left)
{
_mice = MouseState.DOWN;
Invalidate();
}
};
MouseUp += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
_mice = MouseState.HOVER;
Invalidate();
}
};
MouseLeave += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
MouseDown += (sender, args) =>
{
if (args.Button != MouseButtons.Left) return;
_mice = MouseState.DOWN;
Invalidate();
};
MouseUp += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
Invalidate();
}
private void NG_DrawItem(object sender, DrawItemEventArgs e)
{
int index = e.Index >= 0 ? e.Index : 0;
var index = e.Index >= 0 ? e.Index : 0;
Brush itemBrush= new SolidBrush(_themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Foreground"));
if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
@@ -88,7 +80,7 @@ namespace mRemoteNG.UI.Controls.Base
{
if (Items[index].GetType().GetProperty(DisplayMember) != null)
{
e.Graphics.DrawString(Items[index].GetType().GetProperty(DisplayMember).GetValue(Items[index],null).ToString(), e.Font, itemBrush, e.Bounds, StringFormat.GenericDefault);
e.Graphics.DrawString(Items[index].GetType().GetProperty(DisplayMember)?.GetValue(Items[index],null).ToString(), e.Font, itemBrush, e.Bounds, StringFormat.GenericDefault);
}
}
e.DrawFocusRectangle();
@@ -103,11 +95,11 @@ namespace mRemoteNG.UI.Controls.Base
return;
}
//Colors
Color Border = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Border");
Color Back = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Background");
Color Fore = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Foreground");
Color ButtBack = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Button_Background");
Color ButtFore = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Button_Foreground");
var Border = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Border");
var Back = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Background");
var Fore = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Foreground");
var ButtBack = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Button_Background");
var ButtFore = _themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Button_Foreground");
if (_mice == MouseState.HOVER)
{
@@ -126,13 +118,13 @@ namespace mRemoteNG.UI.Controls.Base
e.Graphics.Clear(Back);
//Border
using (Pen p = new Pen(Border))
using (var p = new Pen(Border))
{
Rectangle boxRect = new Rectangle(0, 0, Width - 1, Height - 1);
var boxRect = new Rectangle(0, 0, Width - 1, Height - 1);
e.Graphics.DrawRectangle(p, boxRect);
}
//Button
using (SolidBrush b = new SolidBrush(ButtBack))
using (var b = new SolidBrush(ButtBack))
{
e.Graphics.FillRectangle(b, Width - 18, 2, 16, Height - 4);
}
@@ -141,7 +133,7 @@ namespace mRemoteNG.UI.Controls.Base
e.Graphics.DrawString("q", new Font("Wingdings 3", 8f), new SolidBrush(ButtFore), Width-17, Height/2 -5);
//Text
Rectangle textRect = new Rectangle(2, 2, Width - 20, Height - 4);
var textRect = new Rectangle(2, 2, Width - 20, Height - 4);
TextRenderer.DrawText(e.Graphics, Text, Font, textRect, Fore, Back, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
}
}

View File

@@ -1,11 +1,6 @@
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace mRemoteNG.UI.Controls.Base
{
@@ -40,33 +35,33 @@ namespace mRemoteNG.UI.Controls.Base
return;
}
//Reusing the textbox colors
Color titleColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Foreground");
Color backColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Backgorund");
Color lineColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Line");
var titleColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Foreground");
//var backColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Backgorund");
var lineColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Line");
if (!Enabled)
{
titleColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Disabled_Foreground");
backColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Disabled_Background");
//backColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Disabled_Background");
lineColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("GroupBox_Disabled_Line");
}
GroupBoxState state = base.Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled;
TextFormatFlags flags = TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.TextBoxControl |TextFormatFlags.WordBreak;
//var state = Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled;
var flags = TextFormatFlags.PreserveGraphicsTranslateTransform | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.TextBoxControl |TextFormatFlags.WordBreak;
if (!this.ShowKeyboardCues)
if (!ShowKeyboardCues)
flags |= TextFormatFlags.HidePrefix;
if (this.RightToLeft == RightToLeft.Yes)
if (RightToLeft == RightToLeft.Yes)
flags |= TextFormatFlags.RightToLeft | TextFormatFlags.Right;
//No clear backgorund, this control is transparently
//e.Graphics.FillRectangle(new SolidBrush(backColor), 0, 0, Width, Height);
Rectangle bounds = new Rectangle(0, 0, base.Width, base.Height);
Rectangle rectangle = bounds;
var bounds = new Rectangle(0, 0, Width, Height);
var rectangle = bounds;
rectangle.Width -= 8;
Size size = TextRenderer.MeasureText(e.Graphics, Text, Font, new Size(rectangle.Width, rectangle.Height), flags);
var size = TextRenderer.MeasureText(e.Graphics, Text, Font, new Size(rectangle.Width, rectangle.Height), flags);
rectangle.Width = size.Width;
rectangle.Height = size.Height;
if ((flags & TextFormatFlags.Right) == TextFormatFlags.Right)
@@ -79,7 +74,7 @@ namespace mRemoteNG.UI.Controls.Base
rectangle.Inflate(2, 0);
using (var pen = new Pen(lineColor))
{
int num = bounds.Top + (Font.Height / 2);
var num = bounds.Top + (Font.Height / 2);
//Left line
e.Graphics.DrawLine(pen, bounds.Left + Padding.Left , num - Padding.Top, bounds.Left + Padding.Left, bounds.Height - Padding.Bottom);
//Bottom line

View File

@@ -14,7 +14,7 @@ namespace mRemoteNG.UI.Controls.Base
private ThemeManager _themeManager;
public NGLabel() : base()
public NGLabel()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}
@@ -46,7 +46,7 @@ namespace mRemoteNG.UI.Controls.Base
}
else
{
Color disabledtextLabel = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Disabled_Foreground");
var disabledtextLabel = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Disabled_Foreground");
TextRenderer.DrawText(e.Graphics, this.Text, Font, ClientRectangle, disabledtextLabel, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
}

View File

@@ -1,17 +1,12 @@
using BrightIdeasSoftware;
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls.Base
{
//Simple coloring of ObjectListView
//This is subclassed to avoid repeating the code in multiple places
class NGListView : ObjectListView
internal class NGListView : ObjectListView
{
private CellBorderDecoration deco;
@@ -19,7 +14,7 @@ namespace mRemoteNG.UI.Controls.Base
public bool DecorateLines { get; set; } = true;
public NGListView() : base()
public NGListView()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}
@@ -32,41 +27,38 @@ namespace mRemoteNG.UI.Controls.Base
base.OnCreateControl();
if (Tools.DesignModeTest.IsInDesignMode(this))
return;
ThemeManager _themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
var _themeManager = ThemeManager.getInstance();
if (!_themeManager.ThemingActive) return;
//List back color
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Background");
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Foreground");
//Selected item
SelectedBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Selected_Background");
SelectedForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Selected_Foreground");
//Header style
HeaderUsesThemes = false;
var headerStylo = new HeaderFormatStyle();
headerStylo.Normal.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Background");
headerStylo.Normal.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Foreground");
HeaderFormatStyle = headerStylo;
//Border style
if(DecorateLines)
{
//List back color
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Background");
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Foreground");
//Selected item
SelectedBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Selected_Background");
SelectedForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Selected_Foreground");
//Header style
HeaderUsesThemes = false;
HeaderFormatStyle headerStylo = new HeaderFormatStyle();
headerStylo.Normal.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Background");
headerStylo.Normal.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("List_Header_Foreground");
HeaderFormatStyle = headerStylo;
//Border style
if(DecorateLines)
UseCellFormatEvents = true;
GridLines = false;
deco = new CellBorderDecoration
{
UseCellFormatEvents = true;
GridLines = false;
deco = new CellBorderDecoration();
deco.BorderPen = new Pen(_themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Border"));
deco.FillBrush = null;
deco.BoundsPadding = Size.Empty;
deco.CornerRounding = 0;
FormatCell += NGListView_FormatCell;
}
if (Items != null && Items.Count != 0)
BuildList();
Invalidate();
BorderPen = new Pen(_themeManager.ActiveTheme.ExtendedPalette.getColor("List_Item_Border")),
FillBrush = null,
BoundsPadding = Size.Empty,
CornerRounding = 0
};
FormatCell += NGListView_FormatCell;
}
if (Items != null && Items.Count != 0)
BuildList();
Invalidate();
}
private void NGListView_FormatCell(object sender, FormatCellEventArgs e)

View File

@@ -1,16 +1,13 @@
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls.Base
{
//Repaint of the NumericUpDown, the composite control buttons are replaced because the
//original ones cannot be themed due to protected inheritance
class NGNumericUpDown : NumericUpDown
internal class NGNumericUpDown : NumericUpDown
{
private ThemeManager _themeManager;
@@ -25,33 +22,32 @@ namespace mRemoteNG.UI.Controls.Base
protected override void OnCreateControl()
{
base.OnCreateControl();
if (!Tools.DesignModeTest.IsInDesignMode(this))
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
_themeManager = ThemeManager.getInstance();
if (!_themeManager.ThemingActive) return;
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
//Hide those nonthemable butons
Controls[0].Hide();
//Add new themable buttons
Up = new NGButton
{
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
{
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
//Hide those nonthemable butons
Controls[0].Hide();
//Add new themable buttons
Up = new NGButton();
Up.Text = "p";
Up.Font = new Font("Wingdings 3", 6f);
Up.SetBounds(Width - 17, 1, 16, Height / 2 - 1);
Up.Click += Up_Click;
Down = new NGButton();
Down.Text = "q";
Down.Font = new Font("Wingdings 3", 6f);
Down.SetBounds(Width - 17, Height/2, 16, Height / 2 - 1);
Down.Click += Down_Click;
Controls.Add(Up);
Controls.Add(Down);
Invalidate();
}
}
Text = "p",
Font = new Font("Wingdings 3", 6f)
};
Up.SetBounds(Width - 17, 1, 16, Height / 2 - 1);
Up.Click += Up_Click;
Down = new NGButton
{
Text = "q",
Font = new Font("Wingdings 3", 6f)
};
Down.SetBounds(Width - 17, Height/2, 16, Height / 2 - 1);
Down.Click += Down_Click;
Controls.Add(Up);
Controls.Add(Down);
Invalidate();
}
private void Down_Click(object sender, EventArgs e)
@@ -72,7 +68,7 @@ namespace mRemoteNG.UI.Controls.Base
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
{
if (base.Enabled)
if (Enabled)
{
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
@@ -92,16 +88,11 @@ namespace mRemoteNG.UI.Controls.Base
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (!Tools.DesignModeTest.IsInDesignMode(this))
{
if (_themeManager.ThemingActive)
{
//Fix Border
if (BorderStyle != BorderStyle.None)
e.Graphics.DrawRectangle(new Pen(_themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Border"), 1), 0, 0, base.Width - 1, base.Height - 1);
}
}
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
if (!_themeManager.ThemingActive) return;
//Fix Border
if (BorderStyle != BorderStyle.None)
e.Graphics.DrawRectangle(new Pen(_themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Border"), 1), 0, 0, Width - 1, Height - 1);
}

View File

@@ -1,21 +1,17 @@
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls.Base
{
// Repaint of a ProgressBar on a flat style
class NGProgressBar : ProgressBar
internal class NGProgressBar : ProgressBar
{
private ThemeManager _themeManager;
public NGProgressBar() : base()
public NGProgressBar()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}
@@ -23,17 +19,12 @@ namespace mRemoteNG.UI.Controls.Base
protected override void OnCreateControl()
{
base.OnCreateControl();
if (!Tools.DesignModeTest.IsInDesignMode(this))
{
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
{
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
Invalidate();
}
}
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
_themeManager = ThemeManager.getInstance();
if (!_themeManager.ThemingActive) return;
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
@@ -43,8 +34,8 @@ namespace mRemoteNG.UI.Controls.Base
base.OnPaint(e);
return;
}
Color progressFill = _themeManager.ActiveTheme.ExtendedPalette.getColor("ProgressBar_Fill");
Color back = _themeManager.ActiveTheme.ExtendedPalette.getColor("ProgressBar_Background");
var progressFill = _themeManager.ActiveTheme.ExtendedPalette.getColor("ProgressBar_Fill");
var back = _themeManager.ActiveTheme.ExtendedPalette.getColor("ProgressBar_Background");
var doneProgress = (int)(e.ClipRectangle.Width * ((double)Value / Maximum));
e.Graphics.FillRectangle(new SolidBrush(progressFill), 0, 0, doneProgress, e.ClipRectangle.Height);
e.Graphics.FillRectangle(new SolidBrush(back), doneProgress, 0, e.ClipRectangle.Width, e.ClipRectangle.Height);

View File

@@ -1,10 +1,6 @@
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls.Base
@@ -17,7 +13,7 @@ namespace mRemoteNG.UI.Controls.Base
private Rectangle circle;
private Rectangle circle_small;
// Constructor
public NGRadioButton() :base()
public NGRadioButton()
{
// Init
circle_small = new Rectangle(4, 4, 6, 6 );
@@ -26,55 +22,49 @@ namespace mRemoteNG.UI.Controls.Base
}
public enum MouseState
private enum MouseState
{
HOVER,
DOWN,
OUT
}
public MouseState _mice { get; set; }
private MouseState _mice { get; set; }
protected override void OnCreateControl()
{
base.OnCreateControl();
if (!Tools.DesignModeTest.IsInDesignMode(this))
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
_themeManager = ThemeManager.getInstance();
if (!_themeManager.ThemingActive) return;
// Allows for Overlaying
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
BackColor = Color.Transparent;
_mice = MouseState.OUT;
MouseEnter += (sender, args) =>
{
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
{
// Allows for Overlaying
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
BackColor = Color.Transparent;
_mice = MouseState.OUT;
MouseEnter += (sender, args) =>
{
_mice = MouseState.HOVER;
Invalidate();
};
MouseLeave += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
MouseDown += (sender, args) =>
{
if (args.Button == MouseButtons.Left)
{
_mice = MouseState.DOWN;
Invalidate();
}
};
MouseUp += (sender, args) =>
{
_mice = MouseState.OUT;
_mice = MouseState.HOVER;
Invalidate();
};
MouseLeave += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
MouseDown += (sender, args) =>
{
if (args.Button != MouseButtons.Left) return;
_mice = MouseState.DOWN;
Invalidate();
};
MouseUp += (sender, args) =>
{
_mice = MouseState.OUT;
Invalidate();
};
Invalidate();
}
}
Invalidate();
};
Invalidate();
}
@@ -87,13 +77,13 @@ namespace mRemoteNG.UI.Controls.Base
return;
}
// Init
Graphics g = e.Graphics;
var g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
Color fore = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Text");
Color outline = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Border");
Color centerBack = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Background");
Color center = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Glyph");
var fore = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Text");
var outline = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Border");
var centerBack = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Background");
Color center;
// Overlay Graphic
e.Graphics.Clear(Parent.BackColor);
@@ -120,7 +110,7 @@ namespace mRemoteNG.UI.Controls.Base
fore = _themeManager.ActiveTheme.ExtendedPalette.getColor("CheckBox_Text_Disabled");
}
Rectangle textRect = new Rectangle(16, Padding.Top, Width - 16, Height);
var textRect = new Rectangle(16, Padding.Top, Width - 16, Height);
TextRenderer.DrawText(e.Graphics, Text, Font, textRect, fore, Parent.BackColor, TextFormatFlags.PathEllipsis);
g.FillEllipse(new SolidBrush(centerBack), circle);

View File

@@ -1,11 +1,5 @@
using mRemoteNG.Themes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls.Base
@@ -16,7 +10,7 @@ namespace mRemoteNG.UI.Controls.Base
{
private ThemeManager _themeManager;
public NGTextBox() : base()
public NGTextBox()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}
@@ -24,17 +18,12 @@ namespace mRemoteNG.UI.Controls.Base
protected override void OnCreateControl()
{
base.OnCreateControl();
if (!Tools.DesignModeTest.IsInDesignMode(this))
{
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
{
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
Invalidate();
}
}
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
_themeManager = ThemeManager.getInstance();
if (!_themeManager.ThemingActive) return;
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
Invalidate();
}
@@ -46,7 +35,7 @@ namespace mRemoteNG.UI.Controls.Base
_themeManager = ThemeManager.getInstance();
if(_themeManager.ThemingActive)
{
if (base.Enabled)
if (Enabled)
{
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");

View File

@@ -3,7 +3,6 @@ using System.ComponentModel;
using System.Windows.Forms;
using mRemoteNG.App;
using mRemoteNG.Messages;
using mRemoteNG.Themes;
using mRemoteNG.Tools;
using mRemoteNG.Tree;

View File

@@ -2,9 +2,7 @@
* http://www.codeproject.com/Articles/11576/IP-TextBox
* Original Author: mawnkay
*/
using mRemoteNG.Themes;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace mRemoteNG.UI.Controls
@@ -88,11 +86,9 @@ namespace mRemoteNG.UI.Controls
private void ApplyTheme()
{
if (!Tools.DesignModeTest.IsInDesignMode(this))
{
if (Themes.ThemeManager.getInstance().ThemingActive)
this.panel1.BackColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
}
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
if (Themes.ThemeManager.getInstance().ThemingActive)
panel1.BackColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
}
protected override void Dispose( bool disposing )
{
@@ -111,126 +107,126 @@ namespace mRemoteNG.UI.Controls
/// the contents of this method with the code editor.
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.panel1 = new System.Windows.Forms.Panel();
this.label3 = new Base.NGLabel();
this.label2 = new Base.NGLabel();
this.Octet4 = new Base.NGTextBox();
this.Octet3 = new Base.NGTextBox();
this.Octet2 = new Base.NGTextBox();
this.label1 = new Base.NGLabel();
this.Octet1 = new Base.NGTextBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.panel1.SuspendLayout();
this.SuspendLayout();
components = new System.ComponentModel.Container();
panel1 = new Panel();
label3 = new Base.NGLabel();
label2 = new Base.NGLabel();
Octet4 = new Base.NGTextBox();
Octet3 = new Base.NGTextBox();
Octet2 = new Base.NGTextBox();
label1 = new Base.NGLabel();
Octet1 = new Base.NGTextBox();
toolTip1 = new System.Windows.Forms.ToolTip(components);
panel1.SuspendLayout();
SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.Window;
this.panel1.Controls.Add(this.Octet4);
this.panel1.Controls.Add(this.Octet3);
this.panel1.Controls.Add(this.Octet2);
this.panel1.Controls.Add(this.Octet1);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.label3);
this.panel1.Font = new System.Drawing.Font("Segoe UI", 9F);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(124, 18);
this.panel1.TabIndex = 0;
panel1.BackColor = System.Drawing.SystemColors.Window;
panel1.Controls.Add(Octet4);
panel1.Controls.Add(Octet3);
panel1.Controls.Add(Octet2);
panel1.Controls.Add(Octet1);
panel1.Controls.Add(label2);
panel1.Controls.Add(label1);
panel1.Controls.Add(label3);
panel1.Font = new System.Drawing.Font("Segoe UI", 9F);
panel1.Location = new System.Drawing.Point(0, 0);
panel1.Name = "panel1";
panel1.Size = new System.Drawing.Size(124, 18);
panel1.TabIndex = 0;
//
// label3
//
this.label3.Location = new System.Drawing.Point(23, 1);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(8, 13);
this.label3.TabIndex = 6;
this.label3.Text = ".";
label3.Location = new System.Drawing.Point(23, 1);
label3.Name = "label3";
label3.Size = new System.Drawing.Size(8, 13);
label3.TabIndex = 6;
label3.Text = ".";
//
// label2
//
this.label2.Location = new System.Drawing.Point(86, 2);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(8, 13);
this.label2.TabIndex = 5;
this.label2.Text = ".";
label2.Location = new System.Drawing.Point(86, 2);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(8, 13);
label2.TabIndex = 5;
label2.Text = ".";
//
// Octet4
//
this.Octet4.BackColor = System.Drawing.SystemColors.Menu;
this.Octet4.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.Octet4.Font = new System.Drawing.Font("Segoe UI", 9F);
this.Octet4.Location = new System.Drawing.Point(95, 1);
this.Octet4.MaxLength = 3;
this.Octet4.Name = "Octet4";
this.Octet4.Size = new System.Drawing.Size(24, 16);
this.Octet4.TabIndex = 4;
this.Octet4.TabStop = false;
this.Octet4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.Octet4.Enter += new System.EventHandler(this.Box_Enter);
this.Octet4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box4_KeyPress);
Octet4.BackColor = System.Drawing.SystemColors.Menu;
Octet4.BorderStyle = System.Windows.Forms.BorderStyle.None;
Octet4.Font = new System.Drawing.Font("Segoe UI", 9F);
Octet4.Location = new System.Drawing.Point(95, 1);
Octet4.MaxLength = 3;
Octet4.Name = "Octet4";
Octet4.Size = new System.Drawing.Size(24, 16);
Octet4.TabIndex = 4;
Octet4.TabStop = false;
Octet4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
Octet4.Enter += new System.EventHandler(Box_Enter);
Octet4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box4_KeyPress);
//
// Octet3
//
this.Octet3.BackColor = System.Drawing.SystemColors.Menu;
this.Octet3.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.Octet3.Font = new System.Drawing.Font("Segoe UI", 9F);
this.Octet3.Location = new System.Drawing.Point(63, 1);
this.Octet3.MaxLength = 3;
this.Octet3.Name = "Octet3";
this.Octet3.Size = new System.Drawing.Size(24, 16);
this.Octet3.TabIndex = 3;
this.Octet3.TabStop = false;
this.Octet3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.Octet3.Enter += new System.EventHandler(this.Box_Enter);
this.Octet3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box3_KeyPress);
Octet3.BackColor = System.Drawing.SystemColors.Menu;
Octet3.BorderStyle = System.Windows.Forms.BorderStyle.None;
Octet3.Font = new System.Drawing.Font("Segoe UI", 9F);
Octet3.Location = new System.Drawing.Point(63, 1);
Octet3.MaxLength = 3;
Octet3.Name = "Octet3";
Octet3.Size = new System.Drawing.Size(24, 16);
Octet3.TabIndex = 3;
Octet3.TabStop = false;
Octet3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
Octet3.Enter += new System.EventHandler(Box_Enter);
Octet3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box3_KeyPress);
//
// Octet2
//
this.Octet2.BackColor = System.Drawing.SystemColors.Menu;
this.Octet2.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.Octet2.Font = new System.Drawing.Font("Segoe UI", 9F);
this.Octet2.Location = new System.Drawing.Point(32, 1);
this.Octet2.MaxLength = 3;
this.Octet2.Name = "Octet2";
this.Octet2.Size = new System.Drawing.Size(24, 16);
this.Octet2.TabIndex = 2;
this.Octet2.TabStop = false;
this.Octet2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.Octet2.Enter += new System.EventHandler(this.Box_Enter);
this.Octet2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box2_KeyPress);
Octet2.BackColor = System.Drawing.SystemColors.Menu;
Octet2.BorderStyle = System.Windows.Forms.BorderStyle.None;
Octet2.Font = new System.Drawing.Font("Segoe UI", 9F);
Octet2.Location = new System.Drawing.Point(32, 1);
Octet2.MaxLength = 3;
Octet2.Name = "Octet2";
Octet2.Size = new System.Drawing.Size(24, 16);
Octet2.TabIndex = 2;
Octet2.TabStop = false;
Octet2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
Octet2.Enter += new System.EventHandler(Box_Enter);
Octet2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box2_KeyPress);
//
// label1
//
this.label1.Location = new System.Drawing.Point(55, 2);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(8, 13);
this.label1.TabIndex = 1;
this.label1.Text = ".";
label1.Location = new System.Drawing.Point(55, 2);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(8, 13);
label1.TabIndex = 1;
label1.Text = ".";
//
// Octet1
//
this.Octet1.BackColor = System.Drawing.SystemColors.Menu;
this.Octet1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.Octet1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Octet1.Location = new System.Drawing.Point(1, 1);
this.Octet1.MaxLength = 3;
this.Octet1.Name = "Octet1";
this.Octet1.Size = new System.Drawing.Size(24, 16);
this.Octet1.TabIndex = 1;
this.Octet1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.Octet1.Enter += new System.EventHandler(this.Box_Enter);
this.Octet1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Box1_KeyPress);
Octet1.BackColor = System.Drawing.SystemColors.Menu;
Octet1.BorderStyle = System.Windows.Forms.BorderStyle.None;
Octet1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
Octet1.Location = new System.Drawing.Point(1, 1);
Octet1.MaxLength = 3;
Octet1.Name = "Octet1";
Octet1.Size = new System.Drawing.Size(24, 16);
Octet1.TabIndex = 1;
Octet1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
Octet1.Enter += new System.EventHandler(Box_Enter);
Octet1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Box1_KeyPress);
//
// IPTextBox
//
this.Controls.Add(this.panel1);
this.Name = "IPTextBox";
this.Size = new System.Drawing.Size(124, 18);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
Controls.Add(panel1);
Name = "IPTextBox";
Size = new System.Drawing.Size(124, 18);
panel1.ResumeLayout(false);
panel1.PerformLayout();
ResumeLayout(false);
}
#endregion
@@ -284,21 +280,19 @@ namespace mRemoteNG.UI.Controls
//If we are not overwriting the whole text
else if(Octet1.SelectionLength != Octet1.Text.Length)
{
//Check that the new Text value will be a valid
{
//Check that the new Text value will be a valid
// ip octet then move on to next box
if(Octet1.Text.Length == 2)
{
if(!IsValid(Octet1.Text + e.KeyChar))
{
Octet1.SelectAll();
e.Handled = true;
}
else
{
Octet2.Focus();
}
}
if (Octet1.Text.Length != 2) return;
if(!IsValid(Octet1.Text + e.KeyChar))
{
Octet1.SelectAll();
e.Handled = true;
}
else
{
Octet2.Focus();
}
}
}
//Do nothing if the keypress is not numeral, backspace, or '.'
@@ -329,18 +323,16 @@ namespace mRemoteNG.UI.Controls
}
else if(Octet2.SelectionLength != Octet2.Text.Length)
{
if(Octet2.Text.Length == 2)
{
if(!IsValid(Octet2.Text + e.KeyChar))
{
Octet2.SelectAll();
e.Handled = true;
}
else
{
Octet3.Focus();
}
}
if (Octet2.Text.Length != 2) return;
if(!IsValid(Octet2.Text + e.KeyChar))
{
Octet2.SelectAll();
e.Handled = true;
}
else
{
Octet3.Focus();
}
}
else if(Octet2.Text.Length == 0 && e.KeyChar == 8)
{
@@ -376,18 +368,16 @@ namespace mRemoteNG.UI.Controls
}
else if(Octet3.SelectionLength != Octet3.Text.Length)
{
if(Octet3.Text.Length == 2)
{
if(!IsValid(Octet3.Text + e.KeyChar))
{
Octet3.SelectAll();
e.Handled = true;
}
else
{
Octet4.Focus();
}
}
if (Octet3.Text.Length != 2) return;
if(!IsValid(Octet3.Text + e.KeyChar))
{
Octet3.SelectAll();
e.Handled = true;
}
else
{
Octet4.Focus();
}
}
else if(Octet3.Text.Length == 0 && e.KeyChar == 8)
{
@@ -411,14 +401,10 @@ namespace mRemoteNG.UI.Controls
{
if(Octet4.SelectionLength != Octet4.Text.Length)
{
if(Octet4.Text.Length == 2)
{
if(!IsValid(Octet4.Text + e.KeyChar))
{
Octet4.SelectAll();
e.Handled = true;
}
}
if (Octet4.Text.Length != 2) return;
if (IsValid(Octet4.Text + e.KeyChar)) return;
Octet4.SelectAll();
e.Handled = true;
}
else if(Octet4.Text.Length == 0 && e.KeyChar == 8)
{

View File

@@ -9,7 +9,7 @@ namespace mRemoteNG.UI.Controls.PageSequence
public event EventHandler Previous;
public event SequencedPageReplcementRequestHandler PageReplacementRequested;
public SequencedControl() : base()
public SequencedControl()
{
Themes.ThemeManager.getInstance().ThemeChanged += ApplyTheme;
}
@@ -19,13 +19,11 @@ namespace mRemoteNG.UI.Controls.PageSequence
Next?.Invoke(this, EventArgs.Empty);
}
public virtual void ApplyTheme()
protected virtual void ApplyTheme()
{
if (Themes.ThemeManager.getInstance().ThemingActive)
{
BackColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
ForeColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}
if (!Themes.ThemeManager.getInstance().ThemingActive) return;
BackColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
ForeColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}
protected virtual void RaisePreviousPageEvent()

View File

@@ -8,7 +8,6 @@ using mRemoteNG.Connection.Protocol;
using mRemoteNG.Container;
using mRemoteNG.Themes;
using mRemoteNG.Tools;
using System.Drawing;
namespace mRemoteNG.UI.Controls
{
@@ -134,13 +133,11 @@ namespace mRemoteNG.UI.Controls
private void ApplyTheme()
{
if (_themeManager.ThemingActive)
{
vsToolStripExtender.SetStyle(_mnuQuickConnectProtocol, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
vsToolStripExtender.SetStyle(_mnuConnections, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
_cmbQuickConnect.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
_cmbQuickConnect.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
}
if (!_themeManager.ThemingActive) return;
vsToolStripExtender.SetStyle(_mnuQuickConnectProtocol, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
vsToolStripExtender.SetStyle(_mnuConnections, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
_cmbQuickConnect.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
_cmbQuickConnect.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
}
#region Quick Connect
@@ -235,7 +232,6 @@ namespace mRemoteNG.UI.Controls
private void ConnectionsMenuItem_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left) return;
if (((ToolStripMenuItem)sender).Tag is ContainerInfo) return;
var tag = ((ToolStripMenuItem)sender).Tag as ConnectionInfo;
if (tag != null)
{

View File

@@ -1,5 +1,4 @@
using System.Security;
using System.Windows.Forms;
using mRemoteNG.Security;
using mRemoteNG.UI.Controls.Base;

View File

@@ -1,6 +1,6 @@
namespace mRemoteNG.UI.Forms
{
partial class CompositeCredentialRepoUnlockerForm
sealed partial class CompositeCredentialRepoUnlockerForm
{
/// <summary>
/// Required designer variable.

View File

@@ -7,7 +7,7 @@ using mRemoteNG.Credential.Repositories;
namespace mRemoteNG.UI.Forms
{
public partial class CompositeCredentialRepoUnlockerForm : Form
public sealed partial class CompositeCredentialRepoUnlockerForm : Form
{
private readonly CompositeRepositoryUnlocker _repositoryUnlocker;
@@ -24,13 +24,11 @@ namespace mRemoteNG.UI.Forms
Themes.ThemeManager.getInstance().ThemeChanged += ApplyTheme;
}
public virtual void ApplyTheme()
private void ApplyTheme()
{
if (Themes.ThemeManager.getInstance().ThemingActive)
{
BackColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
ForeColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}
if (!Themes.ThemeManager.getInstance().ThemingActive) return;
BackColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
ForeColor = Themes.ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}
private void buttonUnlock_Click(object sender, EventArgs e)

View File

@@ -46,11 +46,9 @@ namespace mRemoteNG.UI.Forms
}
private void ApplyTheme()
{
if (Themes.ThemeManager.getInstance().ThemingActive)
{
BackColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
ForeColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}
if (!ThemeManager.getInstance().ThemingActive) return;
BackColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
ForeColor = ThemeManager.getInstance().ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}
private void ApplyLanguage()

View File

@@ -2,7 +2,7 @@
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
partial class CredentialEditorPage
sealed partial class CredentialEditorPage
{
/// <summary>
/// Required designer variable.

View File

@@ -3,11 +3,10 @@ using System.Windows.Forms;
using mRemoteNG.Credential;
using mRemoteNG.Security;
using mRemoteNG.UI.Controls.PageSequence;
using mRemoteNG.Themes;
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
public partial class CredentialEditorPage : SequencedControl
public sealed partial class CredentialEditorPage : SequencedControl
{
private readonly ICredentialRecord _credentialRecord;
private readonly ICredentialRepository _credentialRepository;

View File

@@ -2,7 +2,7 @@
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
partial class CredentialListPage
sealed partial class CredentialListPage
{
/// <summary>
/// Required designer variable.

View File

@@ -7,11 +7,10 @@ using BrightIdeasSoftware;
using mRemoteNG.Credential;
using mRemoteNG.Tree;
using mRemoteNG.UI.Controls.PageSequence;
using mRemoteNG.Themes;
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
public partial class CredentialListPage : SequencedControl, ICredentialManagerPage
public sealed partial class CredentialListPage : SequencedControl, ICredentialManagerPage
{
private readonly ICredentialRepositoryList _credentialRepositoryList;

View File

@@ -3,7 +3,7 @@ using mRemoteNG.Themes;
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
partial class CredentialRepositoriesPage
sealed partial class CredentialRepositoriesPage
{
/// <summary>
/// Required designer variable.

View File

@@ -7,11 +7,10 @@ using mRemoteNG.UI.Controls;
using mRemoteNG.UI.Controls.PageSequence;
using mRemoteNG.UI.Forms.CredentialManagerPages.CredentialRepositoryEditorPages;
using mRemoteNG.UI.Forms.CredentialManagerPages.CredentialRepositorySelectors;
using mRemoteNG.Themes;
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
public partial class CredentialRepositoriesPage : SequencedControl, ICredentialManagerPage
public sealed partial class CredentialRepositoriesPage : SequencedControl, ICredentialManagerPage
{
private readonly ICredentialRepositoryList _providerCatalog;
private readonly UnlockerFormFactory _unlockerFactory;

View File

@@ -3,7 +3,7 @@ using mRemoteNG.Themes;
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
partial class CredentialRepositorySelectionPage
sealed partial class CredentialRepositorySelectionPage
{
/// <summary>
/// Required designer variable.

View File

@@ -2,11 +2,10 @@
using System.Windows.Forms;
using mRemoteNG.Credential;
using mRemoteNG.UI.Controls.PageSequence;
using mRemoteNG.Themes;
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
public partial class CredentialRepositorySelectionPage : SequencedControl
public sealed partial class CredentialRepositorySelectionPage : SequencedControl
{
public CredentialRepositorySelectionPage(ICredentialRepositoryList credentialRepositoryList)
{

View File

@@ -2,7 +2,7 @@
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
partial class CredentialRepositoryTypeSelectionPage
sealed partial class CredentialRepositoryTypeSelectionPage
{
/// <summary>
/// Required designer variable.

View File

@@ -7,11 +7,10 @@ using mRemoteNG.Credential.Repositories;
using mRemoteNG.UI.Controls;
using mRemoteNG.UI.Controls.PageSequence;
using mRemoteNG.UI.Forms.CredentialManagerPages.CredentialRepositoryEditorPages;
using mRemoteNG.Themes;
namespace mRemoteNG.UI.Forms.CredentialManagerPages
{
public partial class CredentialRepositoryTypeSelectionPage : SequencedControl
public sealed partial class CredentialRepositoryTypeSelectionPage : SequencedControl
{
private readonly ICredentialRepositoryList _repositoryList;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;

View File

@@ -4,7 +4,6 @@ using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using mRemoteNG.App;
using mRemoteNG.Container;
using System.Drawing;
namespace mRemoteNG.UI.Window
{
@@ -26,7 +25,7 @@ namespace mRemoteNG.UI.Window
#endregion
public new void ApplyTheme()
private new void ApplyTheme()
{
base.ApplyTheme();
}

View File

@@ -1,6 +1,4 @@
using mRemoteNG.Themes;
using mRemoteNG.UI.Forms;
using System.Drawing;
using WeifenLuo.WinFormsUI.Docking;
// ReSharper disable UnusedAutoPropertyAccessor.Global
@@ -10,18 +8,11 @@ namespace mRemoteNG.UI.Window
public class BaseWindow : DockContent
{
#region Private Variables
private WindowType _WindowType;
private DockContent _DockPnl;
//private WindowType _WindowType;
//private DockContent _DockPnl;
private ThemeManager _themeManager;
#endregion
#region Constructors
public BaseWindow()
{
//InitializeComponent();
}
#endregion
#region Public Properties
protected WindowType WindowType { get; set; }
@@ -33,24 +24,18 @@ namespace mRemoteNG.UI.Window
#region Public Methods
public void SetFormText(string t)
{
this.Text = t;
this.TabText = t;
Text = t;
TabText = t;
}
#endregion
#region Private Methods
public new void ApplyTheme()
internal new void ApplyTheme()
{
if (!Tools.DesignModeTest.IsInDesignMode(this))
{
_themeManager = ThemeManager.getInstance();
if (_themeManager.ThemingActive)
{
this.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
this.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}
}
if (Tools.DesignModeTest.IsInDesignMode(this)) return;
_themeManager = ThemeManager.getInstance();
if (!_themeManager.ThemingActive) return;
BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Background");
ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Dialog_Foreground");
}

View File

@@ -1,6 +1,5 @@
using mRemoteNG.App;
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Tree;
using System;
using System.Collections.Generic;
@@ -77,23 +76,21 @@ namespace mRemoteNG.UI.Window
txtSearch.Text = Language.strSearchPrompt;
}
private void ApplyTheme()
private new void ApplyTheme()
{
if(_themeManager.ThemingActive)
{
vsToolStripExtender.SetStyle(msMain, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
vsToolStripExtender.SetStyle(_contextMenu, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
//Treelistview need to be manually themed
olvConnections.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TreeView_Background");
olvConnections.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TreeView_Foreground");
olvConnections.SelectedBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Active_Background");
olvConnections.SelectedForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Active_Foreground");
olvConnections.UnfocusedSelectedBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Inactive_Background");
olvConnections.UnfocusedSelectedForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Inactive_Foreground");
//There is a border around txtSearch that dont theme well
txtSearch.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
txtSearch.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
}
if (!_themeManager.ThemingActive) return;
vsToolStripExtender.SetStyle(msMain, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
vsToolStripExtender.SetStyle(_contextMenu, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
//Treelistview need to be manually themed
olvConnections.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TreeView_Background");
olvConnections.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TreeView_Foreground");
olvConnections.SelectedBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Active_Background");
olvConnections.SelectedForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Active_Foreground");
olvConnections.UnfocusedSelectedBackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Inactive_Background");
olvConnections.UnfocusedSelectedForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("Treeview_SelectedItem_Inactive_Foreground");
//There is a border around txtSearch that dont theme well
txtSearch.BackColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Background");
txtSearch.ForeColor = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Foreground");
}
#endregion

View File

@@ -7,9 +7,6 @@ using mRemoteNG.Tools;
using WeifenLuo.WinFormsUI.Docking;
using mRemoteNG.UI.Forms;
using mRemoteNG.Themes;
using System.Drawing;
using BrightIdeasSoftware;
using mRemoteNG.UI.Controls;
namespace mRemoteNG.UI.Window
{
@@ -228,29 +225,27 @@ namespace mRemoteNG.UI.Window
private new void ApplyTheme()
{
if(_themeManager.ThemingActive)
{
vsToolStripExtender.SetStyle(ToolStrip, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
vsToolStripExtender.SetStyle(ToolsContextMenuStrip, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
//Apply the extended palette
if (!_themeManager.ThemingActive) return;
vsToolStripExtender.SetStyle(ToolStrip, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
vsToolStripExtender.SetStyle(ToolsContextMenuStrip, _themeManager.ActiveTheme.Version, _themeManager.ActiveTheme.Theme);
//Apply the extended palette
ToolStripContainer.TopToolStripPanel.BackColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Background;
ToolStripContainer.TopToolStripPanel.ForeColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Text;
PropertiesGroupBox.BackColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Background;
PropertiesGroupBox.ForeColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Text;
//Toollist grouping
ToolsListObjView.AlwaysGroupByColumn = this.FilenameColumnHeader;
}
ToolStripContainer.TopToolStripPanel.BackColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Background;
ToolStripContainer.TopToolStripPanel.ForeColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Text;
PropertiesGroupBox.BackColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Background;
PropertiesGroupBox.ForeColor = _themeManager.ActiveTheme.Theme.ColorPalette.CommandBarMenuDefault.Text;
//Toollist grouping
ToolsListObjView.AlwaysGroupByColumn = this.FilenameColumnHeader;
}
private void UpdateToolsListObjView(ExternalTool selectTool = null)
{
try
{
var selectedTools = new List<ExternalTool>();
try
{
var selectedTools = new List<ExternalTool>();
if (selectTool == null)
if (selectTool == null)
{
foreach (Object listViewItem in ToolsListObjView.SelectedObjects)
foreach (var listViewItem in ToolsListObjView.SelectedObjects)
{
var externalTool = listViewItem as ExternalTool;
if (externalTool != null)
@@ -273,7 +268,7 @@ namespace mRemoteNG.UI.Window
{
Runtime.MessageCollector.AddExceptionMessage("UI.Window.ExternalTools.PopulateToolsListObjView()", ex);
}
}
}
private void LaunchTool()
{

View File

@@ -8,7 +8,6 @@ using mRemoteNG.Container;
using mRemoteNG.Messages;
using mRemoteNG.Tools;
using static mRemoteNG.Tools.MiscTools;
using System.Drawing;
namespace mRemoteNG.UI.Window
{
@@ -25,7 +24,7 @@ namespace mRemoteNG.UI.Window
}
#endregion
public new void ApplyTheme()
private new void ApplyTheme()
{
base.ApplyTheme();
}