32
32
namespace ClutterFlow.Buttons
35
public class ClutterSliderHandleButton : ClutterButton
37
protected Clutter.Text label;
39
get { return label.Value; }
41
if (value!=label.Value) {
48
public ClutterSliderHandleButton(uint width, uint height, int state) : base(width, height, state) {
49
label = new Text("Sans Bold 10", "", new Clutter.Color(0.0f,0.0f,0.0f,0.8f));
51
label.SetAnchorPoint (label.Width*0.5f, label.Height*0.5f);
52
label.SetPosition (this.Width*0.5f,this.Height*0.5f);
56
public override void Update ()
59
label.SetAnchorPoint (label.Width*0.5f, label.Height*0.5f);
60
label.SetPosition (this.Width*0.5f,this.Height*0.5f);
65
protected override void CreateTexture (Clutter.CairoTexture texture, int with_state) {
67
Cairo.Context context = texture.Create();
69
context.Translate(texture.Width*0.5,texture.Height*0.5);
70
context.Arc(0,0,(texture.Height-1)*0.5,0,2*Math.PI);
72
context.SetSourceRGBA(1.0,1.0,1.0, with_state==0 ? 0.3 : (with_state==1 ? 0.5 : 0.7));
73
context.FillPreserve();
74
context.SetSourceRGB(1.0,1.0,1.0);
75
context.LineWidth = 1;
78
((IDisposable) context.Target).Dispose();
79
((IDisposable) context).Dispose();
35
public class ClutterSliderHandleButton : ClutterButton
37
protected Clutter.Text label;
39
get { return label.Value; }
41
if (value!=label.Value) {
48
public ClutterSliderHandleButton(uint width, uint height, int state) : base(width, height, state) {
49
label = new Text("Sans Bold 10", "", new Clutter.Color(0.0f,0.0f,0.0f,0.8f));
51
label.SetAnchorPoint (label.Width*0.5f, label.Height*0.5f);
52
label.SetPosition (this.Width*0.5f,this.Height*0.5f);
56
public override void Update ()
59
label.SetAnchorPoint (label.Width*0.5f, label.Height*0.5f);
60
label.SetPosition (this.Width*0.5f,this.Height*0.5f);
65
protected override void CreateTexture (Clutter.CairoTexture texture, int with_state) {
67
Cairo.Context context = texture.Create ();
69
context.Translate(texture.Width*0.5,texture.Height*0.5);
70
context.Arc(0,0,(texture.Height-1)*0.5,0,2*Math.PI);
72
context.SetSourceRGBA(1.0,1.0,1.0, with_state==0 ? 0.3 : (with_state==1 ? 0.5 : 0.7));
73
context.FillPreserve();
74
context.SetSourceRGB(1.0,1.0,1.0);
75
context.LineWidth = 1;
78
((IDisposable) context.Target).Dispose();
79
((IDisposable) context).Dispose();
b'\\ No newline at end of file'