2014-12-06 17:09:44 -05:00
|
|
|
/****************************************************************
|
|
|
|
* This file is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014, RetroShare Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#include <QFont>
|
|
|
|
|
|
|
|
#include "StyledLabel.h"
|
|
|
|
|
|
|
|
/** Constructor */
|
|
|
|
StyledLabel::StyledLabel(QWidget *parent)
|
|
|
|
: QLabel(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-12-14 12:05:43 -05:00
|
|
|
StyledLabel::StyledLabel(const QString &text, QWidget *parent)
|
|
|
|
: QLabel(text, parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-06-06 08:58:14 -04:00
|
|
|
int StyledLabel::fontSizeFactor()
|
|
|
|
{
|
|
|
|
return mFontSizeFactor;
|
|
|
|
}
|
|
|
|
|
2014-12-06 17:09:44 -05:00
|
|
|
void StyledLabel::setFontSizeFactor(int factor)
|
|
|
|
{
|
2015-06-06 08:58:14 -04:00
|
|
|
mFontSizeFactor = factor;
|
|
|
|
|
2014-12-06 17:09:44 -05:00
|
|
|
QFont f = font();
|
2015-06-06 08:58:14 -04:00
|
|
|
qreal fontSize = mFontSizeFactor * f.pointSizeF() / 100;
|
2014-12-06 17:09:44 -05:00
|
|
|
f.setPointSizeF(fontSize);
|
|
|
|
setFont(f);
|
|
|
|
}
|