/*****************************************************************************
 *
 *  flagbox.cpp -- Read-only checkbox to display a bool value.
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is part of the Gui4 module of the DVDx 4 application.
 *
 *  GNU Lesser General Public License Usage
 *  This file may be used under the terms of the GNU Lesser General
 *  Public License version 2.1 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.LGPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU Lesser General Public License version 2.1 requirements
 *  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 *
 *  GNU General Public License Usage
 *  Alternatively, this file may be used under the terms of the GNU
 *  General Public License version 3.0 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.GPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU General Public License version 3.0 requirements will be
 *  met: http://www.gnu.org/copyleft/gpl.html.
 *
 *****************************************************************************/

#include "flagbox.h"
#include <QDebug>

FlagBox::FlagBox(QWidget *parent) : QCheckBox(parent)
{
};

bool FlagBox::event(QEvent *e) 
{

	// avoid mouse hover effect
	this->setAttribute(Qt::WA_Hover, false);
	this->setAttribute(Qt::WA_NoMousePropagation, false);
	
	return QWidget::event(e);
}; 

void FlagBox::setDefaultStyle()
{
	setStyleSheet( QString() );
};

void FlagBox::setGreenLightStyle()
{
	QString newStyle;

	newStyle = QString(	"QCheckBox::indicator { border: 1px solid gray } "
						"QCheckBox::indicator::unchecked { background-color: white } "
						"QCheckBox::indicator::checked { background-color: lightgreen } " );

	setStyleSheet( newStyle );
};
