AlignmentX = -1,
};
+ Button barChange = new Button(parent)
+ {
+ Text = "TitleTextColor & BarColor",
+ WeightX = 1,
+ AlignmentX = -1,
+ };
+
label.Show();
push.Show();
pop.Show();
insertBeforeTop.Show();
insertAfterTop.Show();
removeTop.Show();
+ barChange.Show();
push.Clicked += (s, e) =>
{
item.Delete();
Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer);
};
-
+
+ Random rand = new Random(DateTime.Now.Millisecond);
+ barChange.Clicked += (s, e) =>
+ {
+ int currentIndex = _navi.NavigationStack.Count - 1;
+ if (currentIndex >= 0)
+ {
+ _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next()));
+ }
+ };
+
box.PackEnd(label);
box.PackEnd(push);
box.PackEnd(pop);
box.PackEnd(insertBeforeTop);
box.PackEnd(insertAfterTop);
box.PackEnd(removeTop);
+ box.PackEnd(barChange);
return box;
}
return Interop.Elementary.elm_object_item_part_text_get(Handle, part);
}
+ public void SetPartColor(string part, Color color)
+ {
+ Interop.Elementary.elm_object_item_color_class_color_set(Handle, part, color.R * color.A / 255,
+ color.G * color.A / 255,
+ color.B * color.A / 255,
+ color.A);
+ }
+
+ public Color GetPartColor(string part)
+ {
+ int r, g, b, a;
+ Interop.Elementary.elm_object_item_color_class_color_get(Handle, part, out r, out g, out b, out a);
+ return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a);
+ }
+
public static implicit operator IntPtr(ItemObject obj)
{
if (obj == null)
{
EvasObject _content;
bool _isPopped;
+ Color _barBackgroundColor = Color.Default;
Interop.Elementary.Elm_Naviframe_Item_Pop_Cb _popped;
NaviItem(IntPtr handle, EvasObject content) : base(handle)
}
}
+ public Color TitleBarBackgroundColor
+ {
+ get
+ {
+ return _barBackgroundColor;
+ }
+ set
+ {
+ if (value.IsDefault)
+ {
+ Console.WriteLine("ItemObject instance doesn't support to set TitleBarBackgroundColor to Color.Default.");
+ //TODO. Soon we will support the "elm_object_item_color_class_del" function in EFL.
+ }
+ else
+ {
+ SetPartColor("bg_title", value);
+ _barBackgroundColor = value;
+ }
+ }
+ }
+
protected override void OnInvalidate()
{
if (!_isPopped)
}
[DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_color_class_color_get(IntPtr obj, string part, out int r, out int g, out int b, out int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_color_class_del(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
[DllImport(Libraries.Elementary)]
-%define DEV_VERSION beta-003
+%define DEV_VERSION beta-004
Name: elm-sharp
Summary: C# Binding for Elementary