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() {
|
||||
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);
|
||||
});
|
||||
|
|
Reference in a new issue