~ubuntu-branches/ubuntu/maverick/unity/maverick

« back to all changes in this revision

Viewing changes to unity-private/launcher/scroller-view.vala

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-09-17 14:02:54 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20100917140254-6cbue12klia2f07l
Tags: 0.2.40-0ubuntu1
* New upstream release:
  - Fix inactive menus accessible (LP: #604505)
  - Fix some more memory leaks (LP: #604777, #621690, #628144)
  - Fix weird behaviors of quicklist (LP: #617339)
  - Provide an "open this folder" button (LP: #633201)
  - Hidden menu causing gap (LP: #600191)
  - Cannot go fullscreen for flash videos (LP: #631381)
  - Can't access menu items from the keyboard (LP: #636728)
  - Don't register for MDRAGs since they aren't used (LP: #632613)
  - Don't run indicator on special launchers (LP: #627488)
  - Center arrows position in folded launcher tiles (LP: #633084)
  - Launcher icons first appear as white upon login (LP: #601093)
  - Removes jittering when rubber band is in use on the launcher (LP: #632991)
  - Mutter restarts on closing almost any application (LP: #634701)
  - Can't launch apps like synaptic with root privileges from launch bar
    (LP: #599298)
  - Launcher tile dragging shouldn't be masked (LP: #631443)
  - Fix Carousel-ed icons have distorted perspective (LP: #607515)
  - Use no longer sync call (LP: #620011)
* update debian/libunity0.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
    private float last_known_pointer_x = 0.0f;
85
85
    private bool can_scroll = false;
86
86
 
 
87
    private float last_known_x = 0;
 
88
    private float last_known_y = 0;
 
89
 
87
90
    /*
88
91
     * scrolling variables
89
92
     */
264
267
 
265
268
      float x, y;
266
269
      event.get_coords (out x, out y);
 
270
      last_known_x = x;
 
271
      last_known_y = y;
267
272
      if (assume_on_launcher)
268
273
        x = 25;
269
274
 
299
304
        {
300
305
          // if picked_actor is null, then we want to send a leave event on the
301
306
          // previous actor
 
307
 
302
308
          Clutter.Event crossing_event =  { 0 };
303
309
          crossing_event.type = Clutter.EventType.LEAVE;
304
310
          crossing_event.crossing.x = x;
325
331
        {
326
332
          get_stage ().motion_event.disconnect (on_motion_event);
327
333
        }
 
334
 
328
335
      Clutter.Actor picked_actor = handle_event (event, is_scrolling);
329
336
 
330
337
      if (picked_actor is Clutter.Actor)
711
718
     */
712
719
    private void disable_animations_on_children (Clutter.Event event)
713
720
    {
 
721
/*
714
722
      disable_child_events = true;
715
723
 
716
724
      Clutter.Event e = { 0 };
729
737
              child.do_event (e, false);
730
738
            }
731
739
        }
 
740
*/
732
741
 
733
742
    }
734
743
 
795
804
      child.set_parent (this);
796
805
 
797
806
      // we only animate if the added child is not at the end
798
 
      if (model.index_of (child) == model.size -1)
799
 
        order_children (true);
800
 
      else
801
 
        order_children (false);
 
807
      float[] prev_positions = {};//new float [model.size];
 
808
      float[] prev_rotations = {};//new float [model.size];
 
809
 
 
810
      foreach (ScrollerChild modelchild in model)
 
811
        {
 
812
          prev_positions += modelchild.position;
 
813
          prev_rotations += modelchild.rotation;
 
814
        }
 
815
      order_children (true);
 
816
 
 
817
      int index = 0;
 
818
      foreach (ScrollerChild modelchild in model)
 
819
        {
 
820
          if (child != modelchild)
 
821
            {
 
822
              change_child_position_rotation (modelchild,
 
823
                                              prev_positions[index],
 
824
                                              prev_rotations[index],
 
825
                                              true);
 
826
            }
 
827
          index++;
 
828
        }
 
829
 
 
830
      order_children (false);
802
831
      queue_relayout ();
803
832
      child.notify["position"].connect (() => {
804
833
        queue_relayout ();
809
838
 
810
839
    private void model_child_removed (ScrollerChild child)
811
840
    {
812
 
      child_refs.add (child); // we need to keep a reference on it for now
813
 
      var anim = child.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
814
 
                                SHORT_DELAY,
815
 
                                "opacity", 0);
816
 
      anim.completed.connect (() => {
817
 
        child.unparent ();
818
 
        child_refs.remove (child);
819
 
      });
 
841
      var drag_controller = Drag.Controller.get_default ();
 
842
      if (drag_controller.is_dragging)
 
843
        {
 
844
          order_children (false);
 
845
          queue_relayout ();
 
846
        }
 
847
      else
 
848
        {
 
849
          child_refs.add (child); // we need to keep a reference on it for now
 
850
          var anim = child.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
 
851
                                    SHORT_DELAY,
 
852
                                    "opacity", 0);
820
853
 
821
 
      order_children (false);
822
 
      queue_relayout ();
 
854
          var icon_scale_anim = child.processed_icon.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
 
855
                                                              SHORT_DELAY,
 
856
                                                              "scale-x", 0.0,
 
857
                                                              "scale-y", 0.0);
 
858
          anim.completed.connect (() => {
 
859
            child.unparent ();
 
860
            child_refs.remove (child);
 
861
            order_children (false);
 
862
            queue_relayout ();
 
863
          });
 
864
        }
823
865
    }
824
866
 
825
867
    private void model_order_changed ()
839
881
          speed *= autoscroll_direction;
840
882
          move_scroll_position (speed, true);
841
883
          autoscroll_anim_active = is_autoscrolling;
 
884
 
 
885
          Clutter.Event motion_event =  { 0 };
 
886
          motion_event.type = Clutter.EventType.MOTION;
 
887
          motion_event.motion.x = last_known_x;
 
888
          motion_event.motion.y = last_known_y;
 
889
          motion_event.motion.stage = get_stage () as Clutter.Stage;
 
890
          motion_event.motion.flags = Clutter.EventFlags.FLAG_SYNTHETIC;
 
891
          passthrough_motion_event (motion_event);
 
892
 
842
893
          return is_autoscrolling;
843
894
        });
844
895
      }
1166
1217
      else
1167
1218
        cache.invalidate_texture_cache ();
1168
1219
 
 
1220
      Clutter.Event motion_event =  { 0 };
 
1221
      motion_event.type = Clutter.EventType.MOTION;
 
1222
      motion_event.motion.x = last_known_x;
 
1223
      motion_event.motion.y = last_known_y;
 
1224
      motion_event.motion.stage = get_stage () as Clutter.Stage;
 
1225
      motion_event.motion.flags = Clutter.EventFlags.FLAG_SYNTHETIC;
 
1226
      passthrough_motion_event (motion_event);
 
1227
 
1169
1228
      stored_delta = delta;
1170
1229
    }
1171
1230
 
1476
1535
          if (index >= index_start_flat && index < index_end_flat)
1477
1536
            {
1478
1537
              change_child_position_rotation (child, h, 0.0f, immediate);
1479
 
              h += nat_height + spacing;
 
1538
              h += 48 + spacing;
1480
1539
              num_children_handled++;
1481
1540
 
1482
1541
              if (index == index_start_flat)