Skip to content

Commit

Permalink
style: window titles will start with project names instead of file name
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Dec 13, 2023
1 parent 105e844 commit f859c25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ define(function (require, exports, module) {
* String template for window title when a file is open.
* @type {string}
*/
var WINDOW_TITLE_STRING_DOC = "{0} ({1}) " + _osDash + " {2}";
var WINDOW_TITLE_STRING_DOC = "{0} " + _osDash + " {1}";

/**
* Container for _$titleWrapper; if changing title changes this element's height, must kick editor to resize
Expand Down Expand Up @@ -289,7 +289,7 @@ define(function (require, exports, module) {
var projectName = projectRoot.name;
// Construct shell/browser window title, e.g. "• index.html (myProject) — Brackets"
if (currentlyViewedPath) {
windowTitle = StringUtils.format(WINDOW_TITLE_STRING_DOC, readOnlyString + _currentTitlePath, projectName, brackets.config.app_title);
windowTitle = StringUtils.format(WINDOW_TITLE_STRING_DOC, readOnlyString + projectName, _currentTitlePath);
// Display dirty dot when there are unsaved changes
if (currentDoc && currentDoc.isDirty) {
windowTitle = "• " + windowTitle;
Expand Down
4 changes: 2 additions & 2 deletions test/spec/DocumentCommandHandlers-integ-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ define(function (require, exports, module) {
expect(DocumentManager.getCurrentDocument().isDirty).toBe(false);

// verify no dot in titlebar
const expectedTitle = "test.js (DocumentCommandHandlers-test-files) " + WINDOW_TITLE_DOT + " " + brackets.config.app_title;
const expectedTitle = `DocumentCommandHandlers-test-files ${WINDOW_TITLE_DOT} test.js`;
expect(testWindow.document.title).toBe(expectedTitle);
if(Phoenix.browser.isTauri) {
await awaitsFor(async ()=> {
Expand All @@ -945,7 +945,7 @@ define(function (require, exports, module) {
expect(doc.isDirty).toBe(true);

// verify dot in titlebar
const expectedTitle = "• test.js (DocumentCommandHandlers-test-files) " + WINDOW_TITLE_DOT + " " + brackets.config.app_title;
const expectedTitle = `• DocumentCommandHandlers-test-files ${WINDOW_TITLE_DOT} test.js`;
expect(testWindow.document.title).toBe(expectedTitle);
if(Phoenix.browser.isTauri) {
await awaitsFor(async ()=> {
Expand Down

0 comments on commit f859c25

Please sign in to comment.