~unity-team/unity/unity.launcher-touch-drag

« back to all changes in this revision

Viewing changes to unity-private/panel/panel-home-button.vala

  • Committer: Mirco Müller
  • Date: 2010-09-14 13:39:18 UTC
  • mfrom: (495.3.3 unity.fix-636602)
  • Revision ID: mirco.mueller@ubuntu.com-20100914133918-qj21a2j52hl2cc52
added:
  unity-private/panel/panel-divider.vala
modified:
  unity-private/Makefile.am
  unity-private/panel/panel-home-button.vala
  unity-private/panel/panel-view.vala
  
Merged branch unity.fix-636602 after review and approval from Gordon.
A new class called Unity.Panel.Divider is added. This adds a special
Ctk.Image actor between the home-button and menubar/window-buttons to
hold the dividing groove artwork. Fixes LP: #636602. This needs
unity-asset-pool rev. 44.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    private Clutter.Texture bfb_bg_normal;
29
29
    private Clutter.Texture bfb_bg_prelight;
30
30
    private Clutter.Texture bfb_bg_active;
31
 
    private bool search_shown;
32
31
 
33
32
    public HomeButton (Shell shell)
34
33
    {
52
51
 
53
52
      notify["state"].connect (on_state_changed);
54
53
 
55
 
      width += 3.0f;
 
54
      //width += 3.0f;
56
55
 
57
56
      glow = new Ctk.EffectGlow ();
58
57
      glow.set_color ({ 255, 255, 255, 255 });
98
97
      set_background_for_state (Ctk.ActorState.STATE_NORMAL, bfb_bg_normal);
99
98
      set_background_for_state (Ctk.ActorState.STATE_PRELIGHT, bfb_bg_prelight);
100
99
      set_background_for_state (Ctk.ActorState.STATE_ACTIVE, bfb_bg_active);
101
 
 
102
 
      search_shown = false;
103
100
    }
104
101
 
105
102
    private override void allocate (Clutter.ActorBox        box,
111
108
      float       pheight;
112
109
      Ctk.Padding pad = { 0 };
113
110
 
114
 
      // 2.0f are added so the home-button groove aligns with the
115
 
      // right edge of the launcher, this fixes LP: #630031
116
 
      lwidth  = 2.0f + (float) shell.get_launcher_width_foobar ();
 
111
      // 1.0f are subtracted so the groove dividing home-button and
 
112
      // the rest of the panel aligns with the right edge of the
 
113
      // launcher, this fixes LP: #630031
 
114
      lwidth  = (float) shell.get_launcher_width_foobar () - 1.0f;
117
115
      pheight = (float) shell.get_panel_height_foobar ();
118
116
      theme_image.get_preferred_size (out cwidth, out cheight,
119
117
                                           out cwidth, out cheight);
180
178
                                               out float min_width,
181
179
                                               out float nat_width)
182
180
    {
183
 
      // 2.0f are added so the home-button groove aligns with the
184
 
      // right edge of the launcher, this fixes LP: #630031
185
 
      min_width = 2.0f + shell.get_launcher_width_foobar ();
186
 
      nat_width = 2.0f + shell.get_launcher_width_foobar ();
 
181
      // 1.0f are subtracted so the groove dividing home-button and
 
182
      // the rest of the panel aligns with the right edge of the
 
183
      // launcher, this fixes LP: #630031
 
184
      min_width = shell.get_launcher_width_foobar () - 1.0f;
 
185
      nat_width = shell.get_launcher_width_foobar () - 1.0f;
187
186
    }
188
187
 
189
188
    private void on_mode_changed (ShellMode mode)
193
192
          set_background_for_state (Ctk.ActorState.STATE_NORMAL, bfb_bg_normal);
194
193
          set_background_for_state (Ctk.ActorState.STATE_PRELIGHT, bfb_bg_prelight);
195
194
          set_background_for_state (Ctk.ActorState.STATE_ACTIVE, bfb_bg_active);
196
 
          search_shown = false;
197
195
        }
198
196
      else
199
197
        {
200
198
          set_background_for_state (Ctk.ActorState.STATE_NORMAL, null);
201
199
          set_background_for_state (Ctk.ActorState.STATE_PRELIGHT, null);
202
200
          set_background_for_state (Ctk.ActorState.STATE_ACTIVE, null);
203
 
          search_shown = true;
204
201
        }
205
202
 
206
203
      do_queue_redraw ();