[balsa/wip/gtk4: 198/351] cite-bar: Use graphene_rect_init
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/wip/gtk4: 198/351] cite-bar: Use graphene_rect_init
- Date: Wed, 23 May 2018 21:33:36 +0000 (UTC)
commit 696cd3b8bc3aa7415a20c5e984770124d2f15daf
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Wed Feb 28 20:29:53 2018 -0500
cite-bar: Use graphene_rect_init
instead of an aggregate initializer.
src/balsa-cite-bar.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/balsa-cite-bar.c b/src/balsa-cite-bar.c
index 514b1fe..1bece82 100644
--- a/src/balsa-cite-bar.c
+++ b/src/balsa-cite-bar.c
@@ -125,20 +125,21 @@ balsa_cite_bar_measure(GtkWidget * widget,
static void
balsa_cite_bar_snapshot(GtkWidget * widget, GtkSnapshot * snapshot)
{
- BalsaCiteBar *cite_bar = BALSA_CITE_BAR(widget);
- graphene_rect_t bounds =
- { {0.0, 0.0}, {(float) cite_bar->width, (float) cite_bar->height} };
GtkStyleContext *context;
GdkRGBA rgba;
- int n, x;
+ int n;
+ BalsaCiteBar *cite_bar;
+ graphene_rect_t bounds;
context = gtk_widget_get_style_context(widget);
gtk_style_context_get_color(context, &rgba);
- for (n = x = 0; n < cite_bar->bars; n++) {
- bounds.origin.x = (float) x;
- gtk_snapshot_append_color(snapshot, &rgba, &bounds, "CiteBar");
+ cite_bar = BALSA_CITE_BAR(widget);
+ graphene_rect_init(&bounds, 0.0, 0.0,
+ (float) cite_bar->width, (float) cite_bar->height);
- x += cite_bar->width + cite_bar->space;
+ for (n = 0; n < cite_bar->bars; n++) {
+ gtk_snapshot_append_color(snapshot, &rgba, &bounds, "CiteBar");
+ bounds.origin.x += (float) (cite_bar->width + cite_bar->space);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]