aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/MenuItem.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-12-04 14:09:07 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-12-04 14:09:07 +0100
commit9d381671ec0b1266448eddbf4c4935cdc7d23a9f (patch)
tree34e9b4b0296eea8dba03024491934413bcd54083 /src/GraphicObjects/MenuItem.cs
parenta64627699d4919d389522d92032ce4f05704d313 (diff)
docking save/restore; use image surfaces as cache for graphic object instead of backend similar which blink too much
Diffstat (limited to 'src/GraphicObjects/MenuItem.cs')
-rw-r--r--src/GraphicObjects/MenuItem.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/GraphicObjects/MenuItem.cs b/src/GraphicObjects/MenuItem.cs
index 47bd978f..3b25a9fe 100644
--- a/src/GraphicObjects/MenuItem.cs
+++ b/src/GraphicObjects/MenuItem.cs
@@ -46,7 +46,7 @@ namespace Crow
Measure popWidth, popHeight;
#region Public properties
- [XmlAttributeAttribute][DefaultValue(false)]
+ [DefaultValue(false)]
public bool IsOpened {
get { return isOpened; }
set {
@@ -58,12 +58,12 @@ namespace Crow
if (isOpened) {
onOpen (this, null);
if (LogicalParent is Menu)
- (LogicalParent as Menu).AutomaticOpenning = true;
+ (LogicalParent as Menu).AutomaticOpening = true;
}else
onClose (this, null);
}
}
- [XmlAttributeAttribute][DefaultValue(null)]
+ [DefaultValue(null)]
public virtual Command Command {
get { return command; }
set {
@@ -148,7 +148,7 @@ namespace Crow
closeMenu ();
}
if(!IsOpened)
- (LogicalParent as Menu).AutomaticOpenning = false;
+ (LogicalParent as Menu).AutomaticOpening = false;
}
protected virtual void onOpen (object sender, EventArgs e){
Open.Raise (this, null);
@@ -167,7 +167,7 @@ namespace Crow
Menu menu = LogicalParent as Menu;
if (menu == null)
return;
- if (menu.AutomaticOpenning && items.Children.Count>0)
+ if (menu.AutomaticOpening && items.Children.Count>0)
IsOpened = true;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
@@ -181,6 +181,8 @@ namespace Crow
MenuItem tmp = LogicalParent as MenuItem;
while (tmp != null) {
tmp.IsOpened = false;
+ tmp.Background = Color.Transparent;
+ tmp.AutomaticOpening = false;
tmp = tmp.LogicalParent as MenuItem;
}
}