1 // Copyright (C) 2012-2019 The VPaint Developers.
2 // See the COPYRIGHT file at the top-level directory of this distribution
3 // and at https://github.com/dalboris/vpaint/blob/master/COPYRIGHT
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #include "SelectionInfoWidget.h"
18 
19 #include <QGridLayout>
20 #include <QPushButton>
21 #include "Global.h"
22 #include "MainWindow.h"
23 #include "Scene.h"
24 #include "VectorAnimationComplex/VAC.h"
25 
SelectionInfoWidget(QWidget * parent)26 SelectionInfoWidget::SelectionInfoWidget(QWidget *parent) :
27     QWidget(parent)
28 {
29     setWindowTitle("Selection Info");
30     mainLayout_ = new QGridLayout();
31     labelSelected_ = new QLabel();
32     mainLayout_->addWidget(labelSelected_,0,0);
33     setLayout(mainLayout_);
34 
35     updateInfo();
36 }
37 
38 
updateInfo()39 void SelectionInfoWidget::updateInfo()
40 {
41     QString text;
42 
43     using namespace VectorAnimationComplex;
44     VAC * vac = global()->mainWindow()->scene()->activeVAC();
45     if(vac)
46     {
47         foreach(Cell * c, vac->selectedCells())
48         {
49             text += QString::number(c->id());
50             text += " ";
51         }
52     }
53 
54     labelSelected_->setText(text);
55 }
56