mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
Restructure source and resource files (#46)
importantly, res is now res/res and css is now res/css
This commit is contained in:
committed by
GitHub
parent
d88079000a
commit
a51a54bc59
21
src/components/lazyimage.hpp
Normal file
21
src/components/lazyimage.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include <gtkmm.h>
|
||||
|
||||
// loads an image only when the widget is drawn for the first time
|
||||
class LazyImage : public Gtk::Image {
|
||||
public:
|
||||
LazyImage(int w, int h, bool use_placeholder = true);
|
||||
LazyImage(const std::string &url, int w, int h, bool use_placeholder = true);
|
||||
|
||||
void SetAnimated(bool is_animated);
|
||||
void SetURL(const std::string &url);
|
||||
|
||||
private:
|
||||
bool OnDraw(const Cairo::RefPtr<Cairo::Context> &context);
|
||||
|
||||
bool m_animated = false;
|
||||
bool m_needs_request = true;
|
||||
std::string m_url;
|
||||
int m_width;
|
||||
int m_height;
|
||||
};
|
||||
Reference in New Issue
Block a user