diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index ce325dd04..2c3504252 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1756,11 +1756,8 @@ define(function (require, exports, module) { ); } - function newPhoenixWindow(cliArgsArray = null, cwd=null) { - // Both Electron and Tauri need outerWidth/outerHeight (includes window chrome) - // so the new window matches the current window's total size. - let width = (window.__ELECTRON__ || window.__TAURI__) ? window.outerWidth : window.innerWidth; - let height = (window.__ELECTRON__ || window.__TAURI__) ? window.outerHeight : window.innerHeight; + async function newPhoenixWindow(cliArgsArray = null, cwd=null) { + const {width, height} = await brackets.app.getWindowSize(); Phoenix.app.openNewPhoenixEditorWindow(width, height, cliArgsArray, cwd); } @@ -1864,7 +1861,7 @@ define(function (require, exports, module) { return; } } - newPhoenixWindow(args, cwd); + await newPhoenixWindow(args, cwd); } function handleFileNewWindow() { diff --git a/src/phoenix/shell.js b/src/phoenix/shell.js index 7efcfc726..6b58ca9c1 100644 --- a/src/phoenix/shell.js +++ b/src/phoenix/shell.js @@ -881,6 +881,39 @@ Phoenix.app = { return window.electronAPI.zoomWindow(scaleFactor); } }, + getZoomFactor: function () { + return (window.PhStore && window.PhStore.getItem("desktopZoomScale")) || 1; + }, + /** + * Returns the logical outer size of the current window (includes title bar and window chrome). + * @return {Promise<{width: number, height: number}>} + */ + getWindowSize: async function () { + if(window.__TAURI__) { + const currentWindow = window.__TAURI__.window.getCurrent(); + const outerSize = await currentWindow.outerSize(); + const innerSize = await currentWindow.innerSize(); + let size = outerSize; + if(Phoenix.platform !== 'mac'){ + size = innerSize; + } + const scaleFactor = await currentWindow.scaleFactor(); + return { + width: Math.round(size.width / scaleFactor), + height: Math.round(size.height / scaleFactor) + }; + } + if(window.__ELECTRON__) { + return { + width: window.outerWidth, + height: window.outerHeight + }; + } + return { + width: window.innerWidth, + height: window.innerHeight + }; + }, _openUrlInBrowserWin: function (url, browser) { // private API for internal use only. May be removed at any time. // Please use NodeUtils.openUrlInBrowser for a platform independent equivalent of this. diff --git a/src/styles/brackets_patterns_override.less b/src/styles/brackets_patterns_override.less index 7a5bc286c..61700cdb5 100644 --- a/src/styles/brackets_patterns_override.less +++ b/src/styles/brackets_patterns_override.less @@ -300,6 +300,10 @@ a:focus { position: absolute; bottom: 5px; } + + #user-profile-button { + margin-left: 0.24em; + } } /* Toolbar appearance - shared by all toolbars, independent of layout */