Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement macos title bar negative space #1272

Merged
merged 2 commits into from
Oct 12, 2023
Merged
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
52 changes: 29 additions & 23 deletions src/macos-titlebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 > * {
Expand All @@ -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 */
Expand All @@ -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: 20px;
-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;
}

`);
}

Expand Down
Loading