From 72e6820f87e4039d316b92243b81bc7ee08f8613 Mon Sep 17 00:00:00 2001 From: Germain Date: Wed, 11 Oct 2023 17:58:11 +0100 Subject: [PATCH 1/2] Implement macos title bar negative space --- src/macos-titlebar.ts | 52 ++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/src/macos-titlebar.ts b/src/macos-titlebar.ts index 65f17d2486..68a339d897 100644 --- a/src/macos-titlebar.ts +++ b/src/macos-titlebar.ts @@ -65,15 +65,6 @@ export function setupMacosTitleBar(window: BrowserWindow): void { .mx_AuthPage .mx_AuthFooter > * { -webkit-app-region: no-drag; } - - /* Mark the header as a drag handle */ - .mx_LeftPanel .mx_LeftPanel_filterContainer { - -webkit-app-region: drag; - } - /* Exclude header interactive elements from being drag handles */ - .mx_LeftPanel .mx_LeftPanel_filterContainer .mx_AccessibleButton { - -webkit-app-region: no-drag; - } /* Mark the home page background as a drag handle */ .mx_HomePage { @@ -86,23 +77,10 @@ export function setupMacosTitleBar(window: BrowserWindow): void { } /* Mark the header as a drag handle */ - .mx_LegacyRoomHeader, - .mx_RoomHeader { - -webkit-app-region: drag; - -webkit-user-select: none; - } .mx_ImageView_panel { -webkit-app-region: drag; } /* Exclude header interactive elements from being drag handles */ - .mx_RoomHeader .mx_BaseAvatar, - .mx_RoomHeader_heading, - .mx_RoomHeader button, - .mx_RoomHeader .mx_FacePile, - .mx_LegacyRoomHeader .mx_LegacyRoomHeader_avatar, - .mx_LegacyRoomHeader .mx_E2EIcon, - .mx_LegacyRoomHeader .mx_RoomTopic, - .mx_LegacyRoomHeader .mx_AccessibleButton, .mx_ImageView_panel > .mx_ImageView_info_wrapper, .mx_ImageView_panel > .mx_ImageView_title, .mx_ImageView_panel > .mx_ImageView_toolbar > * { @@ -119,7 +97,9 @@ export function setupMacosTitleBar(window: BrowserWindow): void { .mx_RoomView_body, .mx_AutoHideScrollbar, .mx_RightPanel_ResizeWrapper, - .mx_RoomPreviewCard { + .mx_RoomPreviewCard, + .mx_LeftPanel, + .mx_RoomView { -webkit-app-region: no-drag; } /* Exclude context menus and their backgrounds */ @@ -130,6 +110,32 @@ export function setupMacosTitleBar(window: BrowserWindow): void { iframe { -webkit-app-region: no-drag; } + + /* Add a bar above room header + left panel */ + + .mx_LeftPanel { + flex-direction: column; + } + + .mx_LeftPanel::before { + content: ""; + height: 25px; + -webkit-app-region: drag; + } + + .mx_RoomView::before { + content: ""; + -webkit-app-region: drag; + } + + .mx_RoomView[data-room-header="new"]::before { + height: 13px; + } + + .mx_RoomView[data-room-header="legacy"]::before { + height: 27px; + } + `); } From d44f0d109509987f9363a322f7a90682c3207e1e Mon Sep 17 00:00:00 2001 From: Germain Date: Thu, 12 Oct 2023 13:40:27 +0100 Subject: [PATCH 2/2] Align input with avatar on the left --- src/macos-titlebar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macos-titlebar.ts b/src/macos-titlebar.ts index 68a339d897..ef046b59a4 100644 --- a/src/macos-titlebar.ts +++ b/src/macos-titlebar.ts @@ -119,7 +119,7 @@ export function setupMacosTitleBar(window: BrowserWindow): void { .mx_LeftPanel::before { content: ""; - height: 25px; + height: 20px; -webkit-app-region: drag; }