Add Menu bar
- Dominant language
- Python
- Stars
- 82
- Forks
- 7
- Avg merge
- 6h 11m
- Merged PRs (30d)
- 3
Description
File
'New Font...'
'Open...'
'Duplicate as...'
Notes:
The file open dialog at least needs to filter by accepted file type. It currently allows selecting of any file, which will lead to confusing errors. I am considering declaring .fontra and .rcjk as packages, then at least on macOS we can treat them as files. On Windows we would still need the "open font project folder" menu, and we probably need some error checking: what if the user selects a folder that is not a valid project? (not .ufo, .fontra or .rcjk).
The New font and Open (file) menu's need shortcuts: command-N and command-O respectively. Not sure how that can map to control-N and control-O on non-macOS.
Maybe add 'Duplidate as' to the file menu, which would allow the user to duplicate the current project (also TTF or OTF) as a .ufo, .fontra or .rcjk.
This would be useful for testing, and for creating a new project based on an existing one.
Maybe implemented by Fontra Pak, but triggered by the front end.
```
fileMenu = self.menuBar().addMenu("File")
newAction = fileMenu.addAction("New Font...")
newAction.triggered.connect(self.newFont)
openMenu = fileMenu.addMenu("Open...")
openFolderAction = openMenu.addAction("Open .fontra, .ufo or .rcjk ...")
openFolderAction.triggered.connect(self.openFolder)
openFileAction = openMenu.addAction(
"Open TTF, OTF, Designspace or GlyphsApp..."
)
openFileAction.triggered.connect(self.openFile)
```
```
def openFolder(self):
projectPath = QFileDialog.getExistingDirectory(
self, "Open Fontra Folder", "/home/user/", QFileDialog.Option.ShowDirsOnly
)
if os.path.exists(projectPath):
openFile(projectPath, self.port)
def openFile(self):
dialog = QFileDialog.getOpenFileName(self, "Open File")
projectPath = dialog[0]
if os.path.exists(projectPath):
openFile(projectPath, self.port)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the menu-bar setup and the openFolder/openFile entry points shown in the issue, then inspect how the existing front end opens projects. Define the platform-specific menu shortcuts, accepted file and folder types, invalid-project handling, and whether “Duplicate as...” belongs here or in Fontra Pak. Done means the requested File actions work across platforms without confusing selections or errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100