Settings-Dialoge in echten Rhino-Fenstern (Eto.Form + WebView)
Statt Overlay-im-Panel oeffnet sich der Settings-Dialog jetzt als echtes Rhino-Fenster (verschiebbar, resizable, mehrere parallel). Infrastruktur in panel_base.py: - load_inline akzeptiert jetzt `params` (dict) und injiziert sie als window.PANEL_PARAMS — Satelliten-Apps lesen ihren initialen State daraus. - Neue Funktion open_satellite_window(mode, params, title, size, on_save, on_cancel): erstellt Eto.Forms.Form mit eingebetteter WebView, eigenem Inline-Bridge fuer SAVE/CANCEL-Messages, ruft Callbacks auf und schliesst das Fenster. Backend rhinopanel.py: - Neue Message-Handler OPEN_GESCHOSS_SETTINGS und OPEN_EBENEN_SETTINGS. - _open_geschoss_settings: oeffnet das Satelliten-Fenster mit dem Geschoss als Payload. on_save: replace im doc.Strings z-Liste + _apply(save_z=True). - _open_ebenen_settings: gleich, aber fuer Ebene + hatchPatterns. Neue React-Entries: - GeschossSettingsApp.jsx: wrappt GeschossSettingsDialog, liest window.PANEL_PARAMS, schickt SAVE/CANCEL direkt via document.title- Bridge. - EbenenSettingsApp.jsx: gleich fuer EbenenSettingsDialog. main.jsx-Switch erweitert um 'geschoss_settings' und 'ebenen_settings'. GeschossManager und EbenenManager: - Inline-Dialog-State und -Rendering entfernt. - onSettings ruft jetzt openGeschossSettings(z) / openEbenenSettings(e) in der Bridge auf → Backend oeffnet das Satelliten-Fenster. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { useEffect } from 'react'
|
||||
import GeschossSettingsDialog from './components/GeschossSettingsDialog'
|
||||
import { onMessage, notifyReady } from './lib/rhinoBridge'
|
||||
|
||||
// Inline send fuer SAVE/CANCEL — schickt direkt an Python-Bridge des
|
||||
// Satelliten-Fensters.
|
||||
function bridgeSend(type, payload = {}) {
|
||||
if (!window.RHINO_MODE) { console.log('[Bridge] →', type, payload); return }
|
||||
const json = JSON.stringify({ type, payload })
|
||||
document.title = 'RHINOMSG::' + json
|
||||
}
|
||||
|
||||
export default function GeschossSettingsApp() {
|
||||
// PANEL_PARAMS wurden von Python beim Window-Open injiziert.
|
||||
const initial = (typeof window !== 'undefined' && window.PANEL_PARAMS) || {}
|
||||
|
||||
useEffect(() => {
|
||||
notifyReady()
|
||||
// Native Browser-Context-Menu unterdruecken
|
||||
const blockContext = (ev) => ev.preventDefault()
|
||||
document.addEventListener('contextmenu', blockContext)
|
||||
return () => document.removeEventListener('contextmenu', blockContext)
|
||||
}, [])
|
||||
|
||||
// Wenn keine Daten da sind: leeres Frame
|
||||
if (!initial || typeof initial !== 'object') {
|
||||
return <div style={{ padding: 20, color: 'var(--text-muted)' }}>Keine Daten</div>
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
width: '100vw', height: '100vh',
|
||||
background: 'var(--bg-base)',
|
||||
overflow: 'hidden',
|
||||
}}>
|
||||
<GeschossSettingsDialog
|
||||
geschoss={initial}
|
||||
onSave={(updated) => bridgeSend('SAVE', updated)}
|
||||
onClose={() => bridgeSend('CANCEL', {})}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user