[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:19:30 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=53066d7
The following commit has been merged in the master branch:
commit 53066d7730ed49c6558bb881a932956ec0360b93
Author: Lasath Fernando <kde at lasath.org>
Date: Sat Jun 25 20:45:50 2011 +1000
I'm not sure what I did in the previous commit, but this is the one that actually adds the new signal to proxy PageUp/PageDown events from ChatTextEdit to AdiumThemeView
---
lib/adium-theme-view.cpp | 4 ++++
lib/adium-theme-view.h | 1 +
lib/chat-text-edit.cpp | 28 +++++++++++++++++++++-------
lib/chat-text-edit.h | 1 +
lib/chat-widget.cpp | 3 +++
5 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/lib/adium-theme-view.cpp b/lib/adium-theme-view.cpp
index 2a8b36e..aa80d44 100644
--- a/lib/adium-theme-view.cpp
+++ b/lib/adium-theme-view.cpp
@@ -425,6 +425,10 @@ QString AdiumThemeView::replaceMessageKeywords(QString &htmlTemplate, const Adiu
return htmlTemplate;
}
+void AdiumThemeView::onScrollEvent(QKeyEvent* e)
+{
+ keyPressEvent(e);
+}
void AdiumThemeView::appendNewMessage(QString &html)
{
diff --git a/lib/adium-theme-view.h b/lib/adium-theme-view.h
index d7c6cb2..54ab95c 100644
--- a/lib/adium-theme-view.h
+++ b/lib/adium-theme-view.h
@@ -64,6 +64,7 @@ public slots:
void addContentMessage(const AdiumThemeContentInfo&);
void addStatusMessage(const AdiumThemeStatusInfo&);
void onLinkClicked(const QUrl&);
+ void onScrollEvent(QKeyEvent*);
private:
ChatWindowStyle* m_chatStyle;
diff --git a/lib/chat-text-edit.cpp b/lib/chat-text-edit.cpp
index 4c3a4c0..21e9953 100644
--- a/lib/chat-text-edit.cpp
+++ b/lib/chat-text-edit.cpp
@@ -25,9 +25,9 @@
#include <QtCore/QTimer>
ChatTextEdit::ChatTextEdit(QWidget *parent) :
- KTextEdit(parent)
+ KTextEdit(parent)
{
- setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); // no need for horizontal scrollbar with this
+ setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); // no need for horizontal scrollbar with this
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setCheckSpellingEnabled(true);
@@ -42,9 +42,12 @@ ChatTextEdit::ChatTextEdit(QWidget *parent) :
void ChatTextEdit::setFontBold(bool isBold)
{
- if (isBold) {
+ if (isBold)
+ {
setFontWeight(QFont::Bold);
- } else {
+ }
+ else
+ {
setFontWeight(QFont::Normal);
}
}
@@ -63,16 +66,27 @@ QSize ChatTextEdit::minimumSizeHint() const
QSize ChatTextEdit::sizeHint() const
{
QSize sh = QTextEdit::sizeHint();
- sh.setHeight(int(document()->size().height()));
+ sh.setHeight(int (document()->size().height()));
sh += QSize(0, (QFrame::lineWidth() * 2) + 1);
return sh;
}
void ChatTextEdit::keyPressEvent(QKeyEvent* e)
{
- if (e->matches(QKeySequence::Find)) {
- emit findTextShortcutPressed();
+ switch (e->key())
+ {
+ case Qt::Key_PageUp :
+ case Qt::Key_PageDown :
+ emit scrollEventRecieved(e);
+ break;
+
+ default :
+ if (e->matches(QKeySequence::Find))
+ {
+ emit findTextShortcutPressed();
+ }
}
+
KTextEdit::keyPressEvent(e);
}
diff --git a/lib/chat-text-edit.h b/lib/chat-text-edit.h
index 4f553da..4c548ec 100644
--- a/lib/chat-text-edit.h
+++ b/lib/chat-text-edit.h
@@ -45,6 +45,7 @@ private slots:
signals:
void findTextShortcutPressed();
+ void scrollEventRecieved(QKeyEvent*);
public slots:
/** wraps setFontWeight to a simple on/off bold) */
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index b12162d..997b011 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -232,6 +232,9 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
connect(d->ui.searchBar, SIGNAL(flagsChangedSignal(QString,QWebPage::FindFlags)), this, SLOT(findTextInChat(QString,QWebPage::FindFlags)));
connect(this, SIGNAL(searchTextComplete(bool)), d->ui.searchBar, SLOT(onSearchTextComplete(bool)));
+
+ // to make PgUp and PgDown keys work properly
+ connect(d->ui.sendMessageBox, SIGNAL(scrollEventRecieved(QKeyEvent*)), d->ui.chatArea, SLOT(onScrollEvent(QKeyEvent*)));
}
ChatWidget::~ChatWidget()
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list