1 /*
2 **********************************************************************************
3 **
4 ** This file was created for the LibreCAD project (librecad.org), a 2D CAD program.
5 **
6 ** Copyright (C) 2016 ravas (github.com/r-a-v-a-s)
7 **
8 ** This program is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License
10 ** as published by the Free Software Foundation; either version 2
11 ** of the License, or (at your option) any later version.
12 **
13 ** This program is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with this program; if not, write to the Free Software
20 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 **
22 **********************************************************************************
23 */
24 
25 #include "twostackedlabels.h"
26 
27 #include <QLabel>
28 #include <QVBoxLayout>
29 
TwoStackedLabels(QWidget * parent)30 TwoStackedLabels::TwoStackedLabels(QWidget* parent)
31     : QFrame(parent)
32     , top_label(new QLabel(this))
33     , bottom_label(new QLabel(this))
34 {
35     QVBoxLayout* layout = new QVBoxLayout;
36     layout->addWidget(top_label);
37     layout->addWidget(bottom_label);
38     layout->setContentsMargins(4,0,4,0);
39     layout->setSpacing(0);
40     setLayout(layout);
41 }
42 
setTopLabel(const QString & status)43 void TwoStackedLabels::setTopLabel(const QString& status)
44 {
45     top_label->setText(status);
46 }
47 
setBottomLabel(const QString & status)48 void TwoStackedLabels::setBottomLabel(const QString& status)
49 {
50     bottom_label->setText(status);
51 }
52