From 6058a885f2464b624c5a0ff6cc47cc70422b94eb Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 27 Jan 2009 09:46:57 +0100 Subject: [PATCH 1/2] Fixes: fakevim: improvements for 'o' and 's' --- src/plugins/fakevim/fakevimhandler.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 3b981fa6a23..8a164fee4d5 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -908,11 +908,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveToFirstNonBlankOnLine(); finishMovement(); } else if (key == 'i') { + recordBeginGroup(); enterInsertMode(); updateMiniBuffer(); if (atEndOfLine()) moveLeft(); } else if (key == 'I') { + recordBeginGroup(); setAnchor(); enterInsertMode(); if (m_gflag) @@ -976,13 +978,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == 'N') { search(lastSearchString(), !m_lastSearchForward); } else if (key == 'o' || key == 'O') { + recordBeginGroup(); + recordMove(); enterInsertMode(); moveToFirstNonBlankOnLine(); - recordBeginGroup(); int numSpaces = leftDist(); - moveUp(); - if (key == 'o') - moveDown(); + if (key == 'O') + moveUp(); moveToEndOfLine(); recordInsertText("\n"); moveToStartOfLine(); @@ -990,7 +992,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, recordInsertText(QString(indentDist(), ' ')); else recordInsertText(QString(numSpaces, ' ')); - recordEndGroup(); } else if (key == 'p' || key == 'P') { recordBeginGroup(); QString text = m_registers[m_register]; @@ -1034,8 +1035,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, redo(); } else if (key == 's') { recordBeginGroup(); - m_submode = ChangeSubMode; + setAnchor(); moveRight(qMin(count(), rightDist())); + m_registers[m_register] = recordRemoveSelectedText(); + //m_dotCommand = QString("%1s").arg(count()); + m_opcount.clear(); + m_mvcount.clear(); + enterInsertMode(); } else if (key == 't' || key == 'T') { m_subsubmode = FtSubSubMode; m_subsubdata = key; @@ -2043,7 +2049,6 @@ void FakeVimHandler::Private::enterInsertMode() EDITOR(setOverwriteMode(false)); m_mode = InsertMode; m_lastInsertion.clear(); - recordBeginGroup(); } void FakeVimHandler::Private::enterCommandMode() From e4876723a4ed506b641db9df9f5e00155c9be378 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 27 Jan 2009 10:09:37 +0100 Subject: [PATCH 2/2] Fixes: Use alternate row colors for sidebar Task: As discussed with b_lindeijer Details: This enables alternate row colors, with filled empty area on the side bar for improved usability. --- src/plugins/coreplugin/manhattanstyle.cpp | 13 +++++++++---- src/plugins/projectexplorer/projecttreewidget.cpp | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 47e13dec297..af361aacbb9 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -388,15 +388,20 @@ QPixmap ManhattanStyle::standardPixmap(StandardPixmap standardPixmap, const QSty int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const { - int ret = 0; + int ret = d->style->styleHint(hint, option, widget, returnData); switch (hint) { + // Make project explorer alternate rows all the way + case QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea: + if (widget && widget->property("AlternateEmpty").toBool()) + ret = true; + break; case QStyle::SH_EtchDisabledText: - ret = false; // We really should only enforce this for panel widgets + if (panelWidget(widget)) + ret = false; break; default: - ret = d->style->styleHint(hint, option, widget, returnData); + break; } - return ret; } diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 3329f80788a..f08885ab6b9 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -73,6 +73,8 @@ public: setContextMenuPolicy(Qt::CustomContextMenu); setUniformRowHeights(true); setTextElideMode(Qt::ElideNone); + setAlternatingRowColors(true); + setProperty("AlternateEmpty", true); // Let Manhattan to override style default // setExpandsOnDoubleClick(false); }