Trim material paths
This commit is contained in:
parent
09b6d59cf9
commit
57b9648220
1 changed files with 6 additions and 2 deletions
|
@ -165,8 +165,12 @@ void MainWindow::saveMaterial(QString path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateControls() {
|
void MainWindow::updateControls() {
|
||||||
|
const auto trimPath = [](QString path) {
|
||||||
|
return path.mid(path.lastIndexOf('/') + 1);
|
||||||
|
};
|
||||||
|
|
||||||
if(!currentlyOpenMaterial.isEmpty())
|
if(!currentlyOpenMaterial.isEmpty())
|
||||||
setWindowTitle("Material Editor - " + currentlyOpenMaterial);
|
setWindowTitle("Material Editor - " + trimPath(currentlyOpenMaterial));
|
||||||
else
|
else
|
||||||
setWindowTitle("Material Editor");
|
setWindowTitle("Material Editor");
|
||||||
|
|
||||||
|
@ -176,7 +180,7 @@ void MainWindow::updateControls() {
|
||||||
if(!openedFiles.empty()) {
|
if(!openedFiles.empty()) {
|
||||||
QMenu* recentlyOpenedMenu = new QMenu();
|
QMenu* recentlyOpenedMenu = new QMenu();
|
||||||
for(auto file : openedFiles) {
|
for(auto file : openedFiles) {
|
||||||
QAction* fileAction = new QAction(file);
|
QAction* fileAction = new QAction(trimPath(file));
|
||||||
connect(fileAction, &QAction::triggered, [this, file] {
|
connect(fileAction, &QAction::triggered, [this, file] {
|
||||||
openMaterial(file);
|
openMaterial(file);
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue