From 56d8616a5ff2450a5b0f73d6d0dc4010c1ad903e Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Mon, 21 Feb 2022 09:48:04 +0800 Subject: [PATCH] fix: error in icons fix: icons in files view not changed, when icon set is changed work save: git merge and branch --- RedPandaIDE/mainwindow.cpp | 11 +- .../contrast/filesystem/cfile-vcs-changed.svg | 10 +- .../filesystem/cppfile-vcs-changed.svg | 8 +- .../contrast/filesystem/file-vcs-changed.svg | 43 +++--- .../filesystem/folder-vcs-changed.svg | 42 +++--- .../contrast/filesystem/hfile-vcs-changed.svg | 8 +- .../filesystem/projectfile-vcs-changed.svg | 8 +- .../newlook/filesystem/cfile-vcs-conflict.svg | 131 ++++++++++++++++++ RedPandaIDE/vcs/gitrepository.cpp | 4 + 9 files changed, 197 insertions(+), 68 deletions(-) create mode 100644 RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 31f3f5aa..15af830b 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -667,6 +667,7 @@ void MainWindow::applySettings() //icon sets for files view pIconsManager->updateFileSystemIcons(pSettings->environment().iconSet(),pointToPixel(pSettings->environment().interfaceFontSize())); + setFilesViewRoot(mFileSystemModel.rootPath()); // for (int i=0;icbFilesPath->count();i++) { // ui->cbFilesPath->setItemIcon(i,pIconsManager->getIcon(IconsManager::FILESYSTEM_GIT)); // } @@ -764,10 +765,10 @@ void MainWindow::onFileSaved(const QString &path, bool inProject) if (!inProject) { if ( (isCFile(path) || isHFile(path)) && !mFileSystemModelIconProvider.VCSRepository()->isFileInRepository(path)) { - mFileSystemModelIconProvider.VCSRepository()->add(extractRelativePath(mFileSystemModelIconProvider.VCSRepository()->folder(),path)); } } +// qDebug()<<"update icon provider"; mFileSystemModelIconProvider.update(); mFileSystemModel.setIconProvider(&mFileSystemModelIconProvider); ui->treeFiles->update(index); @@ -3091,7 +3092,7 @@ void MainWindow::onProjectViewContextMenu(const QPoint &pos) vcsMenu.addAction(ui->actionGit_Restore); bool canBranch = !mProject->model()->iconProvider()->VCSRepository()->hasChangedFiles() - && !mProject->model()->iconProvider()->VCSRepository()->hasChangedFiles(); + && !mProject->model()->iconProvider()->VCSRepository()->hasStagedFiles(); ui->actionGit_Merge->setEnabled(canBranch); ui->actionGit_Commit->setEnabled(canBranch); ui->actionGit_Branch->setEnabled(true); @@ -3206,7 +3207,7 @@ void MainWindow::onFilesViewContextMenu(const QPoint &pos) vcsMenu.addAction(ui->actionGit_Restore); bool canBranch = !mFileSystemModelIconProvider.VCSRepository()->hasChangedFiles() - && !mFileSystemModelIconProvider.VCSRepository()->hasChangedFiles(); + && !mFileSystemModelIconProvider.VCSRepository()->hasStagedFiles(); ui->actionGit_Branch->setEnabled(canBranch); ui->actionGit_Merge->setEnabled(canBranch); ui->actionGit_Commit->setEnabled(true); @@ -5714,14 +5715,14 @@ void MainWindow::updateVCSActions() hasRepository = vcsManager.hasRepository(mProject->folder(),branch); shouldEnable = true; canBranch = !mProject->model()->iconProvider()->VCSRepository()->hasChangedFiles() - && !mProject->model()->iconProvider()->VCSRepository()->hasChangedFiles(); + && !mProject->model()->iconProvider()->VCSRepository()->hasStagedFiles(); } else if (ui->treeFiles->isVisible()) { GitManager vcsManager; QString branch; hasRepository = vcsManager.hasRepository(pSettings->environment().currentFolder(),branch); shouldEnable = true; canBranch =!mFileSystemModelIconProvider.VCSRepository()->hasChangedFiles() - && !mFileSystemModelIconProvider.VCSRepository()->hasChangedFiles(); + && !mFileSystemModelIconProvider.VCSRepository()->hasStagedFiles(); } ui->actionGit_Create_Repository->setEnabled(!hasRepository && shouldEnable); ui->actionGit_Commit->setEnabled(hasRepository && shouldEnable); diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/cfile-vcs-changed.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/cfile-vcs-changed.svg index dc4c2bba..a96d4f94 100644 --- a/RedPandaIDE/resources/iconsets/contrast/filesystem/cfile-vcs-changed.svg +++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/cfile-vcs-changed.svg @@ -24,7 +24,7 @@ inkscape:pagecheckerboard="false" showgrid="false" inkscape:zoom="8.2024385" - inkscape:cx="-4.7546836" + inkscape:cx="-4.6327687" inkscape:cy="17.616712" inkscape:window-width="1920" inkscape:window-height="1001" @@ -71,15 +71,15 @@ ! + x="8.2130604" + y="45.971664">! ! + x="8.3694601" + y="45.792927">! ! - - ! - - + ! + diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/folder-vcs-changed.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/folder-vcs-changed.svg index 40292d21..1855cd81 100644 --- a/RedPandaIDE/resources/iconsets/contrast/filesystem/folder-vcs-changed.svg +++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/folder-vcs-changed.svg @@ -40,27 +40,23 @@ stroke-linejoin="round" id="path2" sodipodi:nodetypes="cssccssssc" /> - - ! - - + ! + diff --git a/RedPandaIDE/resources/iconsets/contrast/filesystem/hfile-vcs-changed.svg b/RedPandaIDE/resources/iconsets/contrast/filesystem/hfile-vcs-changed.svg index 51a6bc31..f932dd70 100644 --- a/RedPandaIDE/resources/iconsets/contrast/filesystem/hfile-vcs-changed.svg +++ b/RedPandaIDE/resources/iconsets/contrast/filesystem/hfile-vcs-changed.svg @@ -67,15 +67,15 @@ ! + x="8.2732391" + y="46.372517">! ! + x="9.7308216" + y="40.600151">! diff --git a/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg b/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg new file mode 100644 index 00000000..10964c61 --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/filesystem/cfile-vcs-conflict.svg @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/vcs/gitrepository.cpp b/RedPandaIDE/vcs/gitrepository.cpp index c5a29727..f7e1f574 100644 --- a/RedPandaIDE/vcs/gitrepository.cpp +++ b/RedPandaIDE/vcs/gitrepository.cpp @@ -97,6 +97,10 @@ void GitRepository::update() convertFilesListToSet(mManager->listFiles(mRealFolder),mFilesInRepositories); convertFilesListToSet(mManager->listChangedFiles(mRealFolder),mChangedFiles); convertFilesListToSet(mManager->listStagedFiles(mRealFolder),mStagedFiles); +// qDebug()<<"update"<