@lvce-editor/title-bar-worker 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3289,6 +3289,10 @@ const addWidths = async (entries, labelPadding, fontWeight, fontSize, fontFamily
3289
3289
  return withWidths;
3290
3290
  };
3291
3291
 
3292
+ const getTitleBarMenuBarWidth = (windowWidth, menuBarX, iconWidth, titleWidth) => {
3293
+ return windowWidth / 2 - titleWidth / 2 - menuBarX - iconWidth;
3294
+ };
3295
+
3292
3296
  const getWorkspaceUri = () => {
3293
3297
  return invoke('Workspace.getUri');
3294
3298
  };
@@ -3311,6 +3315,7 @@ const loadContent2 = async state => {
3311
3315
  const title = getTitle(workspaceUri, state.titleTemplate, state.appName);
3312
3316
  const titleWidth = await measureTitleWidth(title, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
3313
3317
  const iconWidth = 30;
3318
+ const width = getTitleBarMenuBarWidth(state.width, state.x, iconWidth, titleWidth);
3314
3319
 
3315
3320
  // TODO load preferences here
3316
3321
 
@@ -3324,7 +3329,8 @@ const loadContent2 = async state => {
3324
3329
  title,
3325
3330
  titleBarButtons: buttons,
3326
3331
  titleBarEntries: withWidths,
3327
- titleWidth
3332
+ titleWidth,
3333
+ width
3328
3334
  };
3329
3335
  };
3330
3336
 
@@ -3843,10 +3849,6 @@ const renderEventListeners = () => {
3843
3849
  }];
3844
3850
  };
3845
3851
 
3846
- const getTitleBarMenuBarWidth = (windowWidth, menuBarX, iconWidth, titleWidth) => {
3847
- return windowWidth / 2 - titleWidth / 2 - menuBarX - iconWidth;
3848
- };
3849
-
3850
3852
  const resize = async (state, dimensions) => {
3851
3853
  const {
3852
3854
  iconWidth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",