mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-05 16:27:04 +00:00
Added support for macos monochrome titlebar buttons, on by default
This commit is contained in:
@@ -152,12 +152,32 @@
|
||||
gap: var(--zen-element-separation);
|
||||
}
|
||||
|
||||
.titlebar-buttonbox-container {
|
||||
height: 100%;
|
||||
@media not (-moz-platform: macos) {
|
||||
.titlebar-buttonbox-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-platform: macos) {
|
||||
.titlebar-buttonbox-container {
|
||||
margin-inline-end: 8px;
|
||||
|
||||
& > .titlebar-buttonbox {
|
||||
margin-inline-start: var(--zen-toolbox-padding);
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-bool-pref: 'zen.widget.mac.mono-window-controls') {
|
||||
.titlebar-buttonbox-container {
|
||||
/* Draw 3 dots as background to represent the window controls,
|
||||
all with the same cololr as the titlebar */
|
||||
background-image: radial-gradient(circle, #4d4c4a 6px, transparent 0.5px);
|
||||
background-size: 20px 22px;
|
||||
background-position: 52% 50%;
|
||||
|
||||
&:not([zen-has-hover='true']) > .titlebar-buttonbox {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,6 +292,9 @@ var gZenCompactModeManager = {
|
||||
element: document.getElementById('zen-appcontent-navbar-container'),
|
||||
screenEdge: 'top',
|
||||
},
|
||||
{
|
||||
element: gZenVerticalTabsManager.actualWindowButtons,
|
||||
}
|
||||
];
|
||||
},
|
||||
|
||||
@@ -336,8 +339,9 @@ var gZenCompactModeManager = {
|
||||
target.addEventListener('mouseleave', (event) => {
|
||||
// If on Mac, ignore mouseleave in the area of window buttons
|
||||
if (AppConstants.platform == 'macosx') {
|
||||
const MAC_WINDOW_BUTTONS_X_BORDER = 75;
|
||||
const MAC_WINDOW_BUTTONS_Y_BORDER = 40;
|
||||
const buttonRect = gZenVerticalTabsManager.actualWindowButtons.getBoundingClientRect();
|
||||
const MAC_WINDOW_BUTTONS_X_BORDER = buttonRect.width + buttonRect.x;
|
||||
const MAC_WINDOW_BUTTONS_Y_BORDER = buttonRect.height + buttonRect.y;
|
||||
if (event.clientX < MAC_WINDOW_BUTTONS_X_BORDER && event.clientY < MAC_WINDOW_BUTTONS_Y_BORDER) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user