Masse-Dropdown in Oberleiste + Satellite-Settings statt Dimensionen-Inline
User-Feedback: Mass-Style passt nicht ins Dimensionen-Panel, und der Name "Mass-Style" gefaellt nicht. Umzug in die Oberleiste (analog Display) + Zahnrad oeffnet eigenes Settings-Fenster. UI-Begriff jetzt "Masse". Frontend: - OberleisteApp: neue Gruppe "Masse" mit Preset-Dropdown + Zahnrad-Button zwischen Display und Massstab - MasseSettingsApp.jsx (neu): Satellite-Fenster mit Name/Raum-Rundung/ Mass-Dezimalstellen/Mass-Einheit + Picker + Add/Delete - DimensionenApp: MassStyleSection raus - rhinoBridge: setMasseActive + openMasseSettings (Topbar); masseSetActive/masseSavePreset/masseDeletePreset (Settings-Fenster) Backend: - rhino/masse_settings.py (neu): Bridge fuer das Satellite-Fenster, Topics SET_ACTIVE / SAVE / DELETE, triggert regen_all_rooms + topbar refresh - mass_style.regen_all_rooms(doc): neue cross-modul-Helper, queued Raum-Regen fuer alle raum_outline-Objekte - oberleiste.py: massePresets + masseActiveId im State, SET_MASSE_ACTIVE + OPEN_MASSE_SETTINGS handler, Signature update - dimensionen.py: Mass-Style-Endpoints + State raus (sind jetzt im OberleisteBridge bzw. MasseSettingsBridge) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import {
|
||||
setRefPoint, setCoordSystem,
|
||||
setDimPosition, setDimDimension, setDimRotationZ,
|
||||
setCircleRadius, setLineLength, setRectangleDims,
|
||||
setMassStyleActive, saveMassStyle, deleteMassStyle,
|
||||
} from './lib/rhinoBridge'
|
||||
|
||||
// ---- Helpers --------------------------------------------------------------
|
||||
@@ -141,149 +140,6 @@ function Field({ label, children, style }) {
|
||||
)
|
||||
}
|
||||
|
||||
// ---- Mass-Style Section ---------------------------------------------------
|
||||
// Globaler Preset-Picker fuer Raum-Rundung + Mass-Linien-Dezimalstellen.
|
||||
// Hostet hier weil das thematisch zu Dimensionen passt, der Preset wird aber
|
||||
// dokument-weit angewendet (Raum-Stempel lesen ihn auch).
|
||||
|
||||
const RAUM_RUNDUNGS_LABELS = {
|
||||
'exakt': 'Exakt (2 Nachk.)',
|
||||
'0.01': 'auf 0.01 m²',
|
||||
'0.1': 'auf 0.1 m²',
|
||||
'0.5': 'auf 0.5 m²',
|
||||
'1': 'auf 1 m²',
|
||||
}
|
||||
|
||||
function MassStyleSection({ massStyles, activeId }) {
|
||||
const styles = Array.isArray(massStyles) ? massStyles : []
|
||||
const active = styles.find(p => p.id === activeId) || styles[0]
|
||||
const update = (patch) => {
|
||||
if (!active) return
|
||||
saveMassStyle({ ...active, ...patch })
|
||||
}
|
||||
const addNew = () => {
|
||||
const name = (window.prompt('Name für neuen Mass-Style:') || '').trim()
|
||||
if (!name) return
|
||||
// Aktuelle Werte als Vorlage uebernehmen (oder Defaults)
|
||||
const tmpl = active || { raumRundung: '0.1', dimDezimalstellen: 2, dimEinheit: 'm' }
|
||||
saveMassStyle({
|
||||
name,
|
||||
raumRundung: tmpl.raumRundung,
|
||||
dimDezimalstellen: tmpl.dimDezimalstellen,
|
||||
dimEinheit: tmpl.dimEinheit,
|
||||
})
|
||||
}
|
||||
const remove = () => {
|
||||
if (!active) return
|
||||
if (styles.length <= 1) {
|
||||
window.alert('Mindestens ein Mass-Style muss erhalten bleiben.')
|
||||
return
|
||||
}
|
||||
if (!window.confirm(`Mass-Style "${active.name}" löschen?`)) return
|
||||
deleteMassStyle(active.id)
|
||||
}
|
||||
return (
|
||||
<div style={{
|
||||
padding: '8px 12px',
|
||||
borderBottom: '1px solid var(--border-light)',
|
||||
background: 'var(--bg-section)',
|
||||
}}>
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', gap: 6, marginBottom: 6,
|
||||
}}>
|
||||
<Icon name="straighten" size={12} style={{ color: 'var(--text-muted)' }} />
|
||||
<span style={{ fontSize: 9, color: 'var(--text-muted)',
|
||||
textTransform: 'uppercase', letterSpacing: '0.06em',
|
||||
fontWeight: 600, flex: 1 }}>
|
||||
Mass-Style
|
||||
</span>
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 4, marginBottom: 6 }}>
|
||||
<select
|
||||
value={activeId || (active?.id || '')}
|
||||
onChange={(e) => setMassStyleActive(e.target.value)}
|
||||
style={{ flex: 1, fontSize: 11 }}
|
||||
>
|
||||
{styles.map(p => (
|
||||
<option key={p.id} value={p.id}>{p.name}</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
onClick={addNew}
|
||||
className="btn-outlined"
|
||||
style={{ padding: '3px 6px' }}
|
||||
title="Neuen Mass-Style anlegen (mit aktuellen Werten als Vorlage)"
|
||||
><Icon name="add" size={12} /></button>
|
||||
<button
|
||||
onClick={remove}
|
||||
className="btn-outlined"
|
||||
style={{ padding: '3px 6px' }}
|
||||
title="Aktuellen Mass-Style löschen"
|
||||
disabled={styles.length <= 1}
|
||||
><Icon name="delete" size={12} /></button>
|
||||
</div>
|
||||
{active && (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<span style={{ fontSize: 9, color: 'var(--text-muted)', width: 90 }}>
|
||||
Name
|
||||
</span>
|
||||
<input
|
||||
type="text"
|
||||
value={active.name}
|
||||
onChange={(e) => update({ name: e.target.value })}
|
||||
style={{ flex: 1, fontSize: 11, padding: '2px 6px' }}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<span style={{ fontSize: 9, color: 'var(--text-muted)', width: 90 }}>
|
||||
Raum-Rundung
|
||||
</span>
|
||||
<select
|
||||
value={active.raumRundung}
|
||||
onChange={(e) => update({ raumRundung: e.target.value })}
|
||||
style={{ flex: 1, fontSize: 11 }}
|
||||
>
|
||||
{Object.entries(RAUM_RUNDUNGS_LABELS).map(([v, l]) => (
|
||||
<option key={v} value={v}>{l}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<span style={{ fontSize: 9, color: 'var(--text-muted)', width: 90 }}>
|
||||
Mass-Dezimalstellen
|
||||
</span>
|
||||
<select
|
||||
value={active.dimDezimalstellen}
|
||||
onChange={(e) => update({ dimDezimalstellen: parseInt(e.target.value, 10) })}
|
||||
style={{ flex: 1, fontSize: 11 }}
|
||||
>
|
||||
{[0, 1, 2, 3, 4].map(n => (
|
||||
<option key={n} value={n}>{n} {n === 1 ? 'Stelle' : 'Stellen'}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<span style={{ fontSize: 9, color: 'var(--text-muted)', width: 90 }}>
|
||||
Mass-Einheit
|
||||
</span>
|
||||
<select
|
||||
value={active.dimEinheit}
|
||||
onChange={(e) => update({ dimEinheit: e.target.value })}
|
||||
style={{ flex: 1, fontSize: 11 }}
|
||||
>
|
||||
<option value="m">m (Meter)</option>
|
||||
<option value="cm">cm (Zentimeter)</option>
|
||||
<option value="mm">mm (Millimeter)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// ---- Hauptkomponente ------------------------------------------------------
|
||||
|
||||
export default function DimensionenApp() {
|
||||
@@ -339,11 +195,6 @@ export default function DimensionenApp() {
|
||||
}}>
|
||||
<div style={{ flex: 1, overflowY: 'auto', overflowX: 'hidden' }}>
|
||||
|
||||
<MassStyleSection
|
||||
massStyles={state.massStyles}
|
||||
activeId={state.massStyleActive}
|
||||
/>
|
||||
|
||||
{/* Header: Selektions-Info + World/CPlane */}
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', gap: 6,
|
||||
|
||||
Reference in New Issue
Block a user