From f4fd5e7abecbc0922a6ce307544452a7dd38d302 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 22 Dec 2021 18:55:36 +0800 Subject: [PATCH] work save: svg icons --- RedPandaIDE/icons.qrc | 13 ++ RedPandaIDE/iconsmanager.cpp | 14 ++ RedPandaIDE/iconsmanager.h | 14 ++ .../images/newlook/01File-11Locate.svg | 77 ++++++++++ .../images/newlook/03Edit-11SortByName.svg | 72 +++++++++ .../images/newlook/03Edit-12ShowInherited.svg | 95 ++++++++++++ .../images/newlook/03Edit-12SortByType.svg | 91 +++++++++++ .../images/newlook/03Edit-13ShowInherited.svg | 95 ++++++++++++ .../images/newlook/06View-02ClassBrowser.svg | 78 ++++++++++ RedPandaIDE/images/newlook/06View-03Files.svg | 78 ++++++++++ .../images/newlook/08Problem_01Problem.svg | 101 +++++++++++++ .../images/newlook/08Problem_02ProblemSet.svg | 132 ++++++++++++++++ .../images/newlook/08Problem_03Properties.svg | 109 ++++++++++++++ .../images/newlook/08Problem_04EditSource.svg | 141 ++++++++++++++++++ .../images/newlook/08Problem_05RunCases.svg | 136 +++++++++++++++++ RedPandaIDE/mainwindow.cpp | 97 +++++++++++- 16 files changed, 1339 insertions(+), 4 deletions(-) create mode 100644 RedPandaIDE/images/newlook/01File-11Locate.svg create mode 100644 RedPandaIDE/images/newlook/03Edit-11SortByName.svg create mode 100644 RedPandaIDE/images/newlook/03Edit-12ShowInherited.svg create mode 100644 RedPandaIDE/images/newlook/03Edit-12SortByType.svg create mode 100644 RedPandaIDE/images/newlook/03Edit-13ShowInherited.svg create mode 100644 RedPandaIDE/images/newlook/06View-02ClassBrowser.svg create mode 100644 RedPandaIDE/images/newlook/06View-03Files.svg create mode 100644 RedPandaIDE/images/newlook/08Problem_01Problem.svg create mode 100644 RedPandaIDE/images/newlook/08Problem_02ProblemSet.svg create mode 100644 RedPandaIDE/images/newlook/08Problem_03Properties.svg create mode 100644 RedPandaIDE/images/newlook/08Problem_04EditSource.svg create mode 100644 RedPandaIDE/images/newlook/08Problem_05RunCases.svg diff --git a/RedPandaIDE/icons.qrc b/RedPandaIDE/icons.qrc index b386dbb1..b3493b97 100644 --- a/RedPandaIDE/icons.qrc +++ b/RedPandaIDE/icons.qrc @@ -189,5 +189,18 @@ images/newlook/07Help-01About.svg images/newlook/01File-10FileProperties.svg images/newlook/01File-11Locate.svg + images/newlook/03Edit-11SortByName.svg + images/newlook/03Edit-12SortByType.svg + images/newlook/03Edit-13ShowInherited.svg + images/newlook/06View-02ClassBrowser.svg + images/newlook/08Problem_01Problem.svg + images/newlook/08Problem_02ProblemSet.svg + images/newlook/08Problem_03Properties.svg + images/newlook/08Problem_04EditSource.svg + images/newlook/08Problem_05RunCases.svg + images/newlook/06View-03Files.svg + images/newlook/06View-04CompileLog.svg + images/newlook/06View-05Bookmark.svg + images/newlook/06View-06Todo.svg diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index a70ca6ee..731915b5 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -89,6 +89,9 @@ void IconsManager::updateActionIcons(const QString iconSet, int size) mIcons.insert(ACTION_EDIT_SEARCH, createSVGIcon(iconFolder+"03Edit_08Search.svg",size,size)); mIcons.insert(ACTION_EDIT_REPLACE, createSVGIcon(iconFolder+"03Edit_09Replace.svg",size,size)); mIcons.insert(ACTION_EDIT_SEARCH_IN_FILES, createSVGIcon(iconFolder+"03Edit_10SearchInFiles.svg",size,size)); + mIcons.insert(ACTION_EDIT_SORT_BY_NAME, createSVGIcon(iconFolder+"03Edit-11SortByName.svg",size,size)); + mIcons.insert(ACTION_EDIT_SORT_BY_TYPE, createSVGIcon(iconFolder+"03Edit-12SortByType.svg",size,size)); + mIcons.insert(ACTION_EDIT_SHOW_INHERITED, createSVGIcon(iconFolder+"03Edit-13ShowInherited.svg",size,size)); mIcons.insert(ACTION_CODE_BACK, createSVGIcon(iconFolder+"04Code-01Back.svg",size,size)); mIcons.insert(ACTION_CODE_FORWARD, createSVGIcon(iconFolder+"04Code-02Forward.svg",size,size)); @@ -112,8 +115,19 @@ void IconsManager::updateActionIcons(const QString iconSet, int size) mIcons.insert(ACTION_RUN_REMOVE_WATCH, createSVGIcon(iconFolder+"05Run-13RemoveWatch.svg",size,size)); mIcons.insert(ACTION_VIEW_MAXIMUM, createSVGIcon(iconFolder+"06View-01Maximum.svg",size,size)); + mIcons.insert(ACTION_VIEW_CLASSBROWSER, createSVGIcon(iconFolder+"06View-02ClassBrowser.svg",size,size)); + mIcons.insert(ACTION_VIEW_FILES, createSVGIcon(iconFolder+"06View-03Files.svg",size,size)); + mIcons.insert(ACTION_VIEW_COMPILELOG, createSVGIcon(iconFolder+"06View-04CompileLog.svg",size,size)); + mIcons.insert(ACTION_VIEW_BOOKMARK, createSVGIcon(iconFolder+"06View-05Bookmark.svg",size,size)); + mIcons.insert(ACTION_VIEW_TODO, createSVGIcon(iconFolder+"06View-06Todo.svg",size,size)); + mIcons.insert(ACTION_HELP_ABOUT, createSVGIcon(iconFolder+"07Help-01About.svg",size,size)); + mIcons.insert(ACTION_PROBLEM_PROBLEM, createSVGIcon(iconFolder+"08Problem_01Problem.svg",size,size)); + mIcons.insert(ACTION_PROBLEM_SET, createSVGIcon(iconFolder+"08Problem_02ProblemSet.svg",size,size)); + mIcons.insert(ACTION_PROBLEM_PROPERTIES, createSVGIcon(iconFolder+"08Problem_03Properties.svg",size,size)); + mIcons.insert(ACTION_PROBLEM_EDIT_SOURCE, createSVGIcon(iconFolder+"08Problem_04EditSource.svg",size,size)); + mIcons.insert(ACTION_PROBLEM_RUN_CASES, createSVGIcon(iconFolder+"08Problem_05RunCases.svg",size,size)); } diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h index d653b798..bcf2b777 100644 --- a/RedPandaIDE/iconsmanager.h +++ b/RedPandaIDE/iconsmanager.h @@ -76,6 +76,9 @@ public: ACTION_EDIT_SEARCH, ACTION_EDIT_REPLACE, ACTION_EDIT_SEARCH_IN_FILES, + ACTION_EDIT_SORT_BY_NAME, + ACTION_EDIT_SORT_BY_TYPE, + ACTION_EDIT_SHOW_INHERITED, ACTION_CODE_BACK, ACTION_CODE_FORWARD, @@ -99,8 +102,19 @@ public: ACTION_RUN_REMOVE_WATCH, ACTION_VIEW_MAXIMUM, + ACTION_VIEW_CLASSBROWSER, + ACTION_VIEW_FILES, + ACTION_VIEW_COMPILELOG, + ACTION_VIEW_BOOKMARK, + ACTION_VIEW_TODO, ACTION_HELP_ABOUT, + + ACTION_PROBLEM_PROBLEM, + ACTION_PROBLEM_SET, + ACTION_PROBLEM_PROPERTIES, + ACTION_PROBLEM_EDIT_SOURCE, + ACTION_PROBLEM_RUN_CASES }; explicit IconsManager(QObject *parent = nullptr); diff --git a/RedPandaIDE/images/newlook/01File-11Locate.svg b/RedPandaIDE/images/newlook/01File-11Locate.svg new file mode 100644 index 00000000..17d5a6d8 --- /dev/null +++ b/RedPandaIDE/images/newlook/01File-11Locate.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/03Edit-11SortByName.svg b/RedPandaIDE/images/newlook/03Edit-11SortByName.svg new file mode 100644 index 00000000..831571ad --- /dev/null +++ b/RedPandaIDE/images/newlook/03Edit-11SortByName.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/03Edit-12ShowInherited.svg b/RedPandaIDE/images/newlook/03Edit-12ShowInherited.svg new file mode 100644 index 00000000..ed3f142d --- /dev/null +++ b/RedPandaIDE/images/newlook/03Edit-12ShowInherited.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/03Edit-12SortByType.svg b/RedPandaIDE/images/newlook/03Edit-12SortByType.svg new file mode 100644 index 00000000..5e605fcf --- /dev/null +++ b/RedPandaIDE/images/newlook/03Edit-12SortByType.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/03Edit-13ShowInherited.svg b/RedPandaIDE/images/newlook/03Edit-13ShowInherited.svg new file mode 100644 index 00000000..e12c7827 --- /dev/null +++ b/RedPandaIDE/images/newlook/03Edit-13ShowInherited.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/06View-02ClassBrowser.svg b/RedPandaIDE/images/newlook/06View-02ClassBrowser.svg new file mode 100644 index 00000000..32a15387 --- /dev/null +++ b/RedPandaIDE/images/newlook/06View-02ClassBrowser.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/06View-03Files.svg b/RedPandaIDE/images/newlook/06View-03Files.svg new file mode 100644 index 00000000..3ca97ce5 --- /dev/null +++ b/RedPandaIDE/images/newlook/06View-03Files.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/08Problem_01Problem.svg b/RedPandaIDE/images/newlook/08Problem_01Problem.svg new file mode 100644 index 00000000..f45b25a7 --- /dev/null +++ b/RedPandaIDE/images/newlook/08Problem_01Problem.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/08Problem_02ProblemSet.svg b/RedPandaIDE/images/newlook/08Problem_02ProblemSet.svg new file mode 100644 index 00000000..ba95dd09 --- /dev/null +++ b/RedPandaIDE/images/newlook/08Problem_02ProblemSet.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/08Problem_03Properties.svg b/RedPandaIDE/images/newlook/08Problem_03Properties.svg new file mode 100644 index 00000000..52ce4ed3 --- /dev/null +++ b/RedPandaIDE/images/newlook/08Problem_03Properties.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/08Problem_04EditSource.svg b/RedPandaIDE/images/newlook/08Problem_04EditSource.svg new file mode 100644 index 00000000..873dab5a --- /dev/null +++ b/RedPandaIDE/images/newlook/08Problem_04EditSource.svg @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/08Problem_05RunCases.svg b/RedPandaIDE/images/newlook/08Problem_05RunCases.svg new file mode 100644 index 00000000..f7471db3 --- /dev/null +++ b/RedPandaIDE/images/newlook/08Problem_05RunCases.svg @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 666933f3..2eafbe44 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1106,6 +1106,15 @@ void MainWindow::updateActionIcons() ui->toolbarCode->setIconSize(iconSize); ui->toolbarCompile->setIconSize(iconSize); ui->toolbarDebug->setIconSize(iconSize); + for (QToolButton* btn: mClassBrowserToolbar->findChildren()) { + btn->setIconSize(iconSize); + } + for (QToolButton* btn: mFilesViewToolbar->findChildren()) { + btn->setIconSize(iconSize); + } + + ui->tabInfos->setIconSize(iconSize); + ui->tabMessages->setIconSize(iconSize); ui->actionNew->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_NEW)))); ui->actionNew_Project->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW)))); @@ -1192,8 +1201,46 @@ void MainWindow::updateActionIcons() mBreakpointViewRemoveAllAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); mBreakpointViewRemoveAction->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CROSS)))); - ui->tabInfos->setIconSize(iconSize); - ui->tabMessages->setIconSize(iconSize); + //classbrowser + mClassBrowser_Sort_By_Name->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SORT_BY_NAME)))); + mClassBrowser_Sort_By_Type->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SORT_BY_TYPE)))); + mClassBrowser_Show_Inherited->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SHOW_INHERITED)))); + + //debug console + mDebugConsole_Copy->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_COPY)))); + mDebugConsole_Paste->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_PASTE)))); + mDebugConsole_Clear->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CLEAN)))); + + //file view + mFilesView_Open->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN)))); + mFilesView_OpenInTerminal->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM)))); + mFilesView_OpenInExplorer->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER)))); + + //problem view + ui->btnNewProblemSet->setIconSize(iconSize); + ui->btnNewProblemSet->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_SET)))); + ui->btnAddProblem->setIconSize(iconSize); + ui->btnAddProblem->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_ADD)))); + ui->btnRemoveProblem->setIconSize(iconSize); + ui->btnRemoveProblem->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_CROSS)))); + ui->btnSaveProblemSet->setIconSize(iconSize); + ui->btnSaveProblemSet->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_SAVE_AS)))); + ui->btnLoadProblemSet->setIconSize(iconSize); + ui->btnLoadProblemSet->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN_FOLDER)))); + + ui->btnAddProblemCase->setIconSize(iconSize); + ui->btnAddProblemCase->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_ADD)))); + ui->btnRemoveProblemCase->setIconSize(iconSize); + ui->btnRemoveProblemCase->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_REMOVE)))); + ui->btnOpenProblemAnswer->setIconSize(iconSize); + ui->btnOpenProblemAnswer->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_EDIT_SOURCE)))); + ui->btnRunAllProblemCases->setIconSize(iconSize); + ui->btnRunAllProblemCases->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_RUN_CASES)))); + ui->btnCaseValidateOptions->setIconSize(iconSize); + ui->btnCaseValidateOptions->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_MISC_GEAR)))); + + mProblem_Properties->setIcon(QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PROPERTIES)))); + int idx = ui->tabInfos->indexOf(ui->tabWatch); if (idx>=0) @@ -1201,6 +1248,41 @@ void MainWindow::updateActionIcons() idx = ui->tabInfos->indexOf(ui->tabProject); if (idx>=0) ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROJECT_NEW)))); + idx = ui->tabInfos->indexOf(ui->tabFiles); + if (idx>=0) + ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_FILES)))); + idx = ui->tabInfos->indexOf(ui->tabStructure); + if (idx>=0) + ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_CLASSBROWSER)))); + idx = ui->tabInfos->indexOf(ui->tabProblemSet); + if (idx>=0) + ui->tabInfos->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_SET)))); + + idx = ui->tabMessages->indexOf(ui->tabIssues); + if (idx>=0) + ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_COMPILE)))); + idx = ui->tabMessages->indexOf(ui->tabDebug); + if (idx>=0) + ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_RUN_DEBUG)))); + idx = ui->tabMessages->indexOf(ui->tabSearch); + if (idx>=0) + ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_EDIT_SEARCH)))); + idx = ui->tabMessages->indexOf(ui->tabCompilerOutput); + if (idx>=0) + ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_COMPILELOG)))); + idx = ui->tabMessages->indexOf(ui->tabTODO); + if (idx>=0) + ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_TODO)))); + + + idx = ui->tabMessages->indexOf(ui->tabBookmark); + if (idx>=0) + ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_VIEW_BOOKMARK)))); + + idx = ui->tabMessages->indexOf(ui->tabProblem); + if (idx>=0) + ui->tabMessages->setTabIcon(idx,QIcon(*(pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PROBLEM)))); + } void MainWindow::checkSyntaxInBack(Editor *e) @@ -2426,10 +2508,14 @@ void MainWindow::buildContextMenus() hlayout->setContentsMargins(2,2,2,2); mClassBrowserToolbar->setLayout(hlayout); QToolButton * toolButton; + int size = pointToPixel(pSettings->environment().interfaceFontSize()); + QSize iconSize(size,size); toolButton = new QToolButton; + toolButton->setIconSize(iconSize); toolButton->setDefaultAction(mClassBrowser_Sort_By_Type); hlayout->addWidget(toolButton); toolButton = new QToolButton; + toolButton->setIconSize(iconSize); toolButton->setDefaultAction(mClassBrowser_Sort_By_Name); hlayout->addWidget(toolButton); QFrame * vLine = new QFrame(); @@ -2437,6 +2523,7 @@ void MainWindow::buildContextMenus() vLine->setFrameShadow(QFrame::Sunken); hlayout->addWidget(vLine); toolButton = new QToolButton; + toolButton->setIconSize(iconSize); toolButton->setDefaultAction(mClassBrowser_Show_Inherited); hlayout->addWidget(toolButton); hlayout->addStretch(); @@ -2515,13 +2602,15 @@ void MainWindow::buildContextMenus() hlayout->setContentsMargins(2,2,2,2); mFilesViewToolbar->setLayout(hlayout); QToolButton * toolButton; + int size = pointToPixel(pSettings->environment().interfaceFontSize()); + QSize iconSize(size,size); toolButton = new QToolButton; + toolButton->setIconSize(iconSize); toolButton->setDefaultAction(ui->actionOpen_Folder); - toolButton->setFixedSize(32,32); hlayout->addWidget(toolButton); toolButton = new QToolButton; + toolButton->setIconSize(iconSize); toolButton->setDefaultAction(ui->actionLocate_in_Files_View); - toolButton->setFixedSize(32,32); hlayout->addWidget(toolButton); hlayout->addStretch(); }