From 0c2d569cb9a37e3c80c27109ae9ba2cac6367f57 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 27 Jan 2022 21:47:21 +0800 Subject: [PATCH] add icon for local var --- RedPandaIDE/icons.qrc | 1 + RedPandaIDE/iconsmanager.cpp | 3 + RedPandaIDE/iconsmanager.h | 1 + .../iconsets/newlook/classparser/enum.svg | 10 ++-- .../iconsets/newlook/classparser/var.svg | 57 +++++++++++++++++++ 5 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 RedPandaIDE/resources/iconsets/newlook/classparser/var.svg diff --git a/RedPandaIDE/icons.qrc b/RedPandaIDE/icons.qrc index 05aaa10c..a7a999bf 100644 --- a/RedPandaIDE/icons.qrc +++ b/RedPandaIDE/icons.qrc @@ -217,5 +217,6 @@ resources/iconsets/newlook/actions/08Problem-08Running.svg resources/iconsets/newlook/classparser/code_snippet.svg resources/iconsets/newlook/classparser/keyword.svg + resources/iconsets/newlook/classparser/var.svg diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index 5aecfe03..7c9180e9 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -69,6 +69,7 @@ void IconsManager::updateParserIcons(const QString &iconSet, int size) mIconPixmaps.insert(PARSER_PRIVATE_VAR, createSVGIcon(iconFolder+"var_private.svg",size,size)); mIconPixmaps.insert(PARSER_KEYWORD, createSVGIcon(iconFolder+"keyword.svg",size,size)); mIconPixmaps.insert(PARSER_CODE_SNIPPET, createSVGIcon(iconFolder+"code_snippet.svg",size,size)); + mIconPixmaps.insert(PARSER_LOCAL_VAR, createSVGIcon(iconFolder+"var.svg",size,size)); } @@ -266,6 +267,8 @@ QPixmap IconsManager::getPixmapForStatement(PStatement statement) break; case StatementKind::skGlobalVariable: return *(pIconsManager->getPixmap(IconsManager::PARSER_GLOBAL_VAR)); + case StatementKind::skLocalVariable: + return *(pIconsManager->getPixmap(IconsManager::PARSER_LOCAL_VAR)); case StatementKind::skVariable: // if (statement->scope == StatementScope::ssGlobal) // return QIcon(":/icons/images/classparser/global.ico"); diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h index dc678d96..941c99c2 100644 --- a/RedPandaIDE/iconsmanager.h +++ b/RedPandaIDE/iconsmanager.h @@ -56,6 +56,7 @@ public: PARSER_PRIVATE_VAR, PARSER_KEYWORD, PARSER_CODE_SNIPPET, + PARSER_LOCAL_VAR, ACTION_MISC_BACK, ACTION_MISC_FORWARD, diff --git a/RedPandaIDE/resources/iconsets/newlook/classparser/enum.svg b/RedPandaIDE/resources/iconsets/newlook/classparser/enum.svg index 5c395342..721fac94 100644 --- a/RedPandaIDE/resources/iconsets/newlook/classparser/enum.svg +++ b/RedPandaIDE/resources/iconsets/newlook/classparser/enum.svg @@ -23,9 +23,9 @@ inkscape:pagecheckerboard="0" inkscape:document-units="px" showgrid="false" - inkscape:zoom="4.0920135" - inkscape:cx="71.358513" - inkscape:cy="54.129831" + inkscape:zoom="0.51150169" + inkscape:cx="-723.36027" + inkscape:cy="393.93809" inkscape:window-width="1920" inkscape:window-height="1001" inkscape:window-x="-9" @@ -51,7 +51,7 @@ ry="7.9375" /> + style="font-style:normal;font-weight:normal;font-size:28.2222px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.217708" + d="M 8.9892087,5.1111866 C 7.5201346,10.394661 6.0489548,15.677737 4.5812052,20.961463 c 4.4021168,0 8.8042328,0 13.2063498,0 0.234096,-0.845571 0.470019,-1.690795 0.706411,-2.535927 -3.252433,0 -6.504867,0 -9.7572991,0 0.4662306,-1.672581 0.9324626,-3.345162 1.3986931,-5.017743 3.251844,0 6.503689,0 9.755534,0 0.236892,-0.841736 0.472135,-1.68379 0.708176,-2.52569 -3.252433,0 -6.504867,0 -9.7573,0 0.325538,-1.1802155 0.651076,-2.3604307 0.976613,-3.540646 3.252434,0 6.504867,0 9.7573,0 0.23353,-0.8460534 0.471382,-1.6912851 0.704645,-2.5373897 -4.402117,-10e-8 -8.804233,0 -13.20635,0 -0.028256,0.1023732 -0.056513,0.2047463 -0.084769,0.3071193 z" /> diff --git a/RedPandaIDE/resources/iconsets/newlook/classparser/var.svg b/RedPandaIDE/resources/iconsets/newlook/classparser/var.svg new file mode 100644 index 00000000..c958aff7 --- /dev/null +++ b/RedPandaIDE/resources/iconsets/newlook/classparser/var.svg @@ -0,0 +1,57 @@ + + + + + + + + + + +