Scroll chat widget to bottom on show and resize events
authorunc0rr
Mon, 07 Oct 2013 22:22:49 +0400
changeset 9493 23c674bfa2e2
parent 9491 e9f124a10804
child 9495 2fc346fadae3
Scroll chat widget to bottom on show and resize events
QTfrontend/ui/widget/chatwidget.cpp
QTfrontend/ui/widget/chatwidget.h
--- a/QTfrontend/ui/widget/chatwidget.cpp	Fri Oct 04 18:41:06 2013 +0400
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Mon Oct 07 22:22:49 2013 +0400
@@ -930,3 +930,17 @@
         chatText->verticalScrollBar()->setValue(m_scrollBarPos);
     }
 }
+
+void HWChatWidget::resizeEvent(QResizeEvent * event)
+{
+    Q_UNUSED(event);
+
+    afterContentAdd();
+}
+
+void HWChatWidget::showEvent(QShowEvent * event)
+{
+    Q_UNUSED(event);
+
+     afterContentAdd();
+}
--- a/QTfrontend/ui/widget/chatwidget.h	Fri Oct 04 18:41:06 2013 +0400
+++ b/QTfrontend/ui/widget/chatwidget.h	Mon Oct 07 22:22:49 2013 +0400
@@ -68,6 +68,8 @@
     protected:
         virtual void dragEnterEvent(QDragEnterEvent * event);
         virtual void dropEvent(QDropEvent * event);
+        virtual void resizeEvent(QResizeEvent * event);
+        virtual void showEvent(QShowEvent * event);
 
     private:
         static QString * s_styleSheet;