Back to index

unity  6.0.0
AbstractSeparator.cpp
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 Canonical Ltd
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 3 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Authored by: Jay Taoko <jaytaoko@inalogic.com>
00017  *
00018  */
00019 
00020 #include "AbstractSeparator.h"
00021 
00022 #include "Nux/Nux.h"
00023 
00024 namespace unity
00025 {
00026 
00027 AbstractSeparator::AbstractSeparator(NUX_FILE_LINE_DECL)
00028   : nux::View(NUX_FILE_LINE_PARAM)
00029   , color_(nux::color::White)
00030   , alpha0_(0.0f)
00031   , alpha1_(0.10f)
00032   , border_size_(0)
00033 {
00034 }
00035 
00036 // Maybe it's better to use default arguments?
00037 AbstractSeparator::AbstractSeparator(nux::Color const& color, float alpha0, 
00038                                      float alpha1, int border, NUX_FILE_LINE_DECL)
00039   : nux::View(NUX_FILE_LINE_PARAM)
00040   , color_(color)
00041   , alpha0_(alpha0)
00042   , alpha1_(alpha1)
00043   , border_size_(border)
00044 {
00045 }
00046 
00047 AbstractSeparator::~AbstractSeparator()
00048 {
00049 
00050 }
00051 
00052 void AbstractSeparator::SetColor(nux::Color const &color)
00053 {
00054   color_ = color;
00055 }
00056 
00057 void AbstractSeparator::SetAlpha(float alpha0, float alpha1)
00058 {
00059   alpha0_ = alpha0;
00060   alpha1_ = alpha1;
00061 }
00062 
00063 void AbstractSeparator::SetBorderSize(int border)
00064 {
00065   border_size_ = border;
00066 }
00067 
00068 } // namespace unity