From 756345b202d4a609cb596d0bd75e7133b69c4d54 Mon Sep 17 00:00:00 2001 From: epage Date: Wed, 14 Oct 2009 02:10:32 +0000 Subject: [PATCH] Switching how the SMS Entry dialog scrolls git-svn-id: file:///svnroot/gc-dialer/trunk@526 c39d3808-3fe2-4d86-a59f-b7f623ee9f21 --- src/dialcentral.glade | 241 +++++++++++++++++++++++++------------------------ src/gv_views.py | 17 ++-- 2 files changed, 133 insertions(+), 125 deletions(-) diff --git a/src/dialcentral.glade b/src/dialcentral.glade index 88fc4e5..b193407 100644 --- a/src/dialcentral.glade +++ b/src/dialcentral.glade @@ -174,10 +174,10 @@ False False - - - + + + True @@ -200,10 +200,10 @@ False False - - - + + + True @@ -226,10 +226,10 @@ False False - - - + + + True @@ -252,10 +252,10 @@ False False - - - + + + True @@ -280,10 +280,10 @@ False False - - - + + + True @@ -308,11 +308,11 @@ False False - - - - + + + + True @@ -335,10 +335,10 @@ False False - - - + + + True @@ -363,11 +363,11 @@ False False - - - - + + + + True @@ -995,8 +995,6 @@ Send SMS True center-on-parent - 500 - 300 True dialog True @@ -1008,111 +1006,116 @@ vertical 2 - + True - vertical + True + automatic + automatic - + True - True - never - automatic + queue - + True - True + vertical + + + True + True + + + False + 0 + + + + + True + + + False + 1 + + + + + True + vertical + + + True + True + never + automatic + + + True + True + word + + + + + 0 + + + + + 2 + + + + + True + + + No Phone Types Available + True + True + True + + + False + 0 + + + + + True + Letters Left: + True + + + False + False + 1 + + + + + True + True + + + 2 + + + + + False + 3 + + - - 0 - 1 - - - True - - - False - 2 - - - - - True - vertical - - - True - True - never - automatic - - - True - True - word - - - - - False - 0 - - - - - False - 3 - - - - - True - - - No Phone Types Available - True - True - True - - - False - 0 - - - - - True - Letters Left: - True - - - False - False - 1 - - - - - True - True - - - 2 - - - - - False - 4 - - True diff --git a/src/gv_views.py b/src/gv_views.py index 0c67133..93c2fcf 100644 --- a/src/gv_views.py +++ b/src/gv_views.py @@ -292,7 +292,10 @@ class SmsEntryDialog(object): self._messagemodel = gtk.ListStore(gobject.TYPE_STRING) self._messagesView = self._widgetTree.get_widget("smsMessages") - self._scrollWindow = self._messagesView.get_parent() + + self._conversationView = self._messagesView.get_parent() + self._conversationViewPort = self._conversationView.get_parent() + self._scrollWindow = self._conversationViewPort.get_parent() self._phoneButton = self._widgetTree.get_widget("phoneTypeSelection") self._smsEntry = self._widgetTree.get_widget("smsEntry") @@ -353,14 +356,16 @@ class SmsEntryDialog(object): if parent is not None: self._dialog.set_transient_for(parent) parentSize = parent.get_size() - self._dialog.resize(parentSize[0], max(parentSize[1]-100, 100)) + self._dialog.resize(parentSize[0], max(parentSize[1]-10, 100)) # Run try: - self._dialog.show() - if messages: - self._messagesView.scroll_to_cell((len(messages)-1, )) + self._dialog.show_all() self._smsEntry.grab_focus() + adjustment = self._scrollWindow.get_vadjustment() + dx = self._conversationView.get_allocation().height - self._conversationViewPort.get_allocation().height + dx = max(dx, 0) + adjustment.value = dx if 1 < len(self._contactDetails): if defaultIndex == -1: @@ -371,7 +376,7 @@ class SmsEntryDialog(object): userResponse = self._dialog.run() finally: - self._dialog.hide() + self._dialog.hide_all() # Process the users response if userResponse == gtk.RESPONSE_OK and 0 <= self._numberIndex: -- 1.7.9.5