[libgd/wip/ernestask/gtk4: 2/6] toggle-pixbuf-renderer: hardcode icon size
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd/wip/ernestask/gtk4: 2/6] toggle-pixbuf-renderer: hardcode icon size
- Date: Sat, 10 Mar 2018 10:13:28 +0000 (UTC)
commit 555aa1dbaaa8b5436a2cd2eede9aae9d49ea111d
Author: Ernestas Kulik <ernestask gnome org>
Date: Sat Mar 10 11:13:43 2018 +0200
toggle-pixbuf-renderer: hardcode icon size
Widget style properties are now goneski.
libgd/gd-toggle-pixbuf-renderer.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/libgd/gd-toggle-pixbuf-renderer.c b/libgd/gd-toggle-pixbuf-renderer.c
index fa23cb6..1eef19d 100644
--- a/libgd/gd-toggle-pixbuf-renderer.c
+++ b/libgd/gd-toggle-pixbuf-renderer.c
@@ -21,6 +21,8 @@
#include "gd-toggle-pixbuf-renderer.h"
+#define CHECK_ICON_SIZE 40
+
G_DEFINE_TYPE (GdTogglePixbufRenderer, gd_toggle_pixbuf_renderer, GTK_TYPE_CELL_RENDERER_PIXBUF);
enum {
@@ -124,7 +126,6 @@ gd_toggle_pixbuf_renderer_render (GtkCellRenderer *cell,
const GdkRectangle *cell_area,
GtkCellRendererState flags)
{
- gint icon_size = -1;
GdTogglePixbufRenderer *self = GD_TOGGLE_PIXBUF_RENDERER (cell);
gint xpad, ypad;
@@ -133,15 +134,10 @@ gd_toggle_pixbuf_renderer_render (GtkCellRenderer *cell,
background_area, cell_area, flags);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
- gtk_widget_style_get (widget,
- "check-icon-size", &icon_size,
- NULL);
- if (icon_size == -1)
- icon_size = 40;
- render_activity (self, cr, widget, cell_area, icon_size, xpad, ypad);
- render_check (self, cr, widget, cell_area, icon_size, xpad, ypad);
+ render_activity (self, cr, widget, cell_area, CHECK_ICON_SIZE, xpad, ypad);
+ render_check (self, cr, widget, cell_area, CHECK_ICON_SIZE, xpad, ypad);
}
static void
@@ -153,17 +149,11 @@ gd_toggle_pixbuf_renderer_get_size (GtkCellRenderer *cell,
gint *width,
gint *height)
{
- gint icon_size;
-
- gtk_widget_style_get (widget,
- "check-icon-size", &icon_size,
- NULL);
-
GTK_CELL_RENDERER_CLASS (gd_toggle_pixbuf_renderer_parent_class)->get_size
(cell, widget, cell_area,
x_offset, y_offset, width, height);
- *width += icon_size / 4;
+ *width += CHECK_ICON_SIZE / 4;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]