AGPL-3.0 Dual-Lizenz + Pill-Stil-UI + Section-Style-Overhaul + Plan-Mode-Template
Lizenz: - AGPL-3.0 LICENSE-File im Repo-Root (GNU Volltext) - SPDX-Header + Copyright in allen Source-Files (Python/JSX/JS/Rust) - license-Feld in package.json + Cargo.toml - About-App komplett neu: Dual-Lizenz-Block (AGPL + Commercial), openbureau-Branding, Version-Pills, made-in-Switzerland-Footer UI-Restyle (3 Wellen) — alle Dialoge + Satellites + Panel-Sidebars auf gemeinsamen Pill-Stil aus BarControls (BarToggle/BarButton/BarCombo): - Welle 1: GeschossDialog/Settings, AusschnittSettings, LayoutDialog - Welle 2: ConfirmDeleteEbene, Kamera, MasseSettings, Osm, Swisstopo, TextEditor, AusschnittLayerDialog, LayerCombinations - Welle 3: LayoutsApp, MassstabApp, WerkzeugeApp, OverridesApp, ZeichnungsebenenApp; Werkzeuge mit ElementeApp-PillGroup-Layout GeschossDialog Header-Refactor: +Geschoss/+Zeichnung in Toolbar oben, move-Pfeile-Spalte breiter (kein Overlap mit G-Haken) Ausschnitte Rows als Pills, kein Outer-Border ums Suchfeld Section-Style komplett neu (gestaltung.py + GestaltungApp.jsx): - ObjectSectionAttributesSource.FromObject (richtiger Enum-Name fuer Mac) - HatchPatternPrintColor + BoundaryPrintColor mit-setzen (Display = Print) - BoundaryColor nur bei explizitem User-Override, sonst Rhino-Default - background_color_hex Parameter (BackgroundFillMode=SolidColor) - Readback aus GetCustomSectionStyle statt direkt aus Attributes - UI: Schnittkante > Section Style > Solid-Fill mit proper SectionHead - 'Boundary' (3D Pen) -> 'Background' weil sich's wie Section-Hintergrund verhaelt Plan-Mode 'Dossier Plan' via Template: - rhino/templates/dossier_plan.ini wird direkt geladen - Fallback auf Technical-Clone + ini-Patch wenn Template fehlt - Auto-Cleanup von Orphan-Modes vor Import (Name- oder Guid-Match) - ClipSectionUsage=1 + TechnicalMask=15 als bekannte Soll-Werte - Bei Template-Pfad keine ini-Patches (1:1 wie User exportiert) - Sanity-Print listet alle registrierten Modes nach Anlegen Bridge-Unification: 4 Settings-Apps (Ebenen/Project/Geschoss*Dialog) benutzen jetzt chunkende send() statt eigene bridgeSend ohne Chunk- Logik -> grosse Payloads (Hatch-Refs etc.) kommen nicht mehr truncated bei Python an (loeste 'JSON-Fehler char 990'-Regression in Ebenen- Settings) Library-Imports robust: 'import library' jetzt Top-Level in elemente.py + rhinopanel.py (statt Lazy in Methoden) -> 'No module named library'- Crashes weg auch wenn sys.path zwischendurch resettet wird Tools fuer Display-Mode-Maintenance: - _clean_display_modes.py (loescht alle Custom-Modes, Built-ins bleiben) - _inspect_plan_mode.py / _inspect_obj_section.py / _inspect_obj_boundary.py (Diagnose-Skripte fuer SectionStyle-Property-Reverse-Engineering) - _reset_rhino_settings.sh (Backup + Nuke der Rhino-Settings als letzte Bastion gegen korrupte Display-Modes)
This commit is contained in:
+49
-77
@@ -1,5 +1,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
// Copyright (C) 2026 Karim Gabriele Varano
|
||||
import { useState, useEffect } from 'react'
|
||||
import Icon from './components/Icon'
|
||||
import { BarToggle, BarButton, BAR_H } from './components/BarControls'
|
||||
import {
|
||||
onMessage, notifyReady,
|
||||
setKameraViewport, setKameraProjection, setKameraIso,
|
||||
@@ -13,6 +16,18 @@ const labelXs = {
|
||||
fontWeight: 600,
|
||||
}
|
||||
|
||||
const pillInput = {
|
||||
height: BAR_H,
|
||||
background: 'var(--bg-input)',
|
||||
border: '1px solid var(--border)',
|
||||
borderRadius: 999,
|
||||
color: 'var(--text-primary)',
|
||||
fontSize: 11, fontFamily: 'var(--font)',
|
||||
padding: '0 10px',
|
||||
outline: 'none',
|
||||
boxSizing: 'border-box',
|
||||
}
|
||||
|
||||
function NumberField({ label, value, onCommit, suffix, step = 0.1 }) {
|
||||
const [draft, setDraft] = useState(value != null ? value.toFixed(3) : '')
|
||||
useEffect(() => {
|
||||
@@ -37,8 +52,7 @@ function NumberField({ label, value, onCommit, suffix, step = 0.1 }) {
|
||||
if (ev.key === 'Enter') commit()
|
||||
if (ev.key === 'Escape') setDraft(value != null ? value.toFixed(3) : '')
|
||||
}}
|
||||
style={{ flex: 1, fontSize: 11, padding: '4px 8px',
|
||||
fontFamily: 'var(--font-mono)' }}
|
||||
style={{ ...pillInput, flex: 1, fontFamily: 'var(--font-mono)' }}
|
||||
/>
|
||||
{suffix && (
|
||||
<span style={{ fontSize: 9, color: 'var(--text-muted)', minWidth: 18 }}>
|
||||
@@ -123,32 +137,19 @@ export default function KameraApp() {
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
<span style={{ fontSize: 13, fontWeight: 600 }}>{vp.name || 'Unnamed'}</span>
|
||||
<div style={{ flex: 1 }} />
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
borderRadius: 999,
|
||||
border: '1px solid var(--border)',
|
||||
overflow: 'hidden',
|
||||
}}>
|
||||
<button
|
||||
onClick={() => setKameraProjection(false)}
|
||||
className={!isPar ? 'btn-contained' : 'btn-outlined'}
|
||||
style={{ padding: '4px 12px', fontSize: 10, border: 'none',
|
||||
borderRadius: 0 }}
|
||||
>Perspektive</button>
|
||||
<button
|
||||
onClick={() => setKameraProjection(true)}
|
||||
className={isPar ? 'btn-contained' : 'btn-outlined'}
|
||||
style={{ padding: '4px 12px', fontSize: 10, border: 'none',
|
||||
borderRadius: 0 }}
|
||||
>Parallel</button>
|
||||
</div>
|
||||
<BarToggle label="Perspektive"
|
||||
active={!isPar}
|
||||
onClick={() => setKameraProjection(false)} />
|
||||
<BarToggle label="Parallel"
|
||||
active={isPar}
|
||||
onClick={() => setKameraProjection(true)} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Plan-Norden — Rotations-Winkel im Uhrzeigersinn von +Y */}
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
||||
<span style={labelXs}>Plan-Norden (Rotation von +Y, im Uhrzeigersinn)</span>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<input
|
||||
type="number" min={0} max={360} step={0.5}
|
||||
value={northAngle.toFixed(1)}
|
||||
@@ -159,16 +160,12 @@ export default function KameraApp() {
|
||||
setKameraNorthAngle(a)
|
||||
}
|
||||
}}
|
||||
style={{ flex: 1, fontSize: 12, padding: '4px 8px',
|
||||
fontFamily: 'DM Mono, monospace' }}
|
||||
style={{ ...pillInput, flex: 1, fontFamily: 'DM Mono, monospace' }}
|
||||
/>
|
||||
<span style={{ fontSize: 11, color: 'var(--text-muted)' }}>°</span>
|
||||
<button
|
||||
<BarToggle label="Reset"
|
||||
onClick={() => { setNorthAngleState(0); setKameraNorthAngle(0) }}
|
||||
className="btn-outlined"
|
||||
style={{ padding: '4px 10px', fontSize: 10 }}
|
||||
title="Norden zurueck auf +Y (0°)"
|
||||
>Reset</button>
|
||||
title="Norden zurueck auf +Y (0°)" />
|
||||
</div>
|
||||
<span style={{ fontSize: 10, color: 'var(--text-muted)', lineHeight: 1.4 }}>
|
||||
Norden = +Y bei 0°. Bei rotierten Projekten (z.B. swissBUILDINGS in
|
||||
@@ -180,20 +177,12 @@ export default function KameraApp() {
|
||||
{/* Iso-Quick-Picker */}
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
||||
<span style={labelXs}>Isometrie (Standard, true-iso 35°/45°)</span>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 4 }}>
|
||||
{[
|
||||
{ v: 'NW', label: 'NW' },
|
||||
{ v: 'NE', label: 'NE' },
|
||||
{ v: 'SE', label: 'SE' },
|
||||
{ v: 'SW', label: 'SW' },
|
||||
].map(o => (
|
||||
<button
|
||||
key={o.v}
|
||||
onClick={() => setKameraIso(o.v)}
|
||||
className="btn-outlined"
|
||||
style={{ padding: '6px 0', fontSize: 11 }}
|
||||
title={`Isometrie aus ${o.label} (Kamera blickt Richtung Szene)`}
|
||||
>{o.label}</button>
|
||||
<div style={{ display: 'flex', gap: 4 }}>
|
||||
{['NW', 'NE', 'SE', 'SW'].map(v => (
|
||||
<BarToggle key={v} label={v}
|
||||
onClick={() => setKameraIso(v)}
|
||||
title={`Isometrie aus ${v} (Kamera blickt Richtung Szene)`}
|
||||
minWidth={48} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
@@ -205,9 +194,9 @@ export default function KameraApp() {
|
||||
{/* Distance read-only */}
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', gap: 8,
|
||||
padding: '6px 10px',
|
||||
padding: '6px 12px',
|
||||
background: 'var(--bg-section)',
|
||||
borderRadius: 6,
|
||||
borderRadius: 999,
|
||||
border: '1px solid var(--border-light)',
|
||||
}}>
|
||||
<span style={labelXs}>Distanz</span>
|
||||
@@ -236,19 +225,13 @@ export default function KameraApp() {
|
||||
/>
|
||||
)}
|
||||
|
||||
<button
|
||||
onClick={() => kameraZoomExtents()}
|
||||
className="btn-outlined"
|
||||
style={{ padding: '6px 12px', fontSize: 11 }}
|
||||
>
|
||||
<Icon name="zoom_out_map" size={13} />
|
||||
<span style={{ marginLeft: 6 }}>Zoom Extents</span>
|
||||
</button>
|
||||
<BarToggle icon="zoom_out_map" label="Zoom Extents"
|
||||
onClick={() => kameraZoomExtents()} />
|
||||
|
||||
{/* Presets */}
|
||||
<div style={{
|
||||
display: 'flex', flexDirection: 'column', gap: 6,
|
||||
padding: 10, borderRadius: 6,
|
||||
padding: 10, borderRadius: 'var(--r-lg)',
|
||||
background: 'var(--bg-section)',
|
||||
border: '1px solid var(--border-light)',
|
||||
}}>
|
||||
@@ -260,41 +243,34 @@ export default function KameraApp() {
|
||||
value={presetName}
|
||||
onChange={(ev) => setPresetName(ev.target.value)}
|
||||
onKeyDown={(ev) => { if (ev.key === 'Enter') saveCurrent() }}
|
||||
style={{ flex: 1, fontSize: 11, padding: '4px 8px' }}
|
||||
style={{ ...pillInput, flex: 1 }}
|
||||
/>
|
||||
<button
|
||||
onClick={saveCurrent}
|
||||
<BarToggle label="Speichern"
|
||||
active={!!presetName.trim()}
|
||||
disabled={!presetName.trim()}
|
||||
className="btn-contained"
|
||||
style={{ padding: '4px 12px', fontSize: 11 }}
|
||||
>Aktuelle speichern</button>
|
||||
onClick={saveCurrent} />
|
||||
</div>
|
||||
{presets.length === 0 ? (
|
||||
<span style={{ fontSize: 10, color: 'var(--text-muted)', fontStyle: 'italic' }}>
|
||||
Keine Presets gespeichert.
|
||||
</span>
|
||||
) : (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
||||
{presets.map(p => (
|
||||
<div
|
||||
key={p.id}
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 6,
|
||||
padding: '4px 6px',
|
||||
borderRadius: 4,
|
||||
padding: '2px 6px 2px 4px',
|
||||
borderRadius: 999,
|
||||
background: 'var(--bg-item)',
|
||||
border: '1px solid transparent',
|
||||
border: '1px solid var(--border-light)',
|
||||
fontSize: 11,
|
||||
}}
|
||||
>
|
||||
<button
|
||||
<BarButton icon="play_arrow"
|
||||
onClick={() => applyKameraPreset(p.id)}
|
||||
className="btn-outlined"
|
||||
style={{ padding: '2px 8px', fontSize: 10 }}
|
||||
title="Anwenden"
|
||||
>
|
||||
<Icon name="play_arrow" size={11} />
|
||||
</button>
|
||||
title="Anwenden" />
|
||||
<span style={{ flex: 1, minWidth: 0,
|
||||
overflow: 'hidden', textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap' }}>{p.name}</span>
|
||||
@@ -302,13 +278,9 @@ export default function KameraApp() {
|
||||
fontFamily: 'var(--font-mono)' }}>
|
||||
{p.parallel ? 'Par' : 'Persp'}
|
||||
</span>
|
||||
<button
|
||||
<BarButton icon="close"
|
||||
onClick={() => deleteKameraPreset(p.id)}
|
||||
className="btn-icon-xs"
|
||||
title="Loeschen"
|
||||
>
|
||||
<Icon name="close" size={11} />
|
||||
</button>
|
||||
title="Loeschen" />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user