~sethj/ubuntu/wily/unity/fix-for-1445595

« back to all changes in this revision

Viewing changes to dash/PlacesGroup.cpp

  • Committer: Daniel van Vugt
  • Date: 2012-10-11 01:44:15 UTC
  • mfrom: (2826 trunk)
  • mto: This revision was merged to the branch mainline in revision 2847.
  • Revision ID: daniel.van.vugt@canonical.com-20121011014415-jvudq1d7bn1z268j
Merge latest lp:unity and fix a conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <UnityCore/GLibWrapper.h>
32
32
 
33
33
#include "unity-shared/StaticCairoText.h"
34
 
#include "unity-shared/DashStyle.h"
35
 
#include "unity-shared/LineSeparator.h"
36
34
#include "unity-shared/ubus-server.h"
37
35
#include "unity-shared/UBusMessages.h"
38
36
 
112
110
 
113
111
NUX_IMPLEMENT_OBJECT_TYPE(PlacesGroup);
114
112
 
115
 
PlacesGroup::PlacesGroup()
 
113
PlacesGroup::PlacesGroup(dash::StyleInterface& style)
116
114
  : nux::View(NUX_TRACKER_LOCATION),
 
115
    _style(style),
117
116
    _child_view(nullptr),
118
117
    _is_expanded(false),
119
118
    _n_visible_items_in_unexpand_mode(0),
122
121
    _coverflow_enabled(false),
123
122
    disabled_header_count_(false)
124
123
{
125
 
  dash::Style& style = dash::Style::Instance();
126
 
 
127
124
  SetAcceptKeyNavFocusOnMouseDown(false);
128
125
  SetAcceptKeyNavFocusOnMouseEnter(false);
129
126
 
130
 
  nux::BaseTexture* arrow = style.GetGroupUnexpandIcon();
 
127
  nux::BaseTexture* arrow = _style.GetGroupExpandIcon();
131
128
  
132
 
  _background = style.GetCategoryBackground();
133
 
  _background_nofilters = style.GetCategoryBackgroundNoFilters();
 
129
  _background = _style.GetCategoryBackground();
 
130
  _background_nofilters = _style.GetCategoryBackgroundNoFilters();
134
131
 
135
132
  nux::ROPConfig rop;
136
133
  rop.Blend = true;
154
151
  _group_layout->AddView(_header_view, 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_FULL);
155
152
 
156
153
  _header_layout = new nux::HLayout(NUX_TRACKER_LOCATION);
157
 
  _header_layout->SetLeftAndRightPadding(style.GetCategoryHeaderLeftPadding(), 0);
 
154
  _header_layout->SetLeftAndRightPadding(_style.GetCategoryHeaderLeftPadding(), 0);
158
155
  _header_layout->SetSpaceBetweenChildren(10);
159
156
  _header_view->SetLayout(_header_layout);
160
157
 
449
446
  // only the width matters
450
447
  if (_cached_geometry.GetWidth() != geo.GetWidth())
451
448
  {
452
 
    _focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));
 
449
    _focus_layer.reset(_style.FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));
453
450
    _cached_geometry = geo;
454
451
  }
455
452
  return ret;
512
509
 
513
510
}
514
511
 
515
 
void PlacesGroup::PostDraw(nux::GraphicsEngine& graphics_engine,
516
 
                           bool                 forceDraw)
517
 
{
518
 
}
519
 
 
520
512
void
521
513
PlacesGroup::SetCategoryIndex(unsigned index)
522
514
{
557
549
 
558
550
  Refresh();
559
551
 
560
 
  dash::Style& style = dash::Style::Instance();
561
552
  if (_is_expanded)
562
 
    _expand_icon->SetTexture(style.GetGroupUnexpandIcon());
 
553
    _expand_icon->SetTexture(_style.GetGroupUnexpandIcon());
563
554
  else
564
 
    _expand_icon->SetTexture(style.GetGroupExpandIcon());
 
555
    _expand_icon->SetTexture(_style.GetGroupExpandIcon());
565
556
 
566
557
  expanded.emit(this);
567
558
}