From 8e8787fa8cda4cdf5eadf88b1e7abd9250e8fa78 Mon Sep 17 00:00:00 2001 From: Nicolas Jager <nicolas.jager@savoirfairelinux.com> Date: Sun, 11 Dec 2016 17:25:17 -0500 Subject: [PATCH] fix : message text bugs - fix wrong unread notifications. - fix, closes the chat panel at the end of a call. - cleanup some tricky code. Change-Id: I65beca257bd4aee5451165ef6dc0a9ad5236161e Tuleap: #790 --- MainPage.xaml.cpp | 1 - MessageTextPage.xaml.cpp | 1 + SmartPanel.xaml | 2 -- VideoPage.xaml.cpp | 25 ++++++++----------------- VideoPage.xaml.h | 13 ------------- 5 files changed, 9 insertions(+), 33 deletions(-) diff --git a/MainPage.xaml.cpp b/MainPage.xaml.cpp index f219fb1..140a76b 100644 --- a/MainPage.xaml.cpp +++ b/MainPage.xaml.cpp @@ -232,7 +232,6 @@ void RingClientUWP::MainPage::OnsummonVideoPage() } } - videoPage->chatOpen = false; videoPage->updatePageContent(); showFrame(_videoFrame_); } diff --git a/MessageTextPage.xaml.cpp b/MessageTextPage.xaml.cpp index 9700db0..9c6be50 100644 --- a/MessageTextPage.xaml.cpp +++ b/MessageTextPage.xaml.cpp @@ -72,6 +72,7 @@ RingClientUWP::Views::MessageTextPage::updatePageContent() /* show the name of contact on the page */ _title_->Text = contact->_name; _profilName_->Text = contact->_displayName; + contact->_unreadMessages = 0; String^ image_path = Utils::toPlatformString(RingD::instance->getLocalFolder()) + ".vcards\\" + contact->_vcardUID + ".png"; if (Utils::fileExists(Utils::toString(image_path))) { diff --git a/SmartPanel.xaml b/SmartPanel.xaml index 187eda2..44d0983 100644 --- a/SmartPanel.xaml +++ b/SmartPanel.xaml @@ -256,8 +256,6 @@ </Border>--> <Border x:Name="_visualNotificationNewMessage_" Visibility="{x:Bind _contact._unreadMessages, Converter={StaticResource _NewMessageBubleNotification_}, Mode=OneWay}" - BorderThickness="2" - BorderBrush="White" Style="{StaticResource BorderStyle2}"> <TextBlock Text="{x:Bind _contact._unreadMessages, Mode=OneWay}" Style="{StaticResource TextStyle3}"/> diff --git a/VideoPage.xaml.cpp b/VideoPage.xaml.cpp index 67dc210..1ec2c97 100644 --- a/VideoPage.xaml.cpp +++ b/VideoPage.xaml.cpp @@ -136,6 +136,10 @@ VideoPage::VideoPage() } case CallStatus::ENDED: Video::VideoManager::instance->rendererManager()->raiseClearRenderTarget(); + + /* "close" the chat panel */ + _rowChatBx_->Height = 0; + break; case CallStatus::PEER_PAUSED: case CallStatus::PAUSED: @@ -267,15 +271,13 @@ void RingClientUWP::Views::VideoPage::_btnPause__Tapped(Platform::Object^ sender void RingClientUWP::Views::VideoPage::_btnChat__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e) { - chatOpen = !chatOpen; - _rowChatBx_->Height = (chatOpen) ? 200 : 0; - /*if (chatOpen) { + if (_rowChatBx_->Height == 0) { _rowChatBx_->Height = 200; - chatPanelCall(); + SmartPanelItemsViewModel::instance->_selectedItem->_contact->_unreadMessages = 0; } else { _rowChatBx_->Height = 0; - }*/ + } } @@ -395,19 +397,8 @@ VideoPage::WriteFrameAsSoftwareBitmapAsync(String^ id, uint8_t* buf, int width, void RingClientUWP::Views::VideoPage::OnincomingMessage(Platform::String ^callId, Platform::String ^payload) { - if (!chatOpen) { + if (_rowChatBx_->Height == 0) _rowChatBx_->Height = 200; - chatOpen = true; - } - - auto item = SmartPanelItemsViewModel::instance->_selectedItem; - - //if (item) - // if (item->_callId != callId) { - // SmartPanelItemsViewModel::instance->findItem(callId)->_contact->_unreadMessages++; - // //item->_contact->_unreadMessages++; - // } - scrollDown(); } diff --git a/VideoPage.xaml.h b/VideoPage.xaml.h index ffd567a..bda71fa 100644 --- a/VideoPage.xaml.h +++ b/VideoPage.xaml.h @@ -63,18 +63,6 @@ public: } } - property bool chatOpen // use this with a converter to set the height to 200px for the chatpanel... - { - bool get() - { - return chatOpen_; - } - void set(bool value) - { - chatOpen_ = value; - } - } - void scrollDown(); void screenVideo(bool state); @@ -95,7 +83,6 @@ internal: private: bool barFading_; - bool chatOpen_; void _sendBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void _messageTextBox__KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e); -- GitLab