Skip to content

Commit 78d9d70

Browse files
authored
Merge pull request #265 from nxt-dev/dev
Release editor-v3.14.0
2 parents 6898750 + a8aac12 commit 78d9d70

10 files changed

Lines changed: 281 additions & 138 deletions

File tree

nxt_editor/actions.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,29 @@ def toggle_ding():
423423
self.toggle_ding_action.setShortcutContext(context)
424424
self.available_without_model.append(self.toggle_ding_action)
425425

426-
self.action_display_order = [self.find_node_action,
426+
# Font size actions
427+
self.increase_font_size_action = NxtAction(text='Increase Font '
428+
'Size', parent=self)
429+
self.increase_font_size_action.setShortcut('Ctrl+=')
430+
self.increase_font_size_action.setShortcutContext(context)
431+
self.increase_font_size_action.setAutoRepeat(False)
432+
# Decrease font size action
433+
self.decrease_font_size_action = NxtAction(text='Decrease Font Size',
434+
parent=self)
435+
self.decrease_font_size_action.setShortcut('Ctrl+-')
436+
self.decrease_font_size_action.setShortcutContext(context)
437+
self.decrease_font_size_action.setAutoRepeat(False)
438+
# Reset font size action
439+
self.reset_font_size_action = NxtAction(text='Reset Font Size',
440+
parent=self)
441+
self.reset_font_size_action.setShortcut('Ctrl+0')
442+
self.reset_font_size_action.setShortcutContext(context)
443+
self.reset_font_size_action.setAutoRepeat(False)
444+
445+
self.action_display_order = [self.increase_font_size_action,
446+
self.decrease_font_size_action,
447+
self.reset_font_size_action,
448+
self.find_node_action,
427449
self.new_graph_action,
428450
self.open_file_action, self.undo_action,
429451
self.redo_action,

nxt_editor/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ class EDITOR_VERSION(object):
2020
VERSION = VERSION_STR
2121

2222

23+
class FONTS(object):
24+
DEFAULT_FAMILY = 'RobotoMono-Regular'
25+
DEFAULT_SIZE = 10
26+
27+
2328
_pref_dir_name = str(EDITOR_VERSION.MAJOR)
2429
PREF_DIR = os.path.join(USER_DIR, 'prefs', _pref_dir_name)
2530

nxt_editor/dockwidgets/code_editor.py

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
8080
pixmap_hover=':icons/icons/pencil_hover.png',
8181
pixmap_pressed=':icons/icons/pencil.png',
8282
size=16,
83-
parent=self.details_frame)
83+
parent=self.details_frame,
84+
resize_signal=self.main_window.font_size_changed)
8485
self.name_edit_button.pressed.connect(self.name_label.edit_text)
8586
self.name_layout.addWidget(self.name_edit_button, 0, QtCore.Qt.AlignLeft)
8687

@@ -128,13 +129,13 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
128129
self.code_layout.addLayout(self.buttons_layout)
129130

130131
# copy resolved code button
131-
self.copy_resolved_button = PixmapButton(pixmap=':icons/icons/copy_resolved_12.png',
132-
pixmap_hover=':icons/icons/copy_resolved_hover_12.png',
133-
pixmap_pressed=':icons/icons/copy_resolved_hover_12.png',
134-
size=12,
135-
parent=self.code_frame)
136-
self.copy_resolved_button.setFixedWidth(12)
137-
self.copy_resolved_button.setFixedHeight(12)
132+
self.copy_resolved_button = PixmapButton(
133+
pixmap=':icons/icons/copy_resolved_12.png',
134+
pixmap_hover=':icons/icons/copy_resolved_hover_12.png',
135+
pixmap_pressed=':icons/icons/copy_resolved_hover_12.png',
136+
size=12,
137+
parent=self.code_frame,
138+
resize_signal=self.main_window.font_size_changed)
138139
self.copy_resolved_button.setToolTip('Copy Resolved')
139140
self.copy_resolved_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
140141
self.copy_resolved_button.clicked.connect(self.copy_resolved)
@@ -143,17 +144,17 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
143144
# TODO: Add copy cached button?
144145

145146
# display format characters
146-
self.format_button = PixmapButton(pixmap=':icons/icons/paragraph_off_12.png',
147-
pixmap_hover=':icons/icons/paragraph_off_hover_12.png',
148-
pixmap_pressed=':icons/icons/paragraph_on_hover_12.png',
149-
pixmap_checked=':icons/icons/paragraph_on_12.png',
150-
pixmap_checked_hover=':icons/icons/paragraph_on_hover_12.png',
151-
pixmap_checked_pressed=':icons/icons/paragraph_off_hover_12.png',
152-
checkable=True,
153-
size=12,
154-
parent=self.code_frame)
155-
self.format_button.setFixedWidth(12)
156-
self.format_button.setFixedHeight(12)
147+
self.format_button = PixmapButton(
148+
pixmap=':icons/icons/paragraph_off_12.png',
149+
pixmap_hover=':icons/icons/paragraph_off_hover_12.png',
150+
pixmap_pressed=':icons/icons/paragraph_on_hover_12.png',
151+
pixmap_checked=':icons/icons/paragraph_on_12.png',
152+
pixmap_checked_hover=':icons/icons/paragraph_on_hover_12.png',
153+
pixmap_checked_pressed=':icons/icons/paragraph_off_hover_12.png',
154+
checkable=True,
155+
size=12,
156+
parent=self.code_frame,
157+
resize_signal=self.main_window.font_size_changed)
157158
self.format_button.setToolTip('Show Non-Printing Characters')
158159
self.format_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
159160
self.format_button.toggled.connect(lambda: self.edit_format_characters(not self.editor.format_characters_on))
@@ -168,7 +169,8 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
168169
pixmap_hover=':icons/icons/accept_hover.png',
169170
pixmap_pressed=':icons/icons/accept_pressed.png',
170171
size=12,
171-
parent=self.code_frame)
172+
parent=self.code_frame,
173+
resize_signal=self.main_window.font_size_changed)
172174
self.accept_button.setToolTip('Accept Edit')
173175
self.accept_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
174176
self.accept_button.clicked.connect(self.accept_edit)
@@ -180,7 +182,8 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
180182
pixmap_hover=':icons/icons/cancel_hover.png',
181183
pixmap_pressed=':icons/icons/cancel_pressed.png',
182184
size=12,
183-
parent=self.code_frame)
185+
parent=self.code_frame,
186+
resize_signal=self.main_window.font_size_changed)
184187
self.cancel_button.setToolTip('Cancel Edit')
185188
self.cancel_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
186189
self.cancel_button.setFocusPolicy(QtCore.Qt.NoFocus)
@@ -189,11 +192,13 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
189192
QtCore.Qt.AlignRight)
190193

191194
# remove code button
192-
self.revert_code_button = PixmapButton(pixmap=':icons/icons/delete.png',
193-
pixmap_hover=':icons/icons/delete_hover.png',
194-
pixmap_pressed=':icons/icons/delete_pressed.png',
195-
size=12,
196-
parent=self.code_frame)
195+
self.revert_code_button = PixmapButton(
196+
pixmap=':icons/icons/delete.png',
197+
pixmap_hover=':icons/icons/delete_hover.png',
198+
pixmap_pressed=':icons/icons/delete_pressed.png',
199+
size=12,
200+
parent=self.code_frame,
201+
resize_signal=self.main_window.font_size_changed)
197202
self.revert_code_button.setToolTip('Remove Compute')
198203
self.revert_code_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
199204
self.revert_code_button.clicked.connect(self.revert_code)

0 commit comments

Comments
 (0)