35 """ |
35 """ |
36 super(EditorStylesPage, self).__init__() |
36 super(EditorStylesPage, self).__init__() |
37 self.setupUi(self) |
37 self.setupUi(self) |
38 self.setObjectName("EditorStylesPage") |
38 self.setObjectName("EditorStylesPage") |
39 |
39 |
40 from QScintilla.QsciScintillaCompat import QsciScintillaCompat, \ |
40 from QScintilla.QsciScintillaCompat import QsciScintillaCompat |
41 QSCINTILLA_VERSION |
41 |
42 self.foldStyles = [ |
42 self.foldStyles = [ |
43 QsciScintilla.PlainFoldStyle, |
43 QsciScintilla.PlainFoldStyle, |
44 QsciScintilla.CircledFoldStyle, |
44 QsciScintilla.CircledFoldStyle, |
45 QsciScintilla.BoxedFoldStyle, |
45 QsciScintilla.BoxedFoldStyle, |
46 QsciScintilla.CircledTreeFoldStyle, |
46 QsciScintilla.CircledTreeFoldStyle, |
65 self.tr("No Indicator"), QsciScintilla.WrapFlagNone) |
65 self.tr("No Indicator"), QsciScintilla.WrapFlagNone) |
66 self.wrapVisualComboBox.addItem( |
66 self.wrapVisualComboBox.addItem( |
67 self.tr("Indicator by Text"), QsciScintilla.WrapFlagByText) |
67 self.tr("Indicator by Text"), QsciScintilla.WrapFlagByText) |
68 self.wrapVisualComboBox.addItem( |
68 self.wrapVisualComboBox.addItem( |
69 self.tr("Indicator by Margin"), QsciScintilla.WrapFlagByBorder) |
69 self.tr("Indicator by Margin"), QsciScintilla.WrapFlagByBorder) |
70 if QSCINTILLA_VERSION() >= 0x020700: |
70 self.wrapVisualComboBox.addItem( |
71 self.wrapVisualComboBox.addItem( |
71 self.tr("Indicator in Line Number Margin"), |
72 self.tr("Indicator in Line Number Margin"), |
72 QsciScintilla.WrapFlagInMargin) |
73 QsciScintilla.WrapFlagInMargin) |
|
74 |
73 |
75 self.wrapIndentComboBox.addItem( |
74 self.wrapIndentComboBox.addItem( |
76 self.tr("Fixed"), QsciScintilla.WrapIndentFixed) |
75 self.tr("Fixed"), QsciScintilla.WrapIndentFixed) |
77 self.wrapIndentComboBox.addItem( |
76 self.wrapIndentComboBox.addItem( |
78 self.tr("Aligned"), QsciScintilla.WrapIndentSame) |
77 self.tr("Aligned"), QsciScintilla.WrapIndentSame) |
79 self.wrapIndentComboBox.addItem( |
78 self.wrapIndentComboBox.addItem( |
80 self.tr("Aligned plus One"), |
79 self.tr("Aligned plus One"), |
81 QsciScintilla.WrapIndentIndented) |
80 QsciScintilla.WrapIndentIndented) |
82 if QSCINTILLA_VERSION() >= 0x020B00: |
81 self.wrapIndentComboBox.addItem( |
83 self.wrapIndentComboBox.addItem( |
82 self.tr("Aligned plus Two"), |
84 self.tr("Aligned plus Two"), |
83 QsciScintilla.WrapIndentDeeplyIndented) |
85 QsciScintilla.WrapIndentDeeplyIndented) |
|
86 |
|
87 self.caretlineAlwaysVisibleCheckBox.setEnabled( |
|
88 QSCINTILLA_VERSION() >= 0x020800) |
|
89 self.caretlineFrameWidthSpinBox.setEnabled( |
|
90 QSCINTILLA_VERSION() >= 0x020B00) |
|
91 |
84 |
92 # set initial values |
85 # set initial values |
93 try: |
86 try: |
94 self.foldingStyleComboBox.setCurrentIndex( |
87 self.foldingStyleComboBox.setCurrentIndex( |
95 self.foldStyles.index(Preferences.getEditor("FoldingStyle"))) |
88 self.foldStyles.index(Preferences.getEditor("FoldingStyle"))) |