Improve zoom handling and setup UI layout
Enhanced zoom target selection to better support parent windows in desktop mode and improved menu popup zoom refresh. Updated setup.css to refine layout, scrolling, and visual effects, including better handling for small screen heights and improved sticky footer appearance.
This commit is contained in:
@@ -524,6 +524,13 @@ function destroyBrowserView(win, tabId) {
|
|||||||
function getZoomTargetForEvent(event) {
|
function getZoomTargetForEvent(event) {
|
||||||
const win = BrowserWindow.fromWebContents(event.sender);
|
const win = BrowserWindow.fromWebContents(event.sender);
|
||||||
if (!win) return null;
|
if (!win) return null;
|
||||||
|
const parentWin = typeof win.getParentWindow === 'function' ? win.getParentWindow() : null;
|
||||||
|
if (parentWin && !parentWin.isDestroyed?.()) {
|
||||||
|
if (parentWin.__nebulaMode === 'desktop') {
|
||||||
|
return getActiveDesktopViewWebContents(parentWin) || parentWin.webContents;
|
||||||
|
}
|
||||||
|
return parentWin.webContents;
|
||||||
|
}
|
||||||
if (win.__nebulaMode === 'desktop') {
|
if (win.__nebulaMode === 'desktop') {
|
||||||
return getActiveDesktopViewWebContents(win) || win.webContents;
|
return getActiveDesktopViewWebContents(win) || win.webContents;
|
||||||
}
|
}
|
||||||
@@ -2153,7 +2160,6 @@ ipcMain.on('menu-popup-command', (event, payload = {}) => {
|
|||||||
try {
|
try {
|
||||||
const menuWin = BrowserWindow.fromWebContents(event.sender);
|
const menuWin = BrowserWindow.fromWebContents(event.sender);
|
||||||
const parentWin = menuWin?.getParentWindow();
|
const parentWin = menuWin?.getParentWindow();
|
||||||
if (menuWin && !menuWin.isDestroyed()) menuWin.hide();
|
|
||||||
if (!parentWin || parentWin.isDestroyed()) return;
|
if (!parentWin || parentWin.isDestroyed()) return;
|
||||||
if (!payload?.cmd || payload.cmd === 'close') return;
|
if (!payload?.cmd || payload.cmd === 'close') return;
|
||||||
parentWin.webContents.send('menu-command', payload);
|
parentWin.webContents.send('menu-command', payload);
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ window.addEventListener('click', (e) => {
|
|||||||
if (!btn) return;
|
if (!btn) return;
|
||||||
const cmd = btn.getAttribute('data-cmd');
|
const cmd = btn.getAttribute('data-cmd');
|
||||||
window.electronAPI?.send?.('menu-popup-command', { cmd });
|
window.electronAPI?.send?.('menu-popup-command', { cmd });
|
||||||
|
if (cmd === 'zoom-in' || cmd === 'zoom-out') {
|
||||||
|
setTimeout(refreshZoom, 50);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('keydown', (e) => {
|
window.addEventListener('keydown', (e) => {
|
||||||
|
|||||||
+25
-4
@@ -50,9 +50,10 @@ body, html {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
height: 100vh;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
overflow-y: auto;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Progress Bar */
|
/* Progress Bar */
|
||||||
@@ -130,7 +131,7 @@ body, html {
|
|||||||
display: none;
|
display: none;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: flex-start;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -159,6 +160,8 @@ body, html {
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-right: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setup-title {
|
.setup-title {
|
||||||
@@ -528,8 +531,8 @@ body, html {
|
|||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: transparent;
|
background: linear-gradient(180deg, rgba(18, 20, 24, 0), rgba(18, 20, 24, 0.85) 45%, rgba(18, 20, 24, 0.95));
|
||||||
backdrop-filter: none;
|
backdrop-filter: blur(6px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
@@ -642,3 +645,21 @@ body, html {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-height: 700px) {
|
||||||
|
.progress-bar {
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-content {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setup-subtitle {
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feature-grid {
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user