Archived
1
Fork 0

Trim material paths

This commit is contained in:
Joshua Goins 2018-12-25 23:49:15 -05:00
parent 09b6d59cf9
commit 57b9648220

View file

@ -165,8 +165,12 @@ void MainWindow::saveMaterial(QString path) {
}
void MainWindow::updateControls() {
const auto trimPath = [](QString path) {
return path.mid(path.lastIndexOf('/') + 1);
};
if(!currentlyOpenMaterial.isEmpty())
setWindowTitle("Material Editor - " + currentlyOpenMaterial);
setWindowTitle("Material Editor - " + trimPath(currentlyOpenMaterial));
else
setWindowTitle("Material Editor");
@ -176,7 +180,7 @@ void MainWindow::updateControls() {
if(!openedFiles.empty()) {
QMenu* recentlyOpenedMenu = new QMenu();
for(auto file : openedFiles) {
QAction* fileAction = new QAction(file);
QAction* fileAction = new QAction(trimPath(file));
connect(fileAction, &QAction::triggered, [this, file] {
openMaterial(file);
});