[balsa/wip/gmime3] Use gtk_scrolled_window_get_{h,v}adjustment()
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/wip/gmime3] Use gtk_scrolled_window_get_{h,v}adjustment()
- Date: Thu, 5 Jul 2018 21:45:17 +0000 (UTC)
commit 4f6ae429189ca05d92d9441102f3340dd8a6b2b2
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Thu Jul 5 17:32:58 2018 -0400
Use gtk_scrolled_window_get_{h,v}adjustment()
* src/balsa-message.c (bm_find_scroll_to_rectangle), (select_part):
Use gtk_scrolled_window_get_{h,v}adjustment() instead of
GObject properties (and consequently, do not leak the
adjustments).
ChangeLog | 7 +++++++
src/balsa-message.c | 22 ++++++++++++----------
2 files changed, 19 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3682fd73c..17df57bd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-07-05 Peter Bloomfield <pbloomfield bellsouth net>
+
+ * src/balsa-message.c (bm_find_scroll_to_rectangle), (select_part):
+ Use gtk_scrolled_window_get_{h,v}adjustment() instead of
+ GObject properties (and consequently, do not leak the
+ adjustments).
+
2018-07-03 Albrecht Dreß <albrecht dress arcor de>
libnetclient private data fixes
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 35e3a5f7c..cb4056be5 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -393,16 +393,17 @@ bm_find_scroll_to_rectangle(BalsaMessage * bm,
GdkRectangle * rectangle)
{
gint x, y;
- GtkAdjustment *hadj, *vadj;
+ GtkAdjustment *adj;
+ GtkScrolledWindow *scroll = GTK_SCROLLED_WINDOW(bm->scroll);
gtk_widget_translate_coordinates(widget, bm->bm_widget->widget,
rectangle->x, rectangle->y,
&x, &y);
- g_object_get(G_OBJECT(bm->scroll), "hadjustment", &hadj,
- "vadjustment", &vadj, NULL);
- gtk_adjustment_clamp_page(hadj, x, x + rectangle->width);
- gtk_adjustment_clamp_page(vadj, y, y + rectangle->height);
+ adj = gtk_scrolled_window_get_hadjustment(scroll);
+ gtk_adjustment_clamp_page(adj, x, x + rectangle->width);
+ adj = gtk_scrolled_window_get_vadjustment(scroll);
+ gtk_adjustment_clamp_page(adj, y, y + rectangle->height);
}
static void
@@ -2300,12 +2301,13 @@ select_part(BalsaMessage * bm, BalsaPartInfo *info)
g_signal_emit(G_OBJECT(bm), balsa_message_signals[SELECT_PART], 0);
if (body != NULL) {
- GtkAdjustment *hadj, *vadj;
+ GtkScrolledWindow *scroll = GTK_SCROLLED_WINDOW(bm->scroll);
+ GtkAdjustment *adj;
- g_object_get(G_OBJECT(bm->scroll), "hadjustment", &hadj,
- "vadjustment", &vadj, NULL);
- gtk_adjustment_set_value(hadj, 0);
- gtk_adjustment_set_value(vadj, 0);
+ adj = gtk_scrolled_window_get_hadjustment(scroll);
+ gtk_adjustment_set_value(adj, 0);
+ adj = gtk_scrolled_window_get_vadjustment(scroll);
+ gtk_adjustment_set_value(adj, 0);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]