~bregma/unity/lp-1302955-trusty

« back to all changes in this revision

Viewing changes to lockscreen/LockScreenPanel.cpp

  • Committer: CI Train Bot
  • Author(s): Stephen M. Webb, Marco Trevisan (Treviño)
  • Date: 2014-12-17 20:51:55 UTC
  • mfrom: (3805.2.22 7.2.4)
  • Revision ID: ci-train-bot@canonical.com-20141217205155-5c1r3asyuljen2bf
release 7.2.4 Fixes: #796527, #1059275, #1066971, #1237132, #1276177, #1292218, #1299741, #1301776, #1302885, #1305440, #1308540, #1316265, #1324104, #1328677, #1329584, #1332509, #1332947, #1349281, #1350331, #1353070, #1354498, #1361679, #1361713, #1361751, #1362162, #1362346, #1364225, #1368427, #1370017, #1371764, #1373695, #1374785, #1375271, #1383468, #1384910, #1384958, #1385285
Approved by: Marco Trevisan (Treviño)

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
  indicators_->on_entry_activate_request.connect(sigc::mem_fun(this, &Panel::OnEntryActivateRequest));
83
83
 
84
84
  monitor.changed.connect([this, hostname] (int monitor) {
85
 
    hostname->SetScale(unity::Settings::Instance().em(monitor)->DPIScale());
 
85
    double scale = unity::Settings::Instance().em(monitor)->DPIScale();
 
86
    hostname->SetScale(scale);
 
87
    static_cast<nux::HLayout*>(GetLayout())->SetLeftAndRightPadding(PADDING.CP(scale), 0);
86
88
    indicators_view_->SetMonitor(monitor);
87
89
    BuildTexture();
88
90
    QueueRelayout();
108
110
    return;
109
111
 
110
112
  indicators_view_->AddIndicator(indicator);
 
113
 
 
114
  if (!active)
 
115
  {
 
116
    for (auto const& entry : indicator->GetEntries())
 
117
    {
 
118
      if (entry->active())
 
119
      {
 
120
        active = true;
 
121
        indicators_view_->ActivateEntry(entry->id());
 
122
        OnEntryActivated(GetPanelName(), entry->id(), entry->geometry());
 
123
        break;
 
124
      }
 
125
    }
 
126
  }
 
127
 
111
128
  QueueRelayout();
112
129
  QueueDraw();
113
130
}
114
131
 
115
132
void Panel::RemoveIndicator(indicator::Indicator::Ptr const& indicator)
116
133
{
 
134
  if (active)
 
135
  {
 
136
    for (auto const& entry : indicator->GetEntries())
 
137
    {
 
138
      if (entry->active())
 
139
      {
 
140
        active = false;
 
141
        break;
 
142
      }
 
143
    }
 
144
  }
 
145
 
117
146
  indicators_view_->RemoveIndicator(indicator);
118
147
  QueueRelayout();
119
148
  QueueDraw();
121
150
 
122
151
std::string Panel::GetPanelName() const
123
152
{
124
 
  return "LockScreenPanel" + std::to_string(monitor);
 
153
  return "LockScreenPanel";
125
154
}
126
155
 
127
156
void Panel::OnIndicatorViewUpdated()