Skip to content

Commit

Permalink
Create a Insert menu with Table and Image
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVenturini committed Mar 27, 2020
1 parent 6d21c90 commit 8c3d9d2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ReText/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __init__(self, parent=None):
menuPreview = QMenu()
menuPreview.addAction(self.actionLivePreview)
self.actionPreview.setMenu(menuPreview)
self.actionInsertTable = self.act(self.tr('Insert table'),
self.actionInsertTable = self.act(self.tr('Table'),
trig=lambda: self.insertFormatting('table'))
self.actionTableMode = self.act(self.tr('Table editing mode'),
shct=Qt.CTRL+Qt.Key_T,
Expand Down Expand Up @@ -217,6 +217,8 @@ def __init__(self, parent=None):
lambda: self.searchBar.setVisible(False),
shct=QKeySequence.Cancel)
self.actionCloseSearch.setPriority(QAction.LowPriority)
self.actionInsertImage = self.act(self.tr('Image'), 'image',
self.insertImage)
self.actionHelp = self.act(self.tr('Get help online'), 'help-contents', self.openHelp)
self.aboutWindowTitle = self.tr('About ReText')
self.actionAbout = self.act(self.aboutWindowTitle, 'help-about', self.aboutDialog)
Expand Down Expand Up @@ -260,6 +262,7 @@ def __init__(self, parent=None):
menubar = self.menuBar()
menuFile = menubar.addMenu(self.tr('File'))
menuEdit = menubar.addMenu(self.tr('Edit'))
menuInsert = menubar.addMenu(self.tr('Insert'))
menuHelp = menubar.addMenu(self.tr('Help'))
menuFile.addAction(self.actionNew)
menuFile.addAction(self.actionOpen)
Expand Down Expand Up @@ -324,13 +327,15 @@ def __init__(self, parent=None):
menuEdit.addSeparator()
menuEdit.addAction(self.actionViewHtml)
menuEdit.addAction(self.actionPreview)
menuEdit.addAction(self.actionInsertTable)
menuEdit.addAction(self.actionTableMode)
if ReTextFakeVimHandler:
menuEdit.addAction(self.actionFakeVimMode)
menuEdit.addSeparator()
menuEdit.addAction(self.actionFullScreen)
menuEdit.addAction(self.actionConfig)
menuInsert.addAction(self.actionInsertTable)
menuInsert.addAction(self.actionTableMode)
menuInsert.addSeparator()
menuInsert.addAction(self.actionInsertImage)
menuHelp.addAction(self.actionHelp)
menuHelp.addSeparator()
menuHelp.addAction(self.actionAbout)
Expand Down

0 comments on commit 8c3d9d2

Please sign in to comment.