1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-25 13:17:46 +00:00

sklbpart: Support localization

This commit is contained in:
Joshua Goins 2024-02-04 15:26:12 -05:00
parent edc0439a0a
commit 76f8b4859c
2 changed files with 7 additions and 5 deletions

View file

@ -8,6 +8,7 @@ target_sources(sklbpart
sklbpart.h)
target_link_libraries(sklbpart
PUBLIC
KF6::I18n
Novus::Common
Physis::Physis
Qt6::Core

View file

@ -3,6 +3,7 @@
#include "sklbpart.h"
#include <KLocalizedString>
#include <QFormLayout>
#include <QGroupBox>
#include <QHBoxLayout>
@ -35,7 +36,7 @@ SklbPart::SklbPart(QWidget *parent)
setLayout(layout);
boneListWidget = new QTreeWidget();
boneListWidget->setHeaderLabel(QStringLiteral("Name"));
boneListWidget->setHeaderLabel(i18nc("@title:column", "Name"));
boneListWidget->setMaximumWidth(200);
layout->addWidget(boneListWidget);
@ -43,7 +44,7 @@ SklbPart::SklbPart(QWidget *parent)
auto transformLayout = new QVBoxLayout();
layout->addLayout(transformLayout);
auto transformGroup = new QGroupBox(QStringLiteral("Bone Transform"));
auto transformGroup = new QGroupBox(i18nc("@title:group", "Bone Transform"));
transformLayout->addWidget(transformGroup);
auto transformGroupLayout = new QFormLayout();
transformGroup->setLayout(transformGroupLayout);
@ -53,21 +54,21 @@ SklbPart::SklbPart(QWidget *parent)
memcpy(currentEditedBone->position, glm::value_ptr(currentPosition), sizeof(float) * 3);
Q_EMIT valueChanged();
});
transformGroupLayout->addRow(QStringLiteral("Position"), posEdit);
transformGroupLayout->addRow(i18nc("@label:spinbox", "Position"), posEdit);
rotationEdit = new QuaternionEdit(currentRotation);
connect(rotationEdit, &QuaternionEdit::onValueChanged, [this] {
memcpy(currentEditedBone->rotation, glm::value_ptr(currentRotation), sizeof(float) * 4);
Q_EMIT valueChanged();
});
transformGroupLayout->addRow(QStringLiteral("Rotation"), rotationEdit);
transformGroupLayout->addRow(i18nc("@label:spinbox", "Rotation"), rotationEdit);
scaleEdit = new Vector3Edit(currentScale);
connect(scaleEdit, &Vector3Edit::onValueChanged, [this] {
memcpy(currentEditedBone->scale, glm::value_ptr(currentScale), sizeof(float) * 3);
Q_EMIT valueChanged();
});
transformGroupLayout->addRow(QStringLiteral("Scale"), scaleEdit);
transformGroupLayout->addRow(i18nc("@label:spinbox", "Scale"), scaleEdit);
connect(boneListWidget, &QTreeWidget::itemClicked, this, &SklbPart::treeItemClicked);
}