Convert remaining RTPixbuf to RTSurface

Changes:
- Remove RTPixbuf use in directory browser to use native GTK mechanism
- Replace RTPixbuf by RTSurface for thumbnail icons
- Remove now useless RTPixbuf class

Fixes:
- Elaborate RTSurface width / height based on the type
This commit is contained in:
Pandagrapher
2022-08-27 11:37:59 +02:00
parent 36222d14a2
commit 50e54aa395
11 changed files with 151 additions and 297 deletions

View File

@@ -53,36 +53,3 @@ public:
Cairo::RefPtr<Cairo::ImageSurface> get();
};
/**
* @brief A custom class in order to handle Hi-DPI pixbuf.
*/
class RTPixbuf final : public RTScalable
{
public:
enum RTPixbufType {
InvalidType = 1,
IconType = 2,
PNGType = 3,
SVGType = 4
};
private:
double dpiBack; // Used to identify dpi change
int scaleBack; // Used to identify scale change
RTPixbufType type;
Glib::ustring name;
Gtk::IconSize icon_size;
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
public:
RTPixbuf();
explicit RTPixbuf(const Glib::ustring &icon_name, const Gtk::IconSize iconSize);
explicit RTPixbuf(const Glib::ustring &fname);
int getWidth();
int getHeight();
bool hasPixbuf();
Glib::RefPtr<Gdk::Pixbuf> get();
};