mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Added different transparency modes for macos and stopped initializing workspaces on closed windows
This commit is contained in:
@@ -370,6 +370,14 @@ pref('browser.download.autohideButton', false);
|
||||
// Enable transparent background for macos
|
||||
#ifdef XP_MACOSX
|
||||
pref('widget.macos.titlebar-blend-mode.behind-window', true);
|
||||
// 1. hudWindow
|
||||
// 2. fullScreenUI
|
||||
// 3. popover
|
||||
// 4. menu
|
||||
// 5. toolTip
|
||||
// 6. headerView
|
||||
// 7. underlay
|
||||
pref('zen.widget.macos.window-material', 7);
|
||||
#endif
|
||||
|
||||
// Urlbar and autocomplete
|
||||
|
@@ -190,14 +190,16 @@ var gZenCompactModeManager = {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.sidebar.removeAttribute('animate');
|
||||
this.sidebar.style.removeProperty('margin-right');
|
||||
this.sidebar.style.removeProperty('margin-left');
|
||||
this.sidebar.style.removeProperty('transform');
|
||||
this.sidebar.style.transition = 'none';
|
||||
setTimeout(() => {
|
||||
this._animating = false;
|
||||
this.sidebar.style.removeProperty('transition');
|
||||
window.requestAnimationFrame(() => {
|
||||
this.sidebar.removeAttribute('animate');
|
||||
this.sidebar.style.removeProperty('margin-right');
|
||||
this.sidebar.style.removeProperty('margin-left');
|
||||
this.sidebar.style.removeProperty('transform');
|
||||
this.sidebar.style.transition = 'none';
|
||||
setTimeout(() => {
|
||||
this._animating = false;
|
||||
this.sidebar.style.removeProperty('transition');
|
||||
});
|
||||
});
|
||||
});
|
||||
} else if (canHideSidebar && !isCompactMode) {
|
||||
|
@@ -512,9 +512,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
if (typeof this._workspaceEnabled === 'undefined') {
|
||||
this._workspaceEnabled =
|
||||
!Services.prefs.getBoolPref('zen.workspaces.disabled_for_testing', false) && this.shouldHaveWorkspaces;
|
||||
return this._workspaceEnabled;
|
||||
}
|
||||
return this._workspaceEnabled;
|
||||
return this._workspaceEnabled && !window.closed;
|
||||
}
|
||||
|
||||
getActiveWorkspaceFromCache() {
|
||||
@@ -591,6 +590,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
console.error('ZenWorkspaces: Error initializing theme picker', e);
|
||||
}
|
||||
this._selectStartPage();
|
||||
this._fixTabPositions();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1538,10 +1538,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
_moveEmptyTabToWorkspace(workspaceUuid) {
|
||||
const emptyTab = this._emptyTab;
|
||||
if (emptyTab) {
|
||||
this.moveTabToWorkspace(emptyTab, workspaceUuid);
|
||||
}
|
||||
this._makeSureEmptyTabIsLast();
|
||||
}
|
||||
|
||||
_makeSureEmptyTabIsLast() {
|
||||
@@ -1552,6 +1549,15 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
container.insertBefore(emptyTab, container.lastChild);
|
||||
}
|
||||
}
|
||||
this._fixTabPositions();
|
||||
}
|
||||
|
||||
_fixTabPositions() {
|
||||
// Fix tabs _tPos values relative to the actual order
|
||||
const tabs = gBrowser.tabs;
|
||||
for (let i = 0; i < tabs.length; i++) {
|
||||
tabs[i]._tPos = i;
|
||||
}
|
||||
}
|
||||
|
||||
_updateMarginTopPinnedTabs(arrowscrollbox, pinnedContainer) {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
|
||||
index ce2393978f77f55f42ae9b97e5d40328ce8eaae4..a426679de76c2d172974ec87f5fe48e22d5ab7b0 100644
|
||||
index a9863858f9a28b2c633edd9689d4379203eef1e6..a0c121d934313f272ade1061146fbc4b96e2ddda 100644
|
||||
--- a/modules/libpref/init/StaticPrefList.yaml
|
||||
+++ b/modules/libpref/init/StaticPrefList.yaml
|
||||
@@ -18060,7 +18060,7 @@
|
||||
@@ -18305,7 +18305,7 @@
|
||||
# Whether we use the mica backdrop. Off by default for now.
|
||||
- name: widget.windows.mica
|
||||
type: bool
|
||||
@@ -11,7 +11,7 @@ index ce2393978f77f55f42ae9b97e5d40328ce8eaae4..a426679de76c2d172974ec87f5fe48e2
|
||||
mirror: once
|
||||
#endif
|
||||
|
||||
@@ -18173,6 +18173,19 @@
|
||||
@@ -18418,6 +18418,25 @@
|
||||
mirror: always
|
||||
#endif
|
||||
|
||||
@@ -21,6 +21,12 @@ index ce2393978f77f55f42ae9b97e5d40328ce8eaae4..a426679de76c2d172974ec87f5fe48e2
|
||||
+ value: true
|
||||
+ mirror: never
|
||||
+
|
||||
+#ifdef XP_MACOSX
|
||||
+- name: zen.widget.macos.window-material
|
||||
+ type: uint32_t
|
||||
+ value: 0
|
||||
+ mirror: once
|
||||
+
|
||||
+#ifdef XP_WIN
|
||||
+- name: zen.widget.windows.acrylic
|
||||
+ type: bool
|
||||
|
@@ -1,13 +1,37 @@
|
||||
diff --git a/widget/cocoa/VibrancyManager.mm b/widget/cocoa/VibrancyManager.mm
|
||||
index e8263ee480a0249cae760ee5b9037bb87acafecc..aefc887208659e46191eebfde1f9f74f1eac77a5 100644
|
||||
index 849b62c9976a7bc5fee35e074e54c8f556ed9c38..92ddc9022055f518cb371d64e8e644c4b3ada798 100644
|
||||
--- a/widget/cocoa/VibrancyManager.mm
|
||||
+++ b/widget/cocoa/VibrancyManager.mm
|
||||
@@ -39,7 +39,7 @@ static NSVisualEffectMaterial VisualEffectMaterialForVibrancyType(
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "nsChildView.h"
|
||||
#include "mozilla/StaticPrefs_widget.h"
|
||||
+#include "mozilla/StaticPrefs_zen.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@@ -40,7 +41,23 @@ static NSVisualEffectMaterial VisualEffectMaterialForVibrancyType(
|
||||
case VibrancyType::Sidebar:
|
||||
return NSVisualEffectMaterialSidebar;
|
||||
case VibrancyType::Titlebar:
|
||||
- return NSVisualEffectMaterialTitlebar;
|
||||
+ return NSVisualEffectMaterialUnderWindowBackground;
|
||||
+ switch (StaticPrefs::zen_widget_macos_window_material_AtStartup()) {
|
||||
+ case 1:
|
||||
+ return NSVisualEffectMaterialHUDWindow;
|
||||
+ case 2:
|
||||
+ return NSVisualEffectMaterialFullScreenUI;
|
||||
+ case 3:
|
||||
+ return NSVisualEffectMaterialPopover;
|
||||
+ case 4:
|
||||
+ return NSVisualEffectMaterialMenu;
|
||||
+ case 5:
|
||||
+ return NSVisualEffectMaterialToolTip;
|
||||
+ case 6:
|
||||
+ return NSVisualEffectMaterialHeaderView;
|
||||
+ case 7:
|
||||
+ default:
|
||||
+ return NSVisualEffectMaterialUnderWindowBackground;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user