Changeset bf5f87a7befd…
Parent 69689dc06a96…
by
Changes to 2 files · Browse files at bf5f87a7befd Showing diff from parent 69689dc06a96 Diff from another changeset...
@@ -14,7 +14,7 @@ from mercurial import hg, error, extensions, util
from tortoisehg.util import hglib, paths
from tortoisehg.hgqt.i18n import _
-from tortoisehg.hgqt import cmdui
+from tortoisehg.hgqt import cmdui, lexers
try:
from tortoisehg.hgqt.ui_hgemail import Ui_EmailDialog
@@ -207,6 +207,14 @@ return len(self._revs) > 1
def _initpreviewtab(self):
+ def initqsci(w):
+ w.setUtf8(True)
+ w.setReadOnly(True)
+ w.setMarginWidth(1, 0) # hide area for line numbers
+ w.setLexer(lexers.DiffLexerSelector().lexer())
+ # TODO: better way to setup diff lexer
+ initqsci(self._qui.preview_edit)
+
self.connect(self._qui.main_tabs, SIGNAL('currentChanged(int)'),
self._refreshpreviewtab)
self._refreshpreviewtab(self._qui.main_tabs.currentIndex())
|
@@ -283,16 +283,7 @@ </attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
- <widget class="QTextEdit" name="preview_edit">
- <property name="font">
- <font>
- <family>Monospace</family>
- </font>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
+ <widget class="QsciScintilla" name="preview_edit"/>
</item>
</layout>
</widget>
@@ -343,6 +334,13 @@ </item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>QsciScintilla</class>
+ <extends>QFrame</extends>
+ <header>Qsci/qsciscintilla.h</header>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>main_tabs</tabstop>
<tabstop>to_edit</tabstop>
|
Loading...