Creates an RTImage cache

Fixes:
- Fixes GUI issue on Windows (GDI handles limit reached)
- Fixes an incorrect icon name in Perspective tool
- Adds robustness RTScalable::loadSurfaceFromIcon function
This commit is contained in:
Pandagrapher
2022-09-02 19:15:42 +02:00
parent 35ce0d1227
commit 1c85926200
6 changed files with 130 additions and 21 deletions

View File

@@ -68,10 +68,22 @@ Cairo::RefPtr<Cairo::ImageSurface> RTScalable::loadSurfaceFromIcon(const Glib::u
// Looking for corresponding icon (if existing)
const auto iconInfo = theme->lookup_icon(iconName, size);
if (!iconInfo) {
if (rtengine::settings->verbose) {
std::cerr << "Failed to load icon \"" << iconName << "\" for size " << size << "px" << std::endl;
}
return surf;
}
const auto iconPath = iconInfo.get_filename();
if ((iconPath.empty() || !iconInfo) && rtengine::settings->verbose) {
std::cerr << "Failed to load icon \"" << iconName << "\" for size " << size << "px" << std::endl;
if (iconPath.empty()) {
if (rtengine::settings->verbose) {
std::cerr << "Failed to load icon \"" << iconName << "\" for size " << size << "px" << std::endl;
}
return surf;
}