Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -1864,7 +1861,7 @@ define(function (require, exports, module) {
return;
}
}
newPhoenixWindow(args, cwd);
await newPhoenixWindow(args, cwd);
}

function handleFileNewWindow() {
Expand Down
33 changes: 33 additions & 0 deletions src/phoenix/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/styles/brackets_patterns_override.less
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading