git-svn-id: svn://db.shs.com.ru/libs@65 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-12-09 15:44:03 +00:00
parent 64f21dc682
commit 458a516317
31 changed files with 1486 additions and 870 deletions

View File

@@ -40,11 +40,23 @@ void MaterialMapEditor::changeEvent(QEvent * e) {
}
void MaterialMapEditor::resizeEvent(QResizeEvent * e) {
ui->iconedLabel->setFixedWidth(ui->iconedLabel->height());
ui->iconedLabel->setIconSize(ui->iconedLabel->size());
}
void MaterialMapEditor::updateIcon() {
ui->iconedLabel->setIcon(QIcon(ui->linePath->property("GLpath").toString()));
}
void MaterialMapEditor::setMap(const Map & m) {
active = false;
ui->sliderAmount->setValue(m.color_amount);
ui->sliderOffset->setValue(m.color_offset);
ui->linePath->setProperty("GLpath", m.bitmap_path); ui->linePath->setText(QFileInfo(m.bitmap_path).fileName());
updateIcon();
active = true;
}
@@ -63,6 +75,7 @@ void MaterialMapEditor::on_buttonSelect_clicked() {
if (str.isEmpty()) return;
ui->linePath->setProperty("GLpath", str);
ui->linePath->setText(QFileInfo(str).fileName());
updateIcon();
mapChanged();
}
@@ -70,5 +83,6 @@ void MaterialMapEditor::on_buttonSelect_clicked() {
void MaterialMapEditor::on_buttonClear_clicked() {
ui->linePath->setText("");
ui->linePath->setProperty("GLpath", "");
updateIcon();
mapChanged();
}