summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-22 16:29:30 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-22 16:29:30 (GMT)
commit93a54cfdf076f7cb4826ec8ab9b90d9fbfcd7fe3 (patch)
treedc7d815db0b3bc798223bb9ad989e8248d32a9fe
parentae67dc7effbc9f31b097bf8bd3ec008f533c60f0 (diff)
no resize between status bar, goto line and internal command line
-rw-r--r--src/dialogs/katedialogs.cpp8
-rw-r--r--src/view/katestatusbar.cpp19
-rw-r--r--src/view/katestatusbar.h3
3 files changed, 14 insertions, 16 deletions
diff --git a/src/dialogs/katedialogs.cpp b/src/dialogs/katedialogs.cpp
index 36c859a..846175e 100644
--- a/src/dialogs/katedialogs.cpp
+++ b/src/dialogs/katedialogs.cpp
@@ -1326,11 +1326,11 @@ KateGotoBar::KateGotoBar(KTextEditor::View *view, QWidget *parent)
QLabel *label = new QLabel(i18n("&Go to line:"), centralWidget());
label->setBuddy(gotoRange);
- QToolButton *btnOK = new QToolButton(centralWidget());
- btnOK->setAutoRaise(true);
- btnOK->setIcon(QIcon(SmallIcon(QLatin1String("go-jump"))));
+ QPushButton *btnOK = new QPushButton(centralWidget());
+ btnOK->setFlat(true);
+ btnOK->setIcon(SmallIcon(QLatin1String("go-jump")));
btnOK->setText(i18n("Go"));
- btnOK->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+ // btnOK->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
connect(btnOK, SIGNAL(clicked()), this, SLOT(gotoLine()));
topLayout->addWidget(label);
diff --git a/src/view/katestatusbar.cpp b/src/view/katestatusbar.cpp
index 4a5bbb3..87a0c40 100644
--- a/src/view/katestatusbar.cpp
+++ b/src/view/katestatusbar.cpp
@@ -29,12 +29,11 @@
#include <KIconLoader>
#include <QHBoxLayout>
-#include <QPixmap>
KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
: KateViewBarWidget(false)
, m_view(view)
- , m_modifiedStatus (0)
+ , m_modifiedStatus (-1)
{
setFocusProxy(m_view);
@@ -43,13 +42,11 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
*/
QHBoxLayout *topLayout = new QHBoxLayout(centralWidget());
topLayout->setMargin(0);
- topLayout->setSpacing(4);
- topLayout->addSpacing(4);
- m_modifiedLabel = new QLabel( this );
- m_modifiedLabel->setFixedSize (SmallIcon(QStringLiteral("document-save")).size());
+ m_modifiedLabel = new QToolButton( this );
+ m_modifiedLabel->setAutoRaise(true);
+ m_modifiedLabel->setEnabled(false);
topLayout->addWidget( m_modifiedLabel, 0 );
- m_modifiedLabel->setAlignment( Qt::AlignCenter );
m_modifiedLabel->setFocusProxy(m_view);
/**
@@ -164,20 +161,20 @@ void KateStatusBar::modifiedChanged()
m_modifiedStatus = newStatus;
switch (m_modifiedStatus) {
case 0x1:
- m_modifiedLabel->setPixmap (SmallIcon(QStringLiteral("document-save")));
+ m_modifiedLabel->setIcon (SmallIcon(QStringLiteral("document-save")));
break;
case 0x2:
- m_modifiedLabel->setPixmap (SmallIcon(QStringLiteral("dialog-warning")));
+ m_modifiedLabel->setIcon (SmallIcon(QStringLiteral("dialog-warning")));
break;
case 0x3:
- m_modifiedLabel->setPixmap (SmallIcon(QStringLiteral("document-save"), 0, KIconLoader::DefaultState,
+ m_modifiedLabel->setIcon (SmallIcon(QStringLiteral("document-save"), 0, KIconLoader::DefaultState,
QStringList() << QStringLiteral("emblem-important")));
break;
default:
- m_modifiedLabel->setPixmap (QPixmap());
+ m_modifiedLabel->setIcon (SmallIcon(QStringLiteral("text-plain")));
break;
}
}
diff --git a/src/view/katestatusbar.h b/src/view/katestatusbar.h
index eca8da5..9799120 100644
--- a/src/view/katestatusbar.h
+++ b/src/view/katestatusbar.h
@@ -28,6 +28,7 @@
#include <QLabel>
#include <QPushButton>
+#include <QToolButton>
class KateStatusBar : public KateViewBarWidget
{
@@ -56,7 +57,7 @@ public Q_SLOTS:
private:
KTextEditor::ViewPrivate *const m_view;
QLabel* m_lineColLabel;
- QLabel* m_modifiedLabel;
+ QToolButton* m_modifiedLabel;
QLabel* m_insertModeLabel;
QLabel* m_selectModeLabel;
QPushButton* m_mode;