Massstab Row 1: 4 Buttons in segmented Pill statt Einzel-Knoepfen
User: Massstab-Block sah nicht huebsch aus, die 4 runden Buttons saßen detached nebeneinander. Polish: alle 4 in einer durchgehenden Pill-Gruppe (analog View-Toggle), bg-input fuer inaktive, accent fuer aktiven Print- View-Toggle. Sieht jetzt visuell geschlossen aus. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+35
-10
@@ -558,30 +558,53 @@ export default function OberleisteApp() {
|
|||||||
<div style={sep} />
|
<div style={sep} />
|
||||||
|
|
||||||
{/* ====== MASSSTAB 2-Reihen ======
|
{/* ====== MASSSTAB 2-Reihen ======
|
||||||
Oben: Buttons (%, fit, center, print/edit)
|
Oben: Segmented-Pill mit 4 Tools (%, fit, center, print/edit)
|
||||||
Unten: Live-Zoom-Chip + Dropdown
|
Unten: Live-Zoom-Chip + Dropdown
|
||||||
*/}
|
*/}
|
||||||
|
{(() => {
|
||||||
|
// Segmented button — sitzt nahtlos in einer Pill mit den anderen
|
||||||
|
const SegBtn = ({ icon, onClick, title, disabled, active, isFirst, isLast }) => (
|
||||||
|
<button onClick={onClick} disabled={disabled} title={title}
|
||||||
|
style={{
|
||||||
|
height: BAR_H, width: 30,
|
||||||
|
background: active ? 'var(--accent)' : 'var(--bg-input)',
|
||||||
|
border: 'none',
|
||||||
|
borderLeft: isFirst ? 'none' : '1px solid var(--border)',
|
||||||
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
||||||
|
opacity: disabled ? 0.4 : 1, flexShrink: 0,
|
||||||
|
padding: 0,
|
||||||
|
}}>
|
||||||
|
<Icon name={icon} size={13}
|
||||||
|
style={{ color: active ? 'var(--bg-panel)' : 'var(--text-muted)' }} />
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex', flexDirection: 'column', gap: 4,
|
display: 'flex', flexDirection: 'column', gap: 4,
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
}}>
|
}}>
|
||||||
{/* Reihe 1: Buttons */}
|
{/* Reihe 1: Segmented Pill mit 4 Tools */}
|
||||||
<div style={{ display: 'flex', gap: 4, justifyContent: 'flex-start' }}>
|
<div style={{
|
||||||
<BarButton icon="percent" onClick={apply100}
|
display: 'inline-flex', alignSelf: 'flex-start',
|
||||||
|
border: '1px solid var(--border)', borderRadius: 999,
|
||||||
|
overflow: 'hidden', flexShrink: 0,
|
||||||
|
}}>
|
||||||
|
<SegBtn icon="percent" onClick={apply100} isFirst
|
||||||
disabled={isPerspective || !appliedScale}
|
disabled={isPerspective || !appliedScale}
|
||||||
title={appliedScale ? `Zoom auf 1:${appliedScale} snappen` : 'Erst einen Massstab wählen'} />
|
title={appliedScale ? `Zoom auf 1:${appliedScale} snappen` : 'Erst einen Massstab wählen'} />
|
||||||
<BarButton icon="fit_screen" onClick={zoomExtents}
|
<SegBtn icon="fit_screen" onClick={zoomExtents}
|
||||||
title="Auf gesamten Inhalt zoomen" />
|
title="Auf gesamten Inhalt zoomen" />
|
||||||
<BarButton icon="center_focus_strong" onClick={zoomSelection}
|
<SegBtn icon="center_focus_strong" onClick={zoomSelection}
|
||||||
title="Auf Selektion zoomen" />
|
title="Auf Selektion zoomen" />
|
||||||
<BarButton
|
<SegBtn
|
||||||
icon={state.showLineweights ? 'print' : 'edit'}
|
icon={state.showLineweights ? 'print' : 'edit'}
|
||||||
active={state.showLineweights}
|
active={state.showLineweights}
|
||||||
onClick={() => setShowLineweights(!state.showLineweights)}
|
onClick={() => setShowLineweights(!state.showLineweights)}
|
||||||
|
isLast
|
||||||
title={state.showLineweights
|
title={state.showLineweights
|
||||||
? 'Print-View aktiv — klick zum Ausschalten'
|
? 'Print-View aktiv — klick zum Ausschalten'
|
||||||
: 'Strichstärken anzeigen (Print-View)'}
|
: 'Strichstärken anzeigen (Print-View)'} />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
{/* Reihe 2: Live-Zoom + Dropdown */}
|
{/* Reihe 2: Live-Zoom + Dropdown */}
|
||||||
<div style={{ display: 'flex', gap: 4, alignItems: 'center' }}>
|
<div style={{ display: 'flex', gap: 4, alignItems: 'center' }}>
|
||||||
@@ -590,7 +613,7 @@ export default function OberleisteApp() {
|
|||||||
height: BAR_H, padding: '0 10px',
|
height: BAR_H, padding: '0 10px',
|
||||||
background: isPerspective ? 'var(--bg-input)' : 'var(--accent)',
|
background: isPerspective ? 'var(--bg-input)' : 'var(--accent)',
|
||||||
color: isPerspective ? 'var(--text-muted)' : 'var(--bg-panel)',
|
color: isPerspective ? 'var(--text-muted)' : 'var(--bg-panel)',
|
||||||
border: '1px solid var(--border-light)',
|
border: '1px solid var(--border)',
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
fontFamily: 'DM Mono, monospace', fontSize: 11, fontWeight: 600,
|
fontFamily: 'DM Mono, monospace', fontSize: 11, fontWeight: 600,
|
||||||
minWidth: 60, justifyContent: 'center', flexShrink: 0,
|
minWidth: 60, justifyContent: 'center', flexShrink: 0,
|
||||||
@@ -642,6 +665,8 @@ export default function OberleisteApp() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
|
})()}
|
||||||
|
|
||||||
{/* Snap-Toggles (Ortho/Grid/OSnap) sind in Rhinos eigener Footer-Bar
|
{/* Snap-Toggles (Ortho/Grid/OSnap) sind in Rhinos eigener Footer-Bar
|
||||||
schon vorhanden — hier rausgenommen um Doppelung zu vermeiden. */}
|
schon vorhanden — hier rausgenommen um Doppelung zu vermeiden. */}
|
||||||
|
|||||||
Reference in New Issue
Block a user