Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve indenting

  • Loading branch information...
commit 8b2637d3ab678fcde6a39e687173eca51204923f 1 parent eab5c13
@epienbroek authored
Showing with 91 additions and 94 deletions.
  1. +1 −1  jbsrc/lib/src/core/jb-main.c
  2. +90 −93 src/mn-mail-icon-widget.gob
View
2  jbsrc/lib/src/core/jb-main.c
@@ -191,7 +191,7 @@ jb_main (int argc,
"C compiler flags",
jb_variable_group_compiler_options,
0,
- "-g -O2");
+ "-g -O0");
jb_variable_add_string("cppflags",
"C preprocessor flags",
jb_variable_group_compiler_options,
View
183 src/mn-mail-icon-widget.gob
@@ -155,120 +155,117 @@ class MN:Mail:Icon:Widget from Gtk:Widget
if (! gtk_widget_is_drawable(widget) || ! selfp->stock_id)
return FALSE;
- if (selfp->is_on)
- {
- int x;
- int y;
- GdkRectangle image_area;
- GtkAllocation allocation;
- GtkRequisition requisition;
+ if (selfp->is_on) {
+ int x;
+ int y;
+ GdkRectangle image_area;
+ GtkAllocation allocation;
+ GtkRequisition requisition;
- /* note: widget->requisition is the pixbuf size, see size_request() */
+ /* note: widget->requisition is the pixbuf size, see size_request() */
- gtk_widget_get_allocation(widget, &allocation);
- gtk_widget_get_requisition(widget, &requisition);
+ gtk_widget_get_allocation(widget, &allocation);
+ gtk_widget_get_requisition(widget, &requisition);
- x = floor(allocation.x + ((allocation.width - requisition.width) * ICON_XALIGN));
- y = floor(allocation.y + ((allocation.height - requisition.height) * ICON_YALIGN));
+ x = floor(allocation.x + ((allocation.width - requisition.width) * ICON_XALIGN));
+ y = floor(allocation.y + ((allocation.height - requisition.height) * ICON_YALIGN));
- image_area.x = x;
- image_area.y = y;
- image_area.width = requisition.width;
- image_area.height = requisition.height;
+ image_area.x = x;
+ image_area.y = y;
+ image_area.width = requisition.width;
+ image_area.height = requisition.height;
#if 0
- if (gdk_rectangle_intersect(&event->area, &image_area, &image_area))
+ if (gdk_rectangle_intersect(&event->area, &image_area, &image_area))
#endif
{
- GdkPixbuf *pixbuf;
+ GdkPixbuf *pixbuf;
- pixbuf = self_render_icon(self);
- gdk_cairo_set_source_pixbuf(cr, pixbuf, image_area.x, image_area.y);
- cairo_move_to(cr, image_area.x - x, image_area.y - y);
- cairo_paint(cr);
+ pixbuf = self_render_icon(self);
+ gdk_cairo_set_source_pixbuf(cr, pixbuf, image_area.x, image_area.y);
+ cairo_move_to(cr, image_area.x - x, image_area.y - y);
+ cairo_paint(cr);
#if 0
- gdk_draw_pixbuf(widget->window,
- NULL,
- pixbuf,
- image_area.x - x,
- image_area.y - y,
- image_area.x,
- image_area.y,
- image_area.width,
- image_area.height,
- GDK_RGB_DITHER_NORMAL,
- 0,
- 0);
+ gdk_draw_pixbuf(widget->window,
+ NULL,
+ pixbuf,
+ image_area.x - x,
+ image_area.y - y,
+ image_area.x,
+ image_area.y,
+ image_area.width,
+ image_area.height,
+ GDK_RGB_DITHER_NORMAL,
+ 0,
+ 0);
#endif
- g_object_unref(pixbuf);
+ g_object_unref(pixbuf);
}
- }
+ }
- if (selfp->count)
- {
- PangoRectangle count_rect;
- int count_x;
- int count_y;
- int box_x;
- int box_y;
- int box_width;
- int box_height;
- GtkAllocation allocation;
-
- gtk_widget_get_allocation(widget, &allocation);
-
- if (! selfp->count_layout)
- {
- const char *size;
- char *markup;
+ if (selfp->count) {
+ PangoRectangle count_rect;
+ int count_x;
+ int count_y;
+ int box_x;
+ int box_y;
+ int box_width;
+ int box_height;
+ GtkAllocation allocation;
- if (allocation.height < 32)
- size = "small";
- else
- size = "medium";
+ gtk_widget_get_allocation(widget, &allocation);
- selfp->count_layout = gtk_widget_create_pango_layout(widget, NULL);
+ if (! selfp->count_layout) {
+ const char *size;
+ char *markup;
- markup = g_strdup_printf("<span size=\"%s\">%i</span>", size, selfp->count);
- pango_layout_set_markup(selfp->count_layout, markup, -1);
- g_free(markup);
- }
+ if (allocation.height < 32)
+ size = "small";
+ else
+ size = "medium";
+
+ selfp->count_layout = gtk_widget_create_pango_layout(widget, NULL);
- pango_layout_get_pixel_extents(selfp->count_layout, &count_rect, NULL);
-
- box_width = count_rect.width + COUNT_BOX_XPAD * 2;
- box_height = count_rect.height + COUNT_BOX_YPAD * 2;
-
- box_x = allocation.x + allocation.width - box_width - COUNT_BOX_XMARGIN;
- box_y = allocation.y + allocation.height - box_height - COUNT_BOX_YMARGIN;
-
- count_x = box_x - count_rect.x + COUNT_BOX_XPAD;
- count_y = box_y - count_rect.y + COUNT_BOX_YPAD;
-
- gtk_paint_box(gtk_widget_get_style(widget),
- cr,
- gtk_widget_get_state_flags(widget),
- GTK_SHADOW_OUT,
- widget,
- NULL,
- box_x,
- box_y,
- box_width,
- box_height);
-
- gtk_paint_layout(gtk_widget_get_style(widget),
- cr,
- gtk_widget_get_state_flags(widget),
- FALSE,
- widget,
- NULL,
- count_x,
- count_y,
- selfp->count_layout);
+ markup = g_strdup_printf("<span size=\"%s\">%i</span>", size, selfp->count);
+ pango_layout_set_markup(selfp->count_layout, markup, -1);
+ g_free(markup);
}
+ pango_layout_get_pixel_extents(selfp->count_layout, &count_rect, NULL);
+
+ box_width = count_rect.width + COUNT_BOX_XPAD * 2;
+ box_height = count_rect.height + COUNT_BOX_YPAD * 2;
+
+ box_x = allocation.x + allocation.width - box_width - COUNT_BOX_XMARGIN;
+ box_y = allocation.y + allocation.height - box_height - COUNT_BOX_YMARGIN;
+
+ count_x = box_x - count_rect.x + COUNT_BOX_XPAD;
+ count_y = box_y - count_rect.y + COUNT_BOX_YPAD;
+
+ gtk_paint_box(gtk_widget_get_style(widget),
+ cr,
+ gtk_widget_get_state_flags(widget),
+ GTK_SHADOW_OUT,
+ widget,
+ NULL,
+ box_x,
+ box_y,
+ box_width,
+ box_height);
+
+ gtk_paint_layout(gtk_widget_get_style(widget),
+ cr,
+ gtk_widget_get_state_flags(widget),
+ FALSE,
+ widget,
+ NULL,
+ count_x,
+ count_y,
+ selfp->count_layout);
+ }
+
return FALSE;
}
Please sign in to comment.
Something went wrong with that request. Please try again.