git-svn-id: svn://db.shs.com.ru/libs@65 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user