<table><tr><td style="">poboiko created this revision.<br />poboiko added reviewers: Frameworks, dfaure, mlaurent.<br />Herald added a project: Frameworks.<br />poboiko requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29208">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The patch includes following improvements:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">handleAfterKeyPressEvent</tt> was only used to adjust margins. We don't do it anymore, so get rid of it.</li>
<li class="remarkup-list-item">Add support for Tab key to increase indentation level (either at the beginning of a list item or with multiple lines selected)</li>
<li class="remarkup-list-item">Fix <tt style="background: #ebebeb; font-size: 13px;">canIndent / canDedent</tt> logic when cursor has a selection. <tt style="background: #ebebeb; font-size: 13px;">canIndent</tt> should work with <tt style="background: #ebebeb; font-size: 13px;">topOfSelection</tt>, and <tt style="background: #ebebeb; font-size: 13px;">canDedent</tt> --- with <tt style="background: #ebebeb; font-size: 13px;">bottomOfSelection</tt>.</li>
<li class="remarkup-list-item">Enclose <tt style="background: #ebebeb; font-size: 13px;">handleOnIndentMore / Less</tt> in <tt style="background: #ebebeb; font-size: 13px;">beginEditBlock / endEditBlock</tt>, so they appear as a single event in Undo stack.</li>
<li class="remarkup-list-item">A Return on an empty list element decreases the indentation (so double-Return terminates the list)</li>
</ol></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item">Tab / Return keys now work as explained</li>
<li class="remarkup-list-item">IndentMore / Less are undoable with single <tt style="background: #ebebeb; font-size: 13px;">Ctrl+Z</tt></li>
</ol>
<p>(this leads to cursor jumping around, which is probably beyond the scope of this patch)</p>
<ol class="remarkup-list" start="3">
<li class="remarkup-list-item">Increase / Decrease Indent actions now become enabled when they should if the selection is present</li>
</ol>
<p>(the behavior of <tt style="background: #ebebeb; font-size: 13px;">handleOnIndentMore / Less</tt> when selection is present is slightly broken, which is also beyond the scope)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R310 KTextWidgets</div></div></div><br /><div><strong>BRANCH</strong><div><div>unused (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29208">https://phabricator.kde.org/D29208</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/widgets/krichtextedit.cpp<br />
src/widgets/nestedlisthelper.cpp<br />
src/widgets/nestedlisthelper_p.h</div></div></div><br /><div><strong>To: </strong>poboiko, Frameworks, dfaure, mlaurent<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>