29 #define G_LOG_DOMAIN "Widgets.Icon"
60 int iconh = cairo_image_surface_get_height(b->
icon);
61 int iconw = cairo_image_surface_get_width(b->
icon);
62 int icons = MAX(iconh, iconw);
63 double scale = (double)b->
size / icons;
64 height = iconh * scale;
75 int iconh = cairo_image_surface_get_height(b->
icon);
76 int iconw = cairo_image_surface_get_width(b->
icon);
77 int icons = MAX(iconh, iconw);
78 double scale = (double)b->
size / icons;
79 width = iconw * scale;
92 cairo_surface_reference(b->
icon);
95 if (b->
icon == NULL) {
98 int iconh = cairo_image_surface_get_height(b->
icon);
99 int iconw = cairo_image_surface_get_width(b->
icon);
100 int icons = MAX(iconh, iconw);
101 double scale = (double)b->
size / icons;
111 draw, lpad + (b->
widget.
w - iconw * scale - lpad - rpad) * b->
xalign,
112 tpad + (b->
widget.
h - iconh * scale - tpad - bpad) * b->
yalign);
113 cairo_scale(draw, scale, scale);
114 cairo_set_source_surface(draw, b->
icon, 0, 0);
123 cairo_surface_destroy(b->
icon);
145 cairo_surface_reference(surf);
cairo_surface_t * rofi_icon_fetcher_get(const uint32_t uid)
uint32_t rofi_icon_fetcher_query(const char *name, const int size)
void icon_set_surface(icon *icon, cairo_surface_t *surf)
icon * icon_create(widget *parent, const char *name)
static int icon_get_desired_width(widget *widget)
static int icon_get_desired_height(widget *widget)
static void icon_free(widget *wid)
static void icon_resize(widget *widget, short w, short h)
static void icon_draw(widget *wid, cairo_t *draw)
@ ROFI_ORIENTATION_VERTICAL
RofiDistance rofi_theme_get_distance(const widget *widget, const char *property, int def)
int rofi_theme_get_boolean(const widget *widget, const char *property, int def)
int distance_get_pixel(RofiDistance d, RofiOrientation ori)
double rofi_theme_get_double(const widget *widget, const char *property, double def)
const char * rofi_theme_get_string(const widget *widget, const char *property, const char *def)