Merge lp:~julien-spautz/slingshot/remove-unused-file into lp:~elementary-pantheon/slingshot/trunk

Proposed by Julien Spautz on 2014-08-16
Status: Merged
Approved by: Cody Garver on 2014-08-31
Approved revision: 441
Merged at revision: 447
Proposed branch: lp:~julien-spautz/slingshot/remove-unused-file
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 196 lines (+0/-192)
1 file modified
src/Widgets/Slider.vala (+0/-192)
To merge this branch: bzr merge lp:~julien-spautz/slingshot/remove-unused-file
Reviewer Review Type Date Requested Status
elementary Pantheon team 2014-08-16 Pending
Review via email: mp+231078@code.launchpad.net

Commit message

Remove unused file Slider.vala

Description of the change

Remove unused file slider.vala

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'src/Widgets/Slider.vala'
2--- src/Widgets/Slider.vala 2012-08-21 17:02:33 +0000
3+++ src/Widgets/Slider.vala 1970-01-01 00:00:00 +0000
4@@ -1,192 +0,0 @@
5-public interface Slingshot.Slider : Gtk.Widget {
6- public abstract void slide_to (Gtk.Widget w);
7- public abstract void slide_from (Gtk.Widget w);
8- public abstract void slide_fade (Gtk.Widget w);
9-}
10-
11-public class Slingshot.SliderClutter : GtkClutter.Embed, Slider
12-{
13- const Clutter.AnimationMode anim_mode = Clutter.AnimationMode.EASE_IN_OUT_SINE;
14- Clutter.Container stage;
15- GtkClutter.Actor active_actor;
16- GtkClutter.Actor next_actor;
17- Gtk.Widget active_w;
18- public int sens = 1;
19- construct
20- {
21- stage = get_stage() as Clutter.Container;
22- assert(stage != null);
23- size_allocate.connect(on_size_allocate);
24- children = new List<Gtk.Widget>();
25- }
26-
27- public void on_size_allocate(Gtk.Allocation rect)
28- {
29- if(rect.width != 0.0)
30- {
31- float width = (float)get_allocated_width();
32- active_actor.width = width;
33- active_actor.height = (float)rect.height;
34- }
35- }
36-
37- public void slide(Gtk.Widget w)
38- {
39- if(sens == 0)
40- slide_to(w);
41- else if(sens == 1)
42- slide_from(w);
43- else if(sens == 2)
44- slide_fade(w);
45- }
46-
47- public void slide_to(Gtk.Widget w)
48- {
49- first = true;
50- if(active_actor == null)
51- {
52- active_actor = new GtkClutter.Actor();
53- (active_actor.get_widget() as Gtk.Bin).add(w);
54- stage.add_actor(active_actor);
55- w.show_all ();
56- show_all();
57- }
58- else
59- {
60- //if(next_actor != null) next_actor.destroy();
61- next_actor = active_actor;
62-
63- active_actor = new GtkClutter.Actor();
64- put_widget_in_actor (active_actor, w);
65- active_actor.x = get_allocated_width();
66- active_actor.animate(anim_mode, 300, x: 0.0);
67- double width = (double)get_allocated_width();
68- next_actor.animate(anim_mode, 300, x: -width);
69-
70- stage.add_actor(active_actor);
71- w.show_all ();
72- show_all();
73-
74- }
75- active_w = w;
76- }
77-
78- void put_widget_in_actor (GtkClutter.Actor active_actor, Gtk.Widget w) {
79-
80- if (w.get_parent () == null)
81- (active_actor.get_widget() as Gtk.Bin).add(w);
82- else
83- w.reparent((active_actor.get_widget() as Gtk.Bin));
84- active_actor.width = get_allocated_width();
85- active_actor.height = get_allocated_height();
86- }
87-
88- public void slide_fade(Gtk.Widget w)
89- {
90- first = true;
91- if(active_actor == null)
92- {
93- active_actor = new GtkClutter.Actor();
94- (active_actor.get_widget() as Gtk.Bin).add(w);
95- stage.add_actor(active_actor);
96- w.show_all ();
97- show_all();
98- }
99- else
100- {
101- //if(next_actor != null) next_actor.destroy();
102- next_actor = active_actor;
103-
104- active_actor = new GtkClutter.Actor();
105- put_widget_in_actor (active_actor, w);
106- active_actor.x = 0.0f;
107- active_actor.opacity = 0;
108- active_actor.animate(Clutter.AnimationMode.EASE_OUT_QUAD, 400, opacity:255);
109- next_actor.animate(Clutter.AnimationMode.EASE_OUT_QUAD, 400, opacity:0);
110-
111- stage.add_actor(active_actor);
112- w.show_all ();
113- show_all();
114-
115- }
116- active_w = w;
117- }
118-
119- public void slide_from(Gtk.Widget w)
120- {
121- first = true;
122- if(active_actor == null)
123- {
124- active_actor = new GtkClutter.Actor();
125- (active_actor.get_widget() as Gtk.Bin).add(w);
126- stage.add_actor(active_actor);
127- w.show_all ();
128- show_all();
129- }
130- else
131- {
132- //if(next_actor != null) next_actor.destroy();
133- next_actor = active_actor;
134-
135- active_actor = new GtkClutter.Actor();
136- put_widget_in_actor (active_actor, w);
137- active_actor.x = -get_allocated_width();
138- active_actor.animate(anim_mode, 300, x: 0.0);
139- double width = (double)get_allocated_width();
140- next_actor.animate(anim_mode, 300, x: width);
141-
142- stage.add_actor(active_actor);
143- w.show_all ();
144- show_all();
145-
146- }
147- active_w = w;
148- }
149-
150-
151- internal List<Gtk.Widget> children;
152-
153- bool first = true;
154- int max_height = 0;
155- public override void get_preferred_height(out int size1, out int size2){
156- active_w.get_preferred_height(out size1, out size2);
157- max_height = size1 = size2 = int.max(max_height, size2);
158-
159- }
160- int max_width = 0;
161- public override void get_preferred_width(out int size1, out int size2){
162- active_w.get_preferred_width(out size1, out size2);
163- max_width = size1 = size2 = int.max(max_width, size2);
164-
165- }
166-}
167-
168-public class Slingshot.SliderFall : Gtk.Grid, Slider {
169-
170- public SliderFall () {
171- }
172-
173- Gtk.Widget? old_w = null;
174- public void slide_to (Gtk.Widget w) {
175- if (old_w != null) remove (old_w);
176- w.hexpand = w.vexpand = true;
177- add (w);
178- old_w = w;
179- show_all ();
180- }
181- public void slide_from (Gtk.Widget w) {
182- slide_to (w);
183- }
184- public void slide_fade (Gtk.Widget w) {
185- slide_to (w);
186- }
187-}
188-
189-public Slingshot.Slider get_slider () {
190- unowned string[] a = null;
191- if (GtkClutter.init (ref a) == Clutter.InitError.SUCCESS) {
192- return new Slingshot.SliderClutter ();
193- }
194- else
195- return new Slingshot.SliderFall ();
196-}

Subscribers

People subscribed via source and target branches