1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2013 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
20
#include "LockScreenShield.h"
22
#include <NuxCore/Color.h> // FIXME: remove this
29
Shield::Shield(bool is_primary)
32
SetBackgroundColor(is_primary ? nux::color::Red : nux::color::Yellow);
34
mouse_enter.connect(sigc::mem_fun(this, &Shield::OnMouseEnter));
35
mouse_leave.connect(sigc::mem_fun(this, &Shield::OnMouseLeave));
36
primary.changed.connect(sigc::mem_fun(this, &Shield::OnPrimaryChanged));
39
void Shield::OnMouseEnter(int /*x*/, int /*y*/, unsigned long /**/, unsigned long /**/)
44
void Shield::OnMouseLeave(int /*x*/, int /**/, unsigned long /**/, unsigned long /**/)
49
void Shield::OnPrimaryChanged(bool value)
51
SetBackgroundColor(value ? nux::color::Red : nux::color::Yellow);