Avoiding warnings by creating structs without new operator.

This commit is contained in:
Kolan Sh 2017-08-19 00:07:04 +03:00
parent f2e220b92e
commit 8832d6e6c8
3 changed files with 16 additions and 16 deletions

View File

@ -61,8 +61,8 @@ namespace Gtk.CairoChart {
[Compact]
public class Text {
public string text = "";
public FontStyle style = new FontStyle ();
public Color color = new Color();
public FontStyle style = FontStyle ();
public Color color = Color();
TextExtents get_extents (Cairo.Context context) {
context.select_font_face (style.family,
@ -99,8 +99,8 @@ namespace Gtk.CairoChart {
}
public Text (string text = "",
FontStyle style = new FontStyle(),
Color color = new Color()) {
FontStyle style = FontStyle(),
Color color = Color()) {
this.text = text;
this.style = style;
this.color = color;

View File

@ -13,7 +13,7 @@ namespace Gtk.CairoChart {
public Color bg_color;
public bool show_legend = true;
public Text title = new Text ("Cairo Chart");
public Color border_color = new Color(0, 0, 0, 0.3);
public Color border_color = Color(0, 0, 0, 0.3);
public class Legend {
public enum Position {
@ -23,13 +23,13 @@ namespace Gtk.CairoChart {
BOTTOM
}
public Position position = Position.TOP;
public FontStyle font_style = new FontStyle();
public Color bg_color = new Color(1, 1, 1);
public FontStyle font_style = FontStyle();
public Color bg_color = Color(1, 1, 1);
public LineStyle border_style = new LineStyle ();
public double indent = 5;
public Legend () {
border_style.color = new Color (0, 0, 0, 0.3);
border_style.color = Color (0, 0, 0, 0.3);
}
}
@ -40,7 +40,7 @@ namespace Gtk.CairoChart {
protected LineStyle selection_style = new LineStyle ();
public Chart () {
bg_color = new Color (1, 1, 1);
bg_color = Color (1, 1, 1);
}
protected Double128 cur_x_min = 0.0;
@ -108,7 +108,7 @@ namespace Gtk.CairoChart {
if (context != null) {
set_source_rgba (bg_color);
context.paint();
set_source_rgba (new Color (0, 0, 0, 1));
set_source_rgba (Color (0, 0, 0, 1));
}
}

View File

@ -82,8 +82,8 @@ namespace Gtk.CairoChart {
}
default = 2;
}
public FontStyle font_style = new FontStyle ();
public Color color = new Color ();
public FontStyle font_style = FontStyle ();
public Color color = Color ();
public LineStyle line_style = new LineStyle ();
public double font_indent = 5;
@ -153,17 +153,17 @@ namespace Gtk.CairoChart {
grid.line_style.color = _color;
grid.line_style.color.alpha = 0.5;
}
default = new Color (0.0, 0.0, 0.0, 1.0);
default = Color (0.0, 0.0, 0.0, 1.0);
}
public Series () {
}
public class LabelStyle {
FontStyle font_style = new FontStyle();
FontStyle font_style = FontStyle();
LineStyle frame_line_style = new LineStyle();
Color bg_color = new Color();
Color frame_color = new Color();
Color bg_color = Color();
Color frame_color = Color();
}
}
}