Fixing review comments

This commit is contained in:
Pandagrapher
2023-10-13 11:12:37 +02:00
parent 0c2d7c1382
commit 488a157476
11 changed files with 41 additions and 66 deletions

View File

@@ -82,20 +82,7 @@ RTImage::RTImage (const Glib::RefPtr<const Gio::Icon>& gIcon, const Gtk::IconSiz
void RTImage::set_from_icon_name(const Glib::ustring& iconName)
{
this->icon_name = iconName;
// Set surface from icon cache
surface = RTImageCache::getCachedSurface(this->icon_name, this->size);
// Add it to the RTImage if surface exists
if (surface) {
set(surface->get());
}
// Unset Gio::Icon if firstly exists
if (this->g_icon) {
g_icon = Glib::RefPtr<const Gio::Icon>();
}
set_from_icon_name(iconName, this->size);
}
void RTImage::set_from_icon_name(const Glib::ustring& iconName, const Gtk::IconSize iconSize)
@@ -119,17 +106,7 @@ void RTImage::set_from_icon_name(const Glib::ustring& iconName, const Gtk::IconS
void RTImage::set_from_gicon(const Glib::RefPtr<const Gio::Icon>& gIcon)
{
this->g_icon = gIcon;
// Set image from Gio::Icon
set(this->g_icon, this->size);
// Unset surface if previously chosen
this->icon_name = "";
if (surface) {
surface = std::shared_ptr<RTSurface>();
}
set_from_gicon(gIcon, this->size);
}
void RTImage::set_from_gicon(const Glib::RefPtr<const Gio::Icon>& gIcon, const Gtk::IconSize iconSize)