Merge pull request #4339 from jlewin/master

Only show mouse down/highlight colors when popup closed
This commit is contained in:
johnlewin 2019-03-10 09:39:03 -07:00 committed by GitHub
commit aaaa4e21d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 25 additions and 13 deletions

View file

@ -211,6 +211,7 @@ namespace MatterHackers.MatterControl
public Color BedBackgroundColor { get; set; }
public Color PrimaryAccentColor { get; set; }
public Color SectionBackgroundColor { get; set; }
public Color PopupBorderColor { get; set; }
public GuiWidget CreateSearchButton()
{

View file

@ -34,7 +34,7 @@ namespace MatterHackers.MatterControl
{
public class ThemeSet
{
public static int LatestSchemeVersion { get; } = 20181103;
public static int LatestSchemeVersion { get; } = 20190309;
/// <summary>
/// The identifier to use for this combination of accent colors, theme and menu theme

View file

@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl
this.MenuItemsBorderColor = menuTheme.DropList.Open.BackgroundColor;
// Popup border color
this.PopupBorderColor = AppContext.MenuTheme.BorderColor40;
this.PopupBorderColor = theme.PopupBorderColor;
this.theme = theme;

View file

@ -37,7 +37,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
public class DropButton : SimpleButton
{
public bool MenuVisible { get; private set; }
public bool MenuVisible { get; private set; }
public DropButton(ThemeConfig theme)
: base(theme)

View file

@ -44,8 +44,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
this.theme = theme;
this.DisabledColor = theme.DisabledColor;
this.HoverColor = theme.MinimalShade;
this.PopupBorderColor = AppContext.MenuTheme.BorderColor40;
this.HoverColor = theme.SlightShade;
this.MouseDownColor = theme.MinimalShade;
this.PopupBorderColor = theme.PopupBorderColor;
}
public PopupMenuButton(ImageBuffer imageBuffer, ThemeConfig theme)
@ -65,7 +66,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.HoverColor = theme.ToolbarButtonHover;
this.BackgroundColor = theme.ToolbarButtonBackground;
this.MouseDownColor = theme.ToolbarButtonDown;
this.PopupBorderColor = AppContext.MenuTheme.BorderColor40;
this.PopupBorderColor = theme.PopupBorderColor;
}
public PopupMenuButton(string text, ThemeConfig theme)
@ -139,13 +140,15 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
get
{
if (this.MouseCaptured
if (!menuVisible
&& this.MouseCaptured
&& mouseInBounds
&& this.Enabled)
{
return this.MouseDownColor;
}
else if (this.mouseInBounds
else if (!menuVisible
&& this.mouseInBounds
&& this.Enabled)
{
return this.HoverColor;

View file

@ -209,7 +209,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
new Stroke(
new RoundedRect(popup.Widget.LocalBounds, 0),
borderWidth * 2),
AppContext.MenuTheme.BorderColor40);
AppContext.Theme.PopupBorderColor);
}
void widgetRelativeTo_PositionChanged(object sender, EventArgs e)

View file

@ -79,7 +79,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
BackgroundColor = menuTheme.BackgroundColor
};
printPanel.AddChild(new TextWidget("Options".Localize(), textColor: menuTheme.TextColor)
printPanel.AddChild(new TextWidget("Options".Localize(), textColor: menuTheme.TextColor, pointSize: theme.DefaultFontSize)
{
HAnchor = HAnchor.Left
});
@ -91,7 +91,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
VAnchor = VAnchor.Fit,
Padding = 5,
MinimumSize = new Vector2(400, 65),
Margin = new BorderDouble(top: 10),
};
printPanel.AddChild(optionsPanel);

View file

@ -305,7 +305,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
bedMenuButton = new PopupMenuButton(AggContext.StaticData.LoadIcon("bed.png", 16, 16, theme.InvertIcons), theme)
{
Name = "Bed Options Menu",
//ToolTipText = "Options",
ToolTipText = "Bed",
Enabled = true,
Margin = theme.ButtonSpacing,
VAnchor = VAnchor.Center,

View file

@ -46,6 +46,7 @@
"BorderColor": "#C8C8C8",
"BorderColor40": "#2B2B2B",
"BorderColor20": "#383838",
"PopupBorderColor": "#222",
"RowBorder": "#424242",
"DropList": {
"Open": {

View file

@ -46,6 +46,7 @@
"BorderColor": "#333333",
"BorderColor40": "#A3A3A3",
"BorderColor20": "#B8B8B8",
"PopupBorderColor": "#aaa",
"RowBorder": "#A6A6A6",
"DropList": {
"Open": {

View file

@ -47,6 +47,7 @@
"BorderColor": "#555",
"BorderColor40": "#555555",
"BorderColor20": "#ccc",
"PopupBorderColor": "#ccc",
"RowBorder": "#ddd",
"DropList": {
"Open": {

View file

@ -44,6 +44,7 @@
"BorderColor": "#333333",
"BorderColor40": "#00000066",
"BorderColor20": "#00000044",
"PopupBorderColor": "#aaa",
"RowBorder": "#ddd",
"DropList": {
"Open": {

View file

@ -44,6 +44,7 @@
"BorderColor": "#C8C8C8",
"BorderColor40": "#00000000",
"BorderColor20": "#00000000",
"PopupBorderColor": "#2D2D2D",
"RowBorder": "#333",
"DropList": {
"Open": {

View file

@ -44,8 +44,9 @@
},
"LightTextColor": "#00000000",
"BorderColor": "#BBBBBB",
"BorderColor40": "#555555",
"BorderColor40": "#333",
"BorderColor20": "#444444",
"PopupBorderColor": "#2a2a2a",
"RowBorder": "#333333",
"DropList": {
"Open": {

View file

@ -46,6 +46,7 @@
"BorderColor": "#839496",
"BorderColor40": "#094453",
"BorderColor20": "#073642",
"PopupBorderColor": "#001F28",
"RowBorder": "#00303D",
"DropList": {
"Open": {

View file

@ -44,6 +44,7 @@
"BorderColor": "#666666",
"BorderColor40": "#D3C492",
"BorderColor20": "#F3EFE2",
"PopupBorderColor": "#ccc",
"RowBorder": "#dedede",
"DropList": {
"Open": {

View file

@ -46,6 +46,7 @@
"BorderColor": "#657B83",
"BorderColor40": "#D3C492",
"BorderColor20": "#F3EFE2",
"PopupBorderColor": "#D5CFBF",
"RowBorder": "#DBD9CB",
"DropList": {
"Open": {