summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-21 13:14:55 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-21 13:14:55 (GMT)
commitf5cae065eee28c0dd9ae8446ab92d750bb077b17 (patch)
treea205b6dcd0241be3694f38f4783d7379f2083cf4
parent2d0f9881d872ec5fbba6dd64a58a00cb98966d35 (diff)
integrate a decent statusbar
-rw-r--r--src/view/katestatusbar.cpp53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/view/katestatusbar.cpp b/src/view/katestatusbar.cpp
index e301400..a40e67b 100644
--- a/src/view/katestatusbar.cpp
+++ b/src/view/katestatusbar.cpp
@@ -101,55 +101,54 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
bool KateStatusBar::eventFilter(QObject*, QEvent *e)
{
- if (e->type() == QEvent::MouseButtonPress)
- {
- m_view->setFocus();
- return true;
- }
+ if (e->type() == QEvent::MouseButtonPress) {
+ m_view->setFocus();
+ return true;
+ }
- return false;
+ return false;
}
void KateStatusBar::updateStatus ()
{
- viewModeChanged ();
- cursorPositionChanged ();
- selectionChanged ();
- modifiedChanged ();
- documentConfigChanged ();
- m_infoLabel->clear ();
+ viewModeChanged ();
+ cursorPositionChanged ();
+ selectionChanged ();
+ modifiedChanged ();
+ documentConfigChanged ();
+ m_infoLabel->clear ();
}
void KateStatusBar::viewModeChanged ()
{
- m_insertModeLabel->setText( QString::fromLatin1(" %1 ").arg (m_view->viewMode()) );
+ m_insertModeLabel->setText( QString::fromLatin1(" %1 ").arg (m_view->viewMode()) );
}
void KateStatusBar::cursorPositionChanged ()
{
- KTextEditor::Cursor position (m_view->cursorPositionVirtual());
-
- m_lineColLabel->setText(
- i18n(
- " Line: %1 of %2 Col: %3 "
- , QLocale().toString(position.line() + 1)
- , m_view->document()->lines()
- , QLocale().toString(position.column() + 1)
- )
- );
+ KTextEditor::Cursor position (m_view->cursorPositionVirtual());
+
+ m_lineColLabel->setText(
+ i18n(
+ " Line: %1 of %2 Col: %3 "
+ , QLocale().toString(position.line() + 1)
+ , m_view->document()->lines()
+ , QLocale().toString(position.column() + 1)
+ )
+ );
}
void KateStatusBar::selectionChanged ()
{
- m_selectModeLabel->setText( m_view->blockSelection() ? i18n(" BLOCK ") : i18n(" LINE ") );
+ m_selectModeLabel->setText( m_view->blockSelection() ? i18n(" BLOCK ") : i18n(" LINE ") );
}
void KateStatusBar::informationMessage (KTextEditor::View *, const QString &message)
{
- m_infoLabel->setText( message );
+ m_infoLabel->setText( message );
- // timer to reset this after 4 seconds
- QTimer::singleShot(4000, this, SLOT(updateStatus()));
+ // timer to reset this after 4 seconds
+ QTimer::singleShot(4000, this, SLOT(updateStatus()));
}
void KateStatusBar::modifiedChanged()