Skip to content

Commit 1631606

Browse files
Ability to configure font family in SQL editors
1 parent c80be9b commit 1631606

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

web/pgadmin/static/js/components/ReactCodeMirror/components/Editor.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ export default function Editor({
301301

302302
const fontSize = calcFontSize(pref.sql_font_size);
303303
newConfigExtn.push(EditorView.theme({
304-
'.cm-content': {
304+
'& .cm-content': {
305305
fontSize: fontSize,
306+
fontFamily: pref.sql_font_family,
306307
},
307308
'.cm-gutters': {
308309
fontSize: fontSize,

web/pgadmin/tools/sqleditor/utils/query_tool_preferences.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ def register_query_tool_preferences(self):
390390
)
391391
)
392392

393+
self.sql_font_family = self.preference.register(
394+
'Editor', 'sql_font_family',
395+
gettext("Font family"), 'text', 'Source Code Pro',
396+
category_label=PREF_LABEL_DISPLAY,
397+
help_str=gettext('The font family to use for the SQL text boxes and editors.')
398+
)
399+
393400
self.display_connection_status = self.preference.register(
394401
'display', 'connection_status',
395402
gettext("Connection status"), 'boolean', True,

0 commit comments

Comments
 (0)