diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-05-02 21:42:24 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-05-02 21:42:24 +0800 |
commit | e9ef0cff07611187f2230b08e396fc1637e14ec8 (patch) | |
tree | 61282f1dc5ace5252ba6d5f4f4a65124cb62b976 /libempathy-gtk/empathy-theme-adium.c | |
parent | 28e020cf508280879d2a7b8ea3ceec878f5c381b (diff) | |
download | gsoc2013-empathy-e9ef0cff07611187f2230b08e396fc1637e14ec8.tar gsoc2013-empathy-e9ef0cff07611187f2230b08e396fc1637e14ec8.tar.gz gsoc2013-empathy-e9ef0cff07611187f2230b08e396fc1637e14ec8.tar.bz2 gsoc2013-empathy-e9ef0cff07611187f2230b08e396fc1637e14ec8.tar.lz gsoc2013-empathy-e9ef0cff07611187f2230b08e396fc1637e14ec8.tar.xz gsoc2013-empathy-e9ef0cff07611187f2230b08e396fc1637e14ec8.tar.zst gsoc2013-empathy-e9ef0cff07611187f2230b08e396fc1637e14ec8.zip |
Adium: Temporally disable scrolling when appending backlog
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index 81cf01a39..66ce03316 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -64,6 +64,7 @@ typedef struct { GSettings *gsettings_chat; gboolean has_focus; gboolean has_unread_message; + gboolean allow_scrolling; } EmpathyThemeAdiumPriv; struct _EmpathyAdiumData { @@ -735,9 +736,9 @@ theme_adium_append_message (EmpathyChatView *view, /* Define javascript function to use */ if (consecutive) { - func = "appendNextMessage"; + func = priv->allow_scrolling ? "appendNextMessage" : "appendNextMessageNoScroll"; } else { - func = "appendMessage"; + func = priv->allow_scrolling ? "appendMessage" : "appendMessageNoScroll"; } html = priv->data->content_html; @@ -841,14 +842,18 @@ static void theme_adium_scroll (EmpathyChatView *view, gboolean allow_scrolling) { - /* FIXME: Is it possible? I guess we need a js function, but I don't - * see any... */ + EmpathyThemeAdiumPriv *priv = GET_PRIV (view); + + priv->allow_scrolling = allow_scrolling; + if (allow_scrolling) { + empathy_chat_view_scroll_down (view); + } } static void theme_adium_scroll_down (EmpathyChatView *view) { - webkit_web_view_execute_script (WEBKIT_WEB_VIEW (view), "scrollToBottom()"); + webkit_web_view_execute_script (WEBKIT_WEB_VIEW (view), "alignChat(true);"); } static gboolean @@ -1367,6 +1372,7 @@ empathy_theme_adium_init (EmpathyThemeAdium *theme) theme->priv = priv; + priv->allow_scrolling = TRUE; priv->smiley_manager = empathy_smiley_manager_dup_singleton (); g_signal_connect (theme, "load-finished", |