Skip to content

Commit

Permalink
Fixed having multiple windows displaying the wrong essentials at star…
Browse files Browse the repository at this point in the history
…tup and worked on rices
  • Loading branch information
mr-cheff committed Dec 26, 2024
1 parent 59a84c3 commit 70c0fff
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion l10n
15 changes: 15 additions & 0 deletions src/browser/base/content/appmenu-viewcache-inc-xhtml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/browser/base/content/appmenu-viewcache.inc.xhtml b/browser/base/content/appmenu-viewcache.inc.xhtml
index 3c5c4f29b1de25a4ce17089502f2251a27e5c7f5..dfa3260ed3c2bb6067745696fbf103c7e56c639a 100644
--- a/browser/base/content/appmenu-viewcache.inc.xhtml
+++ b/browser/base/content/appmenu-viewcache.inc.xhtml
@@ -421,6 +421,10 @@
class="subviewbutton"
data-l10n-id="appmenu-customizetoolbar"
command="cmd_CustomizeToolbars"/>
+ <toolbarbutton id="appmenu-zen-share-rice"
+ class="subviewbutton"
+ data-l10n-id="appmenu-zen-share-rice"
+ oncommand="gZenThemePicker.shareTheme()" />
<toolbarseparator/>
<html:h2 id="appmenu-developer-tools"
data-l10n-id="appmenu-developer-tools-subheader"
3 changes: 0 additions & 3 deletions src/browser/base/content/zen-popupset.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@
<panelmultiview id="PanelUI-zen-gradient-generator-multiview" mainViewId="PanelUI-zen-gradient-generator-view">
<panelview id="PanelUI-zen-gradient-generator-view" class="PanelUI-subView zen-theme-picker" role="document" mainview-with-header="true" has-custom-header="true">
<hbox class="zen-theme-picker-gradient">
<box id="zen-rice-share-btn" class="subviewbutton" onclick="gZenThemePicker.shareTheme();">
<image></image>
</box>
</hbox>
<hbox id="PanelUI-zen-gradient-generator-controls">
<vbox id="PanelUI-zen-gradient-generator-options">
Expand Down
22 changes: 2 additions & 20 deletions src/browser/base/content/zen-styles/zen-animations.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

@keyframes zen-slide-in {
from {
transform: translateX(-100%);
transform: translateX(-150%);
opacity: 0;
}
to {
Expand All @@ -87,7 +87,7 @@

@keyframes zen-slide-in-reverse {
from {
transform: translateX(100%);
transform: translateX(150%);
opacity: 0;
}
to {
Expand Down Expand Up @@ -349,21 +349,3 @@
transform: translateX(-100%) translateY(-50%);
}
}

@keyframes zen-jello-animation-with-translate {
0% {
transform: scale3d(0.8, 0.8, 0.8) translate(-50%, -50%);
transform-origin: 50% 50%;
}

60% {
transform: scale3d(1.02, 1.02, 1.02) translate(-50%, -50%);
transform-origin: 50% 50%;
}

to {
opacity: 1;
transform: scale3d(1, 1, 1) translate(-50%, -50%);
transform-origin: 50% 50%;
}
}
20 changes: 10 additions & 10 deletions src/browser/base/content/zen-styles/zen-rices.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

#zen-rice-share-btn {
#zen-rice-share-dialog-overlay:not([hidden]) {
position: absolute;
top: 5px;
right: 5px;
background: var(--zen-dialog-background);
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 1;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}

#zen-rice-share-dialog {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--panel-color);
background: var(--arrowpanel-background);
border-radius: var(--zen-panel-radius);
box-shadow: 0 0 1px 1px hsla(0,0%,0%,.2);;
border: var(--zen-appcontent-border);
overflow: hidden;

animation: zen-jello-animation-with-translate 0.3s ease;
animation: zen-jello-animation 0.3s ease;
max-width: 400px;

& .zen-rice-share-content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@
transition: scale 0.07s ease;
&[fadein='true']:not([zen-essential='true']) {
#tabbrowser-tabs[zen-workspace-animation='previous'] & {
animation: zen-slide-in 0.3s ease;
animation: zen-slide-in 0.3s ease-out;
}

#tabbrowser-tabs[zen-workspace-animation='next'] & {
animation: zen-slide-in-reverse 0.3s ease;
animation: zen-slide-in-reverse 0.3s ease-out;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/browser/base/zen-components/ZenGradientGenerator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
let workspaceTheme = theme || workspace.theme;

await this.foreachWindowAsActive(async (browser) => {
if (!browser.gZenThemePicker._hasInitialized) {
if (!browser.gZenThemePicker?._hasInitialized) {
return;
}
// Do not rebuild if the workspace is not the same as the current one
Expand Down
53 changes: 29 additions & 24 deletions src/browser/base/zen-components/ZenRices.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
this._collector = new ZenRiceCollector();
}

init() {
}

async packRice() {
return this._collector.packRice();
}
Expand All @@ -131,37 +134,39 @@
return this._shareDialog;
}
this._shareDialog = window.MozXULElement.parseXULToFragment(`
<vbox id="zen-rice-share-dialog" hidden="true">
<html:img src="chrome://browser/content/zen-images/brand-header.svg" class="zen-rice-share-header" />
<vbox class="zen-rice-share-content">
<html:input type="text" data-l10n-id="zen-rice-share-name" id="zen-rice-share-name" oninput="gZenThemePicker.riceManager.validateShareDialog(this)" />
<hbox class="zen-rice-share-author">
<label data-l10n-id="zen-rice-share-author" />
<html:input type="text" data-l10n-id="zen-rice-share-author-input" id="zen-rice-share-author" />
</hbox>
<vbox zen-collapsed="true" id="zen-rice-share-options" onclick="gZenThemePicker.riceManager.toggleOptions(event)">
<hbox class="options-header">
<label data-l10n-id="zen-rice-share-include" />
<image></image>
<vbox id="zen-rice-share-dialog-overlay" hidden="true">
<vbox id="zen-rice-share-dialog">
<html:img src="chrome://browser/content/zen-images/brand-header.svg" class="zen-rice-share-header" />
<vbox class="zen-rice-share-content">
<html:input type="text" data-l10n-id="zen-rice-share-name" id="zen-rice-share-name" oninput="gZenThemePicker.riceManager.validateShareDialog(this)" />
<hbox class="zen-rice-share-author">
<label data-l10n-id="zen-rice-share-author" />
<html:input type="text" data-l10n-id="zen-rice-share-author-input" id="zen-rice-share-author" />
</hbox>
<checkbox data-l10n-id="zen-rice-share-include-userchrome" id="zen-rice-share-include-userchrome" />
<checkbox data-l10n-id="zen-rice-share-include-usercontent" id="zen-rice-share-include-usercontent" />
<checkbox data-l10n-id="zen-rice-share-include-mods" id="zen-rice-share-include-mods" />
<vbox class="indent">
<checkbox data-l10n-id="zen-rice-share-include-mod-prefs" id="zen-rice-share-include-mod-prefs" />
<vbox zen-collapsed="true" id="zen-rice-share-options" onclick="gZenThemePicker.riceManager.toggleOptions(event)">
<hbox class="options-header">
<label data-l10n-id="zen-rice-share-include" />
<image></image>
</hbox>
<checkbox data-l10n-id="zen-rice-share-include-userchrome" id="zen-rice-share-include-userchrome" />
<checkbox data-l10n-id="zen-rice-share-include-usercontent" id="zen-rice-share-include-usercontent" />
<checkbox data-l10n-id="zen-rice-share-include-mods" id="zen-rice-share-include-mods" />
<vbox class="indent">
<checkbox data-l10n-id="zen-rice-share-include-mod-prefs" id="zen-rice-share-include-mod-prefs" />
</vbox>
<checkbox data-l10n-id="zen-rice-share-include-preferences" id="zen-rice-share-include-preferences" />
<checkbox data-l10n-id="zen-rice-share-include-workspace-themes" id="zen-rice-share-include-workspace-themes" />
</vbox>
<checkbox data-l10n-id="zen-rice-share-include-preferences" id="zen-rice-share-include-preferences" />
<checkbox data-l10n-id="zen-rice-share-include-workspace-themes" id="zen-rice-share-include-workspace-themes" />
<html:moz-button-group class="panel-footer">
<button onclick="gZenThemePicker.riceManager.cancel()" class="footer-button" data-l10n-id="zen-rice-share-cancel" />
<button onclick="gZenThemePicker.riceManager.submit()" class="footer-button" data-l10n-id="zen-rice-share-save" default="true" slot="primary" id="zen-rice-share-save" disabled="true" />
</html:moz-button-group>
</vbox>
<html:moz-button-group class="panel-footer">
<button onclick="gZenThemePicker.riceManager.cancel()" class="footer-button" data-l10n-id="zen-rice-share-cancel" />
<button onclick="gZenThemePicker.riceManager.submit()" class="footer-button" data-l10n-id="zen-rice-share-save" default="true" slot="primary" id="zen-rice-share-save" disabled="true" />
</html:moz-button-group>
</vbox>
</vbox>
`);
document.getElementById("zen-main-app-wrapper").appendChild(this._shareDialog);
this._shareDialog = document.getElementById("zen-rice-share-dialog");
this._shareDialog = document.getElementById("zen-rice-share-dialog-overlay");
return this._shareDialog;
}

Expand Down
1 change: 1 addition & 0 deletions src/browser/base/zen-components/ZenWorkspaces.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
return;
}

await SessionStore.promiseInitialized;
this._inChangingWorkspace = true;
try {
await this._performWorkspaceChange(window, onInit);
Expand Down
8 changes: 4 additions & 4 deletions src/browser/themes/shared/zen-icons/icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@
list-style-image: url('customize.svg') !important;
}

#appmenu-zen-share-rice {
list-style-image: url('share.svg');
}

.bookmark-item[container] {
list-style-image: url('folder.svg') !important;
}
Expand Down Expand Up @@ -504,10 +508,6 @@
list-style-image: url('screen-blocked.svg') !important;
}

#zen-rice-share-btn {
list-style-image: url('share.svg');
}

.popup-notification-icon[popupid='persistent-storage'],
.persistent-storage-icon,
.indexedDB-icon {
Expand Down

0 comments on commit 70c0fff

Please sign in to comment.