pyqt-code-editor 0.0.18__tar.gz → 0.0.20__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/PKG-INFO +1 -1
  2. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/__init__.py +1 -1
  3. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/find_in_files.py +87 -3
  4. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/settings_panel.py +13 -11
  5. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/base.py +8 -0
  6. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/complete.py +1 -3
  7. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/line_number.py +2 -0
  8. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/themes.py +1 -1
  9. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/quick_open_dialog.py +35 -2
  10. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/COPYING +0 -0
  11. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyproject.toml +0 -0
  12. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/_settings.py +0 -0
  13. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/app.py +0 -0
  14. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/code_editors/__init__.py +0 -0
  15. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/code_editors/code_editors.py +0 -0
  16. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
  17. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
  18. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
  19. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/code_editors/languages/python.py +0 -0
  20. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/code_editors/languages/text.py +0 -0
  21. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/__init__.py +0 -0
  22. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/editor_panel.py +0 -0
  23. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/jupyter_console.py +0 -0
  24. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/project_explorer.py +0 -0
  25. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/sigmund.py +0 -0
  26. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/components/workspace_explorer.py +0 -0
  27. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/__init__.py +0 -0
  28. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/auto_indent.py +0 -0
  29. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/auto_pair.py +0 -0
  30. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/check.py +0 -0
  31. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/comment.py +0 -0
  32. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/execute.py +0 -0
  33. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/file_link.py +0 -0
  34. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/python_auto_indent.py +0 -0
  35. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/search_replace.py +0 -0
  36. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/shortcuts.py +0 -0
  37. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -0
  38. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/symbols.py +0 -0
  39. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/theme.py +0 -0
  40. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
  41. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/mixins/zoom.py +0 -0
  42. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/signal_router.py +0 -0
  43. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
  44. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
  45. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -0
  46. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -0
  47. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +0 -0
  48. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/utils/__init__.py +0 -0
  49. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/utils/languages/__init__.py +0 -0
  50. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/utils/languages/python/__init__.py +0 -0
  51. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/utils/languages/python/_auto_indent.py +0 -0
  52. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/utils/languages/python/_extract_cells.py +0 -0
  53. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/utils/languages/python/_mask_str_in_code.py +0 -0
  54. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/watchdog.py +0 -0
  55. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/__init__.py +0 -0
  56. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
  57. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/completion_popup.py +0 -0
  58. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/dock.py +0 -0
  59. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
  60. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
  61. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
  62. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
  63. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/widgets/tabbed_editor.py +0 -0
  64. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/__init__.py +0 -0
  65. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/languages/__init__.py +0 -0
  66. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/languages/generic.py +0 -0
  67. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/languages/python.py +0 -0
  68. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/manager.py +0 -0
  69. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/process.py +0 -0
  70. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/providers/__init__.py +0 -0
  71. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/providers/codestral.py +0 -0
  72. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/providers/jedi.py +0 -0
  73. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/providers/ruff.py +0 -0
  74. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
  75. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/providers/symbol.py +0 -0
  76. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/pyqt_code_editor/worker/settings.py +0 -0
  77. {pyqt_code_editor-0.0.18 → pyqt_code_editor-0.0.20}/readme.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqt_code_editor
3
- Version: 0.0.18
3
+ Version: 0.0.20
4
4
  Summary: Fully featured code-editor widgets for PyQt
5
5
  Keywords: code editor,pyqt,ide
6
6
  Author-email: Sebastiaan Mathôt <s.mathot@cogsci.nl>
@@ -2,4 +2,4 @@
2
2
 
3
3
  from ._settings import settings
4
4
 
5
- __version__ = '0.0.18'
5
+ __version__ = '0.0.20'
@@ -2,8 +2,9 @@ import os
2
2
  import multiprocessing
3
3
  from qtpy.QtWidgets import QDockWidget, QWidget, QVBoxLayout, QHBoxLayout, \
4
4
  QLineEdit, QCheckBox, QPushButton, QTreeWidget, QTreeWidgetItem, \
5
- QAbstractItemView
5
+ QAbstractItemView, QLabel
6
6
  from qtpy.QtCore import Qt, QTimer, Signal
7
+ import fnmatch
7
8
 
8
9
 
9
10
  def search_in_files_worker(files, search_text, case_sensitive, whole_word, regex, output_queue):
@@ -53,7 +54,8 @@ class FindInFiles(QDockWidget):
53
54
  super().__init__("Find in Files", parent)
54
55
  self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
55
56
 
56
- self._files = files_list[:] # store a copy
57
+ self._all_files = files_list[:] # store all files
58
+ self._filtered_files = [] # files after extension filter
57
59
  self._search_process = None
58
60
  self._output_queue = None
59
61
 
@@ -83,6 +85,20 @@ class FindInFiles(QDockWidget):
83
85
  controls_layout.addWidget(self.searchBtn)
84
86
  controls_layout.setContentsMargins(0, 0, 0, 0)
85
87
 
88
+ # File type filter row
89
+ filter_layout = QHBoxLayout()
90
+ layout.addLayout(filter_layout)
91
+
92
+ filter_label = QLabel("File types:", self)
93
+ self.fileTypesInput = QLineEdit(self)
94
+ self.fileTypesInput.setPlaceholderText("e.g. .py .js .html (default: .*)")
95
+ self.fileTypesInput.setText(".*") # Default to all files
96
+ self.fileTypesInput.setToolTip("Space or comma separated extensions. Use .* for all files.")
97
+
98
+ filter_layout.addWidget(filter_label)
99
+ filter_layout.addWidget(self.fileTypesInput)
100
+ filter_layout.setContentsMargins(0, 0, 0, 0)
101
+
86
102
  # Tree Widget for results
87
103
  self.resultsTree = QTreeWidget(self)
88
104
  self.resultsTree.setHeaderLabels(["File / Line", "Preview"])
@@ -104,6 +120,41 @@ class FindInFiles(QDockWidget):
104
120
  super().showEvent(event)
105
121
  self.searchInput.setFocus()
106
122
 
123
+ def _parse_extensions(self, text):
124
+ """Parse extension filter text into a list of patterns"""
125
+ if not text or text.strip() == ".*":
126
+ return ["*"] # Match all files
127
+
128
+ # Split by spaces or commas
129
+ import re
130
+ extensions = re.split(r'[,\s]+', text.strip())
131
+
132
+ # Convert extensions to glob patterns
133
+ patterns = []
134
+ for ext in extensions:
135
+ if ext:
136
+ if not ext.startswith('.'):
137
+ ext = '.' + ext
138
+ patterns.append('*' + ext)
139
+
140
+ return patterns if patterns else ["*"]
141
+
142
+ def _filter_files_by_extension(self):
143
+ """Filter files based on the extension patterns"""
144
+ patterns = self._parse_extensions(self.fileTypesInput.text())
145
+
146
+ if patterns == ["*"]:
147
+ # No filtering needed
148
+ self._filtered_files = self._all_files[:]
149
+ return
150
+
151
+ self._filtered_files = []
152
+ for file_path in self._all_files:
153
+ for pattern in patterns:
154
+ if fnmatch.fnmatch(os.path.basename(file_path).lower(), pattern.lower()):
155
+ self._filtered_files.append(file_path)
156
+ break
157
+
107
158
  def _start_search(self):
108
159
  # Kill any existing worker first
109
160
  if self._search_process and self._search_process.is_alive():
@@ -112,10 +163,26 @@ class FindInFiles(QDockWidget):
112
163
  # Clear old results
113
164
  self.resultsTree.clear()
114
165
 
166
+ # Filter files by extension
167
+ self._filter_files_by_extension()
168
+
169
+ # Show file count in status
170
+ file_count_item = QTreeWidgetItem(self.resultsTree)
171
+ file_count_item.setText(0, f"Searching {len(self._filtered_files)} files...")
172
+ file_count_item.setForeground(0, Qt.gray)
173
+
174
+ # If no files match the filter, show message
175
+ if not self._filtered_files:
176
+ self.resultsTree.clear()
177
+ no_files_item = QTreeWidgetItem(self.resultsTree)
178
+ no_files_item.setText(0, "No files match the specified extensions")
179
+ no_files_item.setForeground(0, Qt.gray)
180
+ return
181
+
115
182
  # Prepare
116
183
  self._output_queue = multiprocessing.Queue()
117
184
  args = (
118
- self._files,
185
+ self._filtered_files,
119
186
  self.searchInput.text(),
120
187
  self.caseBox.isChecked(),
121
188
  self.wholeWordBox.isChecked(),
@@ -136,6 +203,7 @@ class FindInFiles(QDockWidget):
136
203
  return
137
204
 
138
205
  # Grab everything from the queue
206
+ first_result = True
139
207
  while not self._output_queue.empty():
140
208
  msg = self._output_queue.get()
141
209
  if not msg:
@@ -143,6 +211,13 @@ class FindInFiles(QDockWidget):
143
211
  kind = msg[0]
144
212
 
145
213
  if kind == "found":
214
+ # Clear the "Searching..." message on first result
215
+ if first_result and self.resultsTree.topLevelItemCount() == 1:
216
+ first_item = self.resultsTree.topLevelItem(0)
217
+ if "Searching" in first_item.text(0):
218
+ self.resultsTree.clear()
219
+ first_result = False
220
+
146
221
  # we have file + list of (line_num, text)
147
222
  file_path = msg[1]
148
223
  lines = msg[2]
@@ -154,6 +229,15 @@ class FindInFiles(QDockWidget):
154
229
  elif kind == "done":
155
230
  # done means the worker finished scanning
156
231
  self._search_process = None
232
+
233
+ # If no results found, show message
234
+ if self.resultsTree.topLevelItemCount() == 1:
235
+ first_item = self.resultsTree.topLevelItem(0)
236
+ if "Searching" in first_item.text(0):
237
+ self.resultsTree.clear()
238
+ no_results_item = QTreeWidgetItem(self.resultsTree)
239
+ no_results_item.setText(0, "No matches found")
240
+ no_results_item.setForeground(0, Qt.gray)
157
241
 
158
242
  def _add_file_matches(self, file_path, lines):
159
243
  # Create a top-level item for file
@@ -25,8 +25,9 @@ class SettingsWidget(QWidget):
25
25
  types are int, bool and str.
26
26
  """
27
27
 
28
- def __init__(self, parent=None):
28
+ def __init__(self, parent=None, visible_categories=None):
29
29
  super().__init__(parent)
30
+ self._visible_categories = visible_categories
30
31
  self.setup_ui()
31
32
  self.load_settings()
32
33
 
@@ -45,7 +46,9 @@ class SettingsWidget(QWidget):
45
46
  self.scroll_area = QScrollArea()
46
47
  self.scroll_area.setWidgetResizable(True)
47
48
  self.scroll_widget = QWidget()
48
- self.scroll_layout = QVBoxLayout(self.scroll_widget)
49
+ self.scroll_layout = QFormLayout(self.scroll_widget)
50
+ self.scroll_layout.setContentsMargins(0, 0, 0, 0)
51
+ self.scroll_area.setFrameStyle(QScrollArea.NoFrame)
49
52
  self.scroll_area.setWidget(self.scroll_widget)
50
53
 
51
54
  # Add scroll area to main layout
@@ -72,25 +75,24 @@ class SettingsWidget(QWidget):
72
75
 
73
76
  # Create a form for each category
74
77
  for category, setting_names in categories.items():
75
- if not setting_names:
78
+ if self._visible_categories is not None and \
79
+ category not in self._visible_categories:
76
80
  continue
77
-
81
+ if not setting_names:
82
+ continue
78
83
  group_box = QGroupBox(category)
79
- form_layout = QFormLayout(group_box)
80
- form_layout.setContentsMargins(*themes.OUTER_CONTENT_MARGINS)
81
-
84
+ form_layout = QFormLayout(group_box)
82
85
  for setting_name in setting_names:
83
86
  value = getattr(settings, setting_name)
84
87
  widget = self.create_widget_for_setting(setting_name, value)
85
88
 
86
89
  if widget:
87
- form_layout.addRow(setting_name.replace('_', ' ').title() + ":", widget)
90
+ form_layout.addRow(
91
+ setting_name.replace('_', ' ').title() + ":", widget)
88
92
  self.setting_widgets[setting_name] = widget
89
93
 
90
- self.scroll_layout.addWidget(group_box)
94
+ self.scroll_layout.addRow(group_box, None)
91
95
 
92
- self.scroll_layout.addStretch()
93
-
94
96
  def create_widget_for_setting(self, setting_name, value):
95
97
  """Create appropriate widget based on setting type"""
96
98
  logger.debug(f"Creating widget for setting {setting_name} with value {value}")
@@ -15,6 +15,7 @@ class Base:
15
15
  code_editor_language = 'text'
16
16
  modification_changed = Signal(object, bool)
17
17
  received_focus = Signal(object)
18
+ lost_focus = Signal(object)
18
19
 
19
20
  def __init__(self, *args, **kwargs):
20
21
  # Optionally set the language. This is mainly for generic editors that
@@ -52,6 +53,13 @@ class Base:
52
53
  """
53
54
  super().focusInEvent(event)
54
55
  self.received_focus.emit(self)
56
+
57
+ def focusOutEvent(self, event):
58
+ """Allows managing widgets, such as the editor panel, to keep track of
59
+ which editor is active
60
+ """
61
+ super().focusOutEvent(event)
62
+ self.lost_focus.emit(self)
55
63
 
56
64
  def refresh(self):
57
65
  """Can be called to indicate that the interface needs to be refreshed,
@@ -99,7 +99,7 @@ class Complete:
99
99
  self._cm_completion_popup.hide()
100
100
 
101
101
  def focusOutEvent(self, event):
102
- """Make sure the calltip doesn't stay open when we scroll the viewport.
102
+ """Make sure the calltip doesn't stay open when the widget loses focus.
103
103
  """
104
104
  super().focusOutEvent(event)
105
105
  self._cm_hide_calltip()
@@ -516,9 +516,7 @@ class Complete:
516
516
  global_pos = global_bottom_left
517
517
  logger.info("Positioning calltip below cursor.")
518
518
 
519
- print(f'intended position: {global_pos}')
520
519
  self._cm_calltip_widget.move(global_pos)
521
- print(f'actual position: {self._cm_calltip_widget.pos()}')
522
520
  self._cm_calltip_widget.show()
523
521
 
524
522
  def closeEvent(self, event):
@@ -50,6 +50,8 @@ class LineNumber:
50
50
 
51
51
  def __init__(self, *args, **kwargs):
52
52
  super().__init__(*args, **kwargs)
53
+ self._line_number_rects = {}
54
+ self._line_rects = {}
53
55
  self.setMouseTracking(True)
54
56
  # Create the line number area
55
57
  self.lineNumberArea = LineNumberArea(self)
@@ -31,6 +31,6 @@ THEMES = {
31
31
  }
32
32
  }
33
33
 
34
- OUTER_CONTENT_MARGINS = [6, 6, 6, 6]
34
+ OUTER_CONTENT_MARGINS = [12, 12, 12, 12]
35
35
  HORIZONTAL_SPACING = 6
36
36
  VERTICAL_SPACING = 12
@@ -1,4 +1,3 @@
1
- import os
2
1
  import logging
3
2
  from qtpy.QtWidgets import (
4
3
  QDialog,
@@ -10,6 +9,7 @@ from qtpy.QtWidgets import (
10
9
  )
11
10
  from qtpy.QtCore import Qt, QSortFilterProxyModel, QModelIndex
12
11
  from qtpy.QtGui import QStandardItemModel, QStandardItem
12
+ from .. import settings, themes
13
13
 
14
14
  logger = logging.getLogger(__name__)
15
15
 
@@ -42,6 +42,26 @@ class MultiNeedleFilterProxyModel(QSortFilterProxyModel):
42
42
  if needle not in item_text_lower:
43
43
  return False
44
44
  return True
45
+
46
+ STYLESHEET = '''
47
+ QuickOpenDialog {{
48
+ background-color: {background};
49
+ color: {foreground};
50
+ padding: 8px;
51
+ border-radius: 4px;
52
+ }}
53
+ QLineEdit {{
54
+ margin-bottom: 4px;
55
+ }}
56
+ QLineEdit, QListView {{
57
+ color: {foreground};
58
+ border: none;
59
+ font-family: {font_family};
60
+ font-size: {font_size}px;
61
+ background-color: {selection_background};
62
+ padding: 4px;
63
+ }}
64
+ '''
45
65
 
46
66
  class QuickOpenDialog(QDialog):
47
67
  """
@@ -52,11 +72,20 @@ class QuickOpenDialog(QDialog):
52
72
  """
53
73
  def __init__(self, parent, items, title="Quick Open"):
54
74
  super().__init__(parent)
75
+ color_scheme = themes.THEMES.get(settings.color_scheme)
76
+ if color_scheme:
77
+ self.setStyleSheet(STYLESHEET.format(
78
+ background=color_scheme['background_color'],
79
+ foreground=color_scheme['text_color'],
80
+ selection_background=color_scheme['selection_background'],
81
+ font_size=settings.font_size,
82
+ font_family=settings.font_family
83
+ ))
55
84
  self.setWindowFlags(Qt.Dialog | Qt.FramelessWindowHint)
56
85
  self.setWindowModality(Qt.ApplicationModal)
57
86
 
58
87
  self.setWindowTitle(title)
59
- self.resize(400, 400)
88
+ self.resize(800, 400)
60
89
 
61
90
  layout = QVBoxLayout(self)
62
91
  self._filter_edit = QLineEdit(self)
@@ -65,6 +94,10 @@ class QuickOpenDialog(QDialog):
65
94
 
66
95
  self._list_view = QListView(self)
67
96
  self._list_view.setSelectionMode(QAbstractItemView.SingleSelection)
97
+ self._list_view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
98
+ self._list_view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
99
+ self._list_view.setTextElideMode(Qt.ElideMiddle)
100
+
68
101
  layout.addWidget(self._list_view)
69
102
 
70
103
  self._items = items