Skip to content

Commit

Permalink
Adding project file name to the right side of the menu bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ollimeier committed Jan 8, 2025
1 parent 08dc923 commit f50308f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/fontra/client/core/fontra-menus.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as html from "./html-utils.js";
import { translate } from "/core/localization.js";
import { MenuBar } from "/web-components/menu-bar.js";

Expand All @@ -18,7 +19,15 @@ export function makeFontraMenuBar(menuItemKeys, delegate) {
}

menuBarArray.push(getHelpMenuItems()); // Help-Menu at the end.
return new MenuBar(menuBarArray);
const menuBar = new MenuBar(menuBarArray);

// add project file name to the right side of the menu bar
const projectNameWrapper = html.div();
projectNameWrapper.textContent = delegate.projectFileName;
projectNameWrapper.style.marginLeft = "auto";
menuBar.contentElement.appendChild(projectNameWrapper);

return menuBar;
}

function getFontraMenuItems() {
Expand Down
1 change: 1 addition & 0 deletions src/fontra/client/core/view-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class ViewController {

constructor(font) {
this.fontController = new FontController(font);
this.projectFileName = font.wsURL.split("/").slice(-1)[0];
}

async start() {
Expand Down

0 comments on commit f50308f

Please sign in to comment.