-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitempropertiesdb.cpp
74 lines (67 loc) · 2.69 KB
/
itempropertiesdb.cpp
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "itempropertiesdb.h"
#include "ui_itempropertiesdb.h"
ItemPropertiesDB::ItemPropertiesDB(QWidget *parent) :
QWidget(parent),
ui(new Ui::ItemPropertiesDB)
{
ui->setupUi(this);
h_base = 173;
h_stacked_item[0] = 0;
h_stacked_item[1] = 693;
h_stacked_item[2] = 500;
h_stacked_item[3] = 500;
h_stacked_item[4] = 500;
h_stacked_item[5] = 500;
h_stacked_item[6] = 500;
h_stacked_item[7] = 80;
h_stacked_option[0] = 515;
h_stacked_option[1] = 160;
setCurrentIndex(0);
}
ItemPropertiesDB::~ItemPropertiesDB()
{
delete ui;
}
void ItemPropertiesDB::AdjustHeight()
{
if (ui->stackedItem->currentIndex() == 1)
{
if (ui->comboEquipmentSlotA->currentIndex() == 0) // TODO >> CHANGE FOR A SLOT TYPE CHECK
{
setMaximumHeight(h_base + h_stacked_item[ui->stackedItem->currentIndex()] + h_stacked_option[0]);
setMinimumHeight(h_base + h_stacked_item[ui->stackedItem->currentIndex()] + h_stacked_option[0]);
ui->stackedItem->setMaximumHeight(h_stacked_item[ui->stackedItem->currentIndex()]);
ui->stackedItem->setMinimumHeight(h_stacked_item[ui->stackedItem->currentIndex()]);
ui->stackedEquipmentOptions->setMaximumHeight(h_stacked_option[0]);
ui->stackedEquipmentOptions->setMinimumHeight(h_stacked_option[0]);
}
else
{
setMaximumHeight(h_base + h_stacked_item[ui->stackedItem->currentIndex()] + h_stacked_option[1]);
setMinimumHeight(h_base + h_stacked_item[ui->stackedItem->currentIndex()] + h_stacked_option[1]);
ui->stackedItem->setMaximumHeight(h_stacked_item[ui->stackedItem->currentIndex()]);
ui->stackedItem->setMinimumHeight(h_stacked_item[ui->stackedItem->currentIndex()]);
ui->stackedEquipmentOptions->setMaximumHeight(h_stacked_option[1]);
ui->stackedEquipmentOptions->setMinimumHeight(h_stacked_option[1]);
}
}
else
{
setMaximumHeight(h_base + h_stacked_item[ui->stackedItem->currentIndex()]);
setMinimumHeight(h_base + h_stacked_item[ui->stackedItem->currentIndex()]);
ui->stackedItem->setMaximumHeight(h_stacked_item[ui->stackedItem->currentIndex()]);
ui->stackedItem->setMinimumHeight(h_stacked_item[ui->stackedItem->currentIndex()]);
ui->stackedEquipmentOptions->setMinimumHeight(0);
ui->stackedEquipmentOptions->setMaximumHeight(0);
}
}
void ItemPropertiesDB::setCurrentIndex(int index)
{
ui->stackedItem->setCurrentIndex(index);
AdjustHeight();
}
void ItemPropertiesDB::on_comboEquipmentSlotA_currentIndexChanged(int index)
{
ui->stackedEquipmentOptions->setCurrentIndex(index);
AdjustHeight();
}