mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-19 11:27:16 +00:00
feat: Improved UI for dialog buttons and fixed workspace specific bookmarks, b=no-bug, c=common, workspaces
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/toolkit/themes/shared/in-content/common-shared.css b/toolkit/themes/shared/in-content/common-shared.css
|
||||
index c1acf2d6ab3c9a260e73d43af027f34a807e01dc..af2b4c430a7101af1fb8a3bc0e2959626cf04bfb 100644
|
||||
index c1acf2d6ab3c9a260e73d43af027f34a807e01dc..223afae5c36c98d3b09c001f91e07e90b0b0887a 100644
|
||||
--- a/toolkit/themes/shared/in-content/common-shared.css
|
||||
+++ b/toolkit/themes/shared/in-content/common-shared.css
|
||||
@@ -63,7 +63,7 @@
|
||||
@@ -16,7 +16,7 @@ index c1acf2d6ab3c9a260e73d43af027f34a807e01dc..af2b4c430a7101af1fb8a3bc0e295962
|
||||
background-color: var(--button-background-color);
|
||||
font-weight: normal;
|
||||
- padding: 0.45em 1em;
|
||||
+ padding: 0.6em 1em;
|
||||
+ padding: 0.7em 1em;
|
||||
text-decoration: none;
|
||||
margin: 4px 8px;
|
||||
/* Ensure font-size isn't overridden by widget styling (e.g. in forms.css) */
|
||||
|
||||
@@ -17,7 +17,7 @@ xul|button {
|
||||
transition: 0.1s;
|
||||
}
|
||||
|
||||
button[dlgtype] {
|
||||
dialog::part(dialog-button) {
|
||||
--button-background-color: light-dark(white, #302f63);
|
||||
--button-background-color-hover: color-mix(in srgb, var(--button-background-color) 90%, transparent);
|
||||
--button-background-color-active: color-mix(in srgb, var(--button-background-color) 80%, transparent);
|
||||
@@ -26,6 +26,36 @@ button[dlgtype] {
|
||||
--in-content-primary-button-text-color: white;
|
||||
border-color: light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)) !important;
|
||||
border-bottom-width: 2px !important;
|
||||
position: relative;
|
||||
|
||||
&:is([dlgtype="accept"], [dlgtype="cancel"]) {
|
||||
padding-inline-end: 3.7em;
|
||||
|
||||
&::after {
|
||||
border-radius: 4px;
|
||||
font-weight: 600;
|
||||
position: absolute;
|
||||
right: 0.6em;
|
||||
padding: 3px 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 12px;
|
||||
width: 34px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&[dlgtype="accept"]::after {
|
||||
content: "⏎";
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
outline: 2px solid color-mix(in srgb, currentColor 50%, transparent);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
&[dlgtype="cancel"]::after {
|
||||
content: "ESC";
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xul|button:not(#zen-workspaces-button):active {
|
||||
@@ -33,6 +63,8 @@ xul|button:not(#zen-workspaces-button):active {
|
||||
}
|
||||
|
||||
.footer-button {
|
||||
font-weight: 500 !important;
|
||||
|
||||
transition: scale 0.2s;
|
||||
&:active {
|
||||
scale: 0.98;
|
||||
|
||||
@@ -111,13 +111,14 @@
|
||||
--button-border-color-primary: var(--in-content-primary-button-border-color) !important;
|
||||
|
||||
--button-border-color: var(--in-content-primary-button-border-color) !important;
|
||||
--button-font-weight: 500 !important;
|
||||
|
||||
--button-border-radius: 6px;
|
||||
--button-text-color-primary: var(--in-content-primary-button-text-color) !important;
|
||||
|
||||
--button-background-color: var(--in-content-button-background) !important;
|
||||
--button-background-color-hover: color-mix(in srgb, var(--button-background-color) 95%, transparent) !important;
|
||||
--button-background-color-active: color-mix(in srgb, var(--button-background-color) 90%, transparent) !important;
|
||||
--button-background-color-hover: color-mix(in srgb, currentColor 5%, transparent) !important;
|
||||
--button-background-color-active: color-mix(in srgb, currentColor 10%, transparent) !important;
|
||||
|
||||
--color-accent-primary: var(--button-background-color-primary) !important;
|
||||
--color-accent-primary-hover: var(--button-primary-hover-bgcolor) !important;
|
||||
|
||||
@@ -266,7 +266,9 @@ export class nsZenSessionManager {
|
||||
* The initial session state read from the session file.
|
||||
*/
|
||||
#runStateMigration(initialState) {
|
||||
this.log("Restoring tabs from Places DB after migration");
|
||||
this.log("Restoring tabs from Places DB after migration", initialState, this._migrationData);
|
||||
// Restore spaces into the sidebar object if we don't
|
||||
// have any yet.
|
||||
if (!this.#sidebar.spaces?.length) {
|
||||
this.#sidebar = {
|
||||
...this.#sidebar,
|
||||
|
||||
@@ -57,6 +57,12 @@ window.ZenWorkspaceBookmarksStorage = {
|
||||
CREATE INDEX IF NOT EXISTS idx_bookmarks_workspaces_changes
|
||||
ON zen_bookmarks_workspaces_changes(bookmark_guid, workspace_uuid)
|
||||
`);
|
||||
|
||||
// Before, workspace_uuid was a FOREIGN KEY, not anymore, so we need to drop the constraint
|
||||
// This is a no-op if the constraint doesn't exist
|
||||
await db.execute(`
|
||||
PRAGMA foreign_keys = OFF;
|
||||
`);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
@@ -132,6 +132,15 @@ class nsZenWorkspaces {
|
||||
await this.#waitForPromises();
|
||||
await this.restoreWorkspacesFromSessionStore({});
|
||||
}
|
||||
|
||||
if (!this.privateWindowOrDisabled) {
|
||||
const observerFunction = async () => {
|
||||
delete this._workspaceBookmarksCache;
|
||||
await this.workspaceBookmarks();
|
||||
this._invalidateBookmarkContainers();
|
||||
};
|
||||
Services.obs.addObserver(observerFunction, "workspace-bookmarks-updated");
|
||||
}
|
||||
}
|
||||
|
||||
log(...args) {
|
||||
@@ -2297,7 +2306,7 @@ class nsZenWorkspaces {
|
||||
}
|
||||
|
||||
// Reset bookmarks
|
||||
this._invalidateBookmarkContainers();
|
||||
this.#invalidateBookmarkContainers();
|
||||
|
||||
// Update workspace indicator
|
||||
await this.updateWorkspaceIndicator(workspace, this.workspaceIndicator);
|
||||
@@ -2335,7 +2344,7 @@ class nsZenWorkspaces {
|
||||
ctrlTab.readPref();
|
||||
}
|
||||
|
||||
_invalidateBookmarkContainers() {
|
||||
#invalidateBookmarkContainers() {
|
||||
for (let i = 0, len = this.bookmarkMenus.length; i < len; i++) {
|
||||
const element = document.getElementById(this.bookmarkMenus[i]);
|
||||
if (element && element._placesView) {
|
||||
@@ -2343,6 +2352,7 @@ class nsZenWorkspaces {
|
||||
placesView.invalidateContainer(placesView._resultNode);
|
||||
}
|
||||
}
|
||||
BookmarkingUI.updateEmptyToolbarMessage();
|
||||
}
|
||||
|
||||
updateWorkspacesChangeContextMenu() {
|
||||
|
||||
@@ -47,6 +47,7 @@ export default [
|
||||
|
||||
"delayedStartupPromise",
|
||||
|
||||
"BookmarkingUI",
|
||||
"Services",
|
||||
"PathUtils",
|
||||
"ChromeUtils",
|
||||
|
||||
Reference in New Issue
Block a user