Skip to content

Commit

Permalink
Merge pull request #265 from nxt-dev/dev
Browse files Browse the repository at this point in the history
Release editor-v3.14.0
  • Loading branch information
ImLucasBrown authored Aug 2, 2023
2 parents 6898750 + a8aac12 commit 78d9d70
Show file tree
Hide file tree
Showing 10 changed files with 281 additions and 138 deletions.
24 changes: 23 additions & 1 deletion nxt_editor/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,29 @@ def toggle_ding():
self.toggle_ding_action.setShortcutContext(context)
self.available_without_model.append(self.toggle_ding_action)

self.action_display_order = [self.find_node_action,
# Font size actions
self.increase_font_size_action = NxtAction(text='Increase Font '
'Size', parent=self)
self.increase_font_size_action.setShortcut('Ctrl+=')
self.increase_font_size_action.setShortcutContext(context)
self.increase_font_size_action.setAutoRepeat(False)
# Decrease font size action
self.decrease_font_size_action = NxtAction(text='Decrease Font Size',
parent=self)
self.decrease_font_size_action.setShortcut('Ctrl+-')
self.decrease_font_size_action.setShortcutContext(context)
self.decrease_font_size_action.setAutoRepeat(False)
# Reset font size action
self.reset_font_size_action = NxtAction(text='Reset Font Size',
parent=self)
self.reset_font_size_action.setShortcut('Ctrl+0')
self.reset_font_size_action.setShortcutContext(context)
self.reset_font_size_action.setAutoRepeat(False)

self.action_display_order = [self.increase_font_size_action,
self.decrease_font_size_action,
self.reset_font_size_action,
self.find_node_action,
self.new_graph_action,
self.open_file_action, self.undo_action,
self.redo_action,
Expand Down
5 changes: 5 additions & 0 deletions nxt_editor/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class EDITOR_VERSION(object):
VERSION = VERSION_STR


class FONTS(object):
DEFAULT_FAMILY = 'RobotoMono-Regular'
DEFAULT_SIZE = 10


_pref_dir_name = str(EDITOR_VERSION.MAJOR)
PREF_DIR = os.path.join(USER_DIR, 'prefs', _pref_dir_name)

Expand Down
57 changes: 31 additions & 26 deletions nxt_editor/dockwidgets/code_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
pixmap_hover=':icons/icons/pencil_hover.png',
pixmap_pressed=':icons/icons/pencil.png',
size=16,
parent=self.details_frame)
parent=self.details_frame,
resize_signal=self.main_window.font_size_changed)
self.name_edit_button.pressed.connect(self.name_label.edit_text)
self.name_layout.addWidget(self.name_edit_button, 0, QtCore.Qt.AlignLeft)

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

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

# display format characters
self.format_button = PixmapButton(pixmap=':icons/icons/paragraph_off_12.png',
pixmap_hover=':icons/icons/paragraph_off_hover_12.png',
pixmap_pressed=':icons/icons/paragraph_on_hover_12.png',
pixmap_checked=':icons/icons/paragraph_on_12.png',
pixmap_checked_hover=':icons/icons/paragraph_on_hover_12.png',
pixmap_checked_pressed=':icons/icons/paragraph_off_hover_12.png',
checkable=True,
size=12,
parent=self.code_frame)
self.format_button.setFixedWidth(12)
self.format_button.setFixedHeight(12)
self.format_button = PixmapButton(
pixmap=':icons/icons/paragraph_off_12.png',
pixmap_hover=':icons/icons/paragraph_off_hover_12.png',
pixmap_pressed=':icons/icons/paragraph_on_hover_12.png',
pixmap_checked=':icons/icons/paragraph_on_12.png',
pixmap_checked_hover=':icons/icons/paragraph_on_hover_12.png',
pixmap_checked_pressed=':icons/icons/paragraph_off_hover_12.png',
checkable=True,
size=12,
parent=self.code_frame,
resize_signal=self.main_window.font_size_changed)
self.format_button.setToolTip('Show Non-Printing Characters')
self.format_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
self.format_button.toggled.connect(lambda: self.edit_format_characters(not self.editor.format_characters_on))
Expand All @@ -168,7 +169,8 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
pixmap_hover=':icons/icons/accept_hover.png',
pixmap_pressed=':icons/icons/accept_pressed.png',
size=12,
parent=self.code_frame)
parent=self.code_frame,
resize_signal=self.main_window.font_size_changed)
self.accept_button.setToolTip('Accept Edit')
self.accept_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
self.accept_button.clicked.connect(self.accept_edit)
Expand All @@ -180,7 +182,8 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
pixmap_hover=':icons/icons/cancel_hover.png',
pixmap_pressed=':icons/icons/cancel_pressed.png',
size=12,
parent=self.code_frame)
parent=self.code_frame,
resize_signal=self.main_window.font_size_changed)
self.cancel_button.setToolTip('Cancel Edit')
self.cancel_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
self.cancel_button.setFocusPolicy(QtCore.Qt.NoFocus)
Expand All @@ -189,11 +192,13 @@ def __init__(self, title='Code Editor', parent=None, minimum_width=500):
QtCore.Qt.AlignRight)

# remove code button
self.revert_code_button = PixmapButton(pixmap=':icons/icons/delete.png',
pixmap_hover=':icons/icons/delete_hover.png',
pixmap_pressed=':icons/icons/delete_pressed.png',
size=12,
parent=self.code_frame)
self.revert_code_button = PixmapButton(
pixmap=':icons/icons/delete.png',
pixmap_hover=':icons/icons/delete_hover.png',
pixmap_pressed=':icons/icons/delete_pressed.png',
size=12,
parent=self.code_frame,
resize_signal=self.main_window.font_size_changed)
self.revert_code_button.setToolTip('Remove Compute')
self.revert_code_button.setStyleSheet('QToolTip {color: white; border: 1px solid #3E3E3E}')
self.revert_code_button.clicked.connect(self.revert_code)
Expand Down
Loading

0 comments on commit 78d9d70

Please sign in to comment.