RedPanda-CPP/RedPandaIDE/iconsmanager.cpp

58 lines
1.4 KiB
C++
Raw Normal View History

#include "iconsmanager.h"
#include <QPainter>
#include <QSvgRenderer>
IconsManager* pIconsManager;
IconsManager::IconsManager(QObject *parent) : QObject(parent)
{
updateIcons(24);
}
void IconsManager::updateIcons(int size)
{
QSvgRenderer renderer(QString(":/icons/images/editor/breakpoint.svg"));
mBreakpoint = std::make_shared<QPixmap>(size,size);
mBreakpoint->fill(Qt::transparent);
QPainter painter(mBreakpoint.get());
renderer.render(&painter,mBreakpoint->rect());
mSyntaxError = std::make_shared<QPixmap>(":/icons/images/editor/syntaxerror.png");
mSyntaxWarning = std::make_shared<QPixmap>(":/icons/images/editor/syntaxwarning.png");
2021-07-26 00:22:08 +08:00
mActiveBreakpoint = std::make_shared<QPixmap>(":/icons/images/editor/currentline.png");
2021-10-21 17:31:25 +08:00
mBookmark = std::make_shared<QPixmap>(":/icons/images/editor/bookmark.png");
mFolder = std::make_shared<QPixmap>(":/icons/images/newlook24/090-explorer.png");
}
const PIcon &IconsManager::syntaxError() const
{
return mSyntaxError;
}
const PIcon &IconsManager::syntaxWarning() const
{
return mSyntaxWarning;
}
const PIcon &IconsManager::breakpoint() const
{
return mBreakpoint;
}
const PIcon &IconsManager::activeBreakpoint() const
{
2021-07-26 00:22:08 +08:00
return mActiveBreakpoint;
}
2021-10-21 17:31:25 +08:00
const PIcon &IconsManager::bookmark() const
{
return mBookmark;
}
const PIcon &IconsManager::folder() const
{
return mFolder;
}