-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheightbyeightviewcontainer.cpp
More file actions
37 lines (33 loc) · 1 KB
/
eightbyeightviewcontainer.cpp
File metadata and controls
37 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "eightbyeightviewcontainer.h"
#include "eightbyeightview.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QIcon>
EightByEightViewContainer::EightByEightViewContainer(EightByEightView* view, QComboBox* paletteComboBox, QWidget *parent) : QWidget(parent), m_view(view)
{
setWindowIcon(QIcon{":/Resources/ButtonIcons/8x8.png"});
setWindowTitle("8x8 Tile Viewer");
auto layout = new QVBoxLayout(this);
setLayout(layout);
m_view->setComboBox(paletteComboBox);
layout->addWidget(m_view);
label = new QLabel(this);
label->setText("Tile 000");
layout->addWidget(label);
adjustSize();
setFixedSize(size());
}
void EightByEightViewContainer::updateForChange(QImage* image, bool firstTime) {
m_view->updateForChange(image);
if (!firstTime) {
m_view->open();
show();
raise();
}
}
void EightByEightViewContainer::closeEvent(QCloseEvent *event) {
m_view->close(event);
}
void EightByEightViewContainer::updateTileLabel(const QString &tile) {
label->setText(tile);
}