Skip to content

Commit

Permalink
fix: MateriaEditor; Adjust the skill list box scroll area height
Browse files Browse the repository at this point in the history
  • Loading branch information
sithlord48 committed Jun 6, 2024
1 parent 9eb2d44 commit 05d04ac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/widgets/data/MateriaEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ MateriaEditor::MateriaEditor(QWidget *parent, quint8 materia_id, qint32 materia_
init_display();
setMateria(materia_id, materia_ap);
}

void MateriaEditor::init_display()
{
setContentsMargins(0, 0, 0, 0);
Expand Down Expand Up @@ -73,6 +74,7 @@ void MateriaEditor::setMateria(quint8 materia_id, qint32 materia_ap)
setAP(materia_ap);
setStats();
}

void MateriaEditor::setAP(qint32 ap)
{
if (FF7Materia::levels(_id) == 1) {
Expand Down Expand Up @@ -150,6 +152,7 @@ void MateriaEditor::setStats()
box_skills->setTitle(title);
}
}

void MateriaEditor::setLevel()
{
_level = FF7Materia::materiaLevel(_id, _current_ap);
Expand Down Expand Up @@ -239,6 +242,7 @@ qint32 MateriaEditor::ap(void)
{
return _current_ap;
}

qint8 MateriaEditor::id(void)
{
return qint8(_id);
Expand Down Expand Up @@ -476,6 +480,7 @@ QWidget *MateriaEditor::makeStarWidget()
frm_ap_stars->setLayout(layout);
return frm_ap_stars;
}

void MateriaEditor::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
Expand Down Expand Up @@ -514,6 +519,7 @@ void MateriaEditor::changeEvent(QEvent *e)
}
QWidget::changeEvent(e);
}

void MateriaEditor::updateESkillList()
{
if (eskill_list) {
Expand All @@ -531,6 +537,7 @@ void MateriaEditor::updateESkillList()
}
}
}

QWidget *MateriaEditor::makeSkillWidget()
{
updateESkillList();
Expand Down Expand Up @@ -585,7 +592,7 @@ QWidget *MateriaEditor::makeSkillWidget()

list_skills = new QListWidget;
list_skills->addItem(new QListWidgetItem("Item"));
list_skills->setFixedHeight(list_skills->sizeHintForRow(0) * 5 + list_skills->contentsMargins().top() + list_skills->contentsMargins().bottom() + 3);
list_skills->setFixedHeight( ((list_skills->sizeHintForRow(0) + list_skills->spacing())* 5) + list_skills->contentsMargins().top() + list_skills->contentsMargins().bottom() + 4);
list_skills->setSelectionMode(QAbstractItemView::NoSelection);

auto skill_layout = new QVBoxLayout;
Expand Down

0 comments on commit 05d04ac

Please sign in to comment.