BarSelect/BarButton: bare native chrome auch im Ruhezustand
User-Wunsch: nicht nur das Popup, auch das Feld selber soll system-nativ aussehen. Vorher hatten die <select>-Elemente noch pill-Background + Border + Radius — das uebermalte WebKits Native-Look. BarSelect: alle Styling-Overrides entfernt (background/border/border-radius weg). Nur Hoehe/Breite/Font/colorScheme bleibt — macOS rendert jetzt das gewoelbte System-Combobox-Feld inkl. nativem Drop-Caret. BarButton: analog umgestellt — kein eigener Container, native <button>- Chrome. active-State via accent-color (CSS) + Icon-Tint. Custom-Mode-Massstab-Input (1:N): pill-Styling weg, nativer <input>. joinedRight/joinedLeft Props bleiben akzeptiert aber sind no-ops — native Felder lassen sich nicht visuell verketten. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+24
-35
@@ -84,13 +84,14 @@ const pillSelect = {
|
|||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
// BarSelect: Icon roh links + System-natives <select>. Kein appearance:none,
|
// BarSelect: Icon roh links + komplett system-natives <select>.
|
||||||
// kein eigener Caret — WebKit/macOS rendert sein eigenes Drop-Caret und
|
// Kein Background, kein Border, kein Border-Radius — WebKit/macOS rendert
|
||||||
// oeffnet das Popup-Menue im OS-Style (wie Vectorworks).
|
// seinen eigenen Combobox-Look auch im Ruhezustand (gewölbtes Feld mit
|
||||||
|
// Caret-Indikator rechts). `colorScheme: dark` triggert die Dark-Variante.
|
||||||
//
|
//
|
||||||
// `colorScheme: 'dark'` triggert die macOS-Dark-Mode-Variante des nativen
|
// joinedRight bleibt als Prop drin aber als no-op — native Felder koennen
|
||||||
// Controls. joinedRight bleibt erhalten fuer Verkettung mit BarButton.
|
// nicht visuell mit unseren Custom-Buttons verkettet werden.
|
||||||
function BarSelect({ icon, value, onChange, title, disabled, width, children, joinedRight }) {
|
function BarSelect({ icon, value, onChange, title, disabled, width, children }) {
|
||||||
return (
|
return (
|
||||||
<div title={title} style={{
|
<div title={title} style={{
|
||||||
display: 'inline-flex', alignItems: 'center', gap: 5,
|
display: 'inline-flex', alignItems: 'center', gap: 5,
|
||||||
@@ -106,43 +107,34 @@ function BarSelect({ icon, value, onChange, title, disabled, width, children, jo
|
|||||||
onChange={(e) => onChange(e.target.value)}
|
onChange={(e) => onChange(e.target.value)}
|
||||||
style={{
|
style={{
|
||||||
height: BAR_H, width,
|
height: BAR_H, width,
|
||||||
fontSize: 11, color: 'var(--text-primary)',
|
fontSize: 11,
|
||||||
background: 'var(--bg-input)',
|
|
||||||
border: '1px solid var(--border-light)',
|
|
||||||
borderTopLeftRadius: 999, borderBottomLeftRadius: 999,
|
|
||||||
borderTopRightRadius: joinedRight ? 0 : 999,
|
|
||||||
borderBottomRightRadius: joinedRight ? 0 : 999,
|
|
||||||
borderRight: joinedRight ? 'none' : '1px solid var(--border-light)',
|
|
||||||
padding: '0 8px 0 10px',
|
|
||||||
colorScheme: 'dark',
|
colorScheme: 'dark',
|
||||||
cursor: disabled ? 'not-allowed' : 'pointer',
|
flexShrink: 0,
|
||||||
outline: 'none', flexShrink: 0,
|
|
||||||
}}
|
}}
|
||||||
>{children}</select>
|
>{children}</select>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BarButton: pill-foermiger Icon-Button. joinedLeft = linke Kante flach,
|
// BarButton: ebenfalls system-nativer Look — bare <button> mit Default-
|
||||||
// so dass er nahtlos an einen BarSelect-joinedRight andockt.
|
// Chrome, kein eigener Background/Border. macOS rendert sein Push-Button
|
||||||
function BarButton({ icon, onClick, title, disabled, joinedLeft, active }) {
|
// Styling. `active` setzt die accent-Farbe via accent-color (CSS).
|
||||||
|
function BarButton({ icon, onClick, title, disabled, active }) {
|
||||||
return (
|
return (
|
||||||
<button onClick={onClick} disabled={disabled} title={title}
|
<button onClick={onClick} disabled={disabled} title={title}
|
||||||
style={{
|
style={{
|
||||||
height: BAR_H, width: BAR_H,
|
height: BAR_H, minWidth: BAR_H,
|
||||||
background: active ? 'var(--accent)' : 'var(--bg-input)',
|
padding: '0 6px',
|
||||||
border: '1px solid var(--border-light)',
|
fontSize: 11,
|
||||||
borderTopLeftRadius: joinedLeft ? 0 : 999,
|
colorScheme: 'dark',
|
||||||
borderBottomLeftRadius: joinedLeft ? 0 : 999,
|
accentColor: active ? 'var(--accent)' : undefined,
|
||||||
borderTopRightRadius: 999, borderBottomRightRadius: 999,
|
flexShrink: 0,
|
||||||
borderLeft: joinedLeft ? 'none' : '1px solid var(--border-light)',
|
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
||||||
cursor: disabled ? 'not-allowed' : 'pointer',
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
||||||
opacity: disabled ? 0.5 : 1, flexShrink: 0,
|
opacity: disabled ? 0.5 : 1,
|
||||||
padding: 0,
|
|
||||||
}}>
|
}}>
|
||||||
<Icon name={icon} size={13}
|
<Icon name={icon} size={13}
|
||||||
style={{ color: active ? 'var(--bg-panel)' : 'var(--text-muted)' }} />
|
style={{ color: active ? 'var(--accent)' : undefined,
|
||||||
|
verticalAlign: 'middle' }} />
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -419,12 +411,9 @@ export default function OberleisteApp() {
|
|||||||
onBlur={applyDraft}
|
onBlur={applyDraft}
|
||||||
style={{
|
style={{
|
||||||
height: BAR_H, width: 100,
|
height: BAR_H, width: 100,
|
||||||
background: 'var(--bg-input)',
|
fontSize: 11,
|
||||||
border: '1px solid var(--border-light)',
|
|
||||||
borderRadius: 999,
|
|
||||||
padding: '0 12px', fontSize: 11,
|
|
||||||
fontFamily: 'DM Mono, monospace',
|
fontFamily: 'DM Mono, monospace',
|
||||||
color: 'var(--text-primary)', outline: 'none',
|
colorScheme: 'dark',
|
||||||
}}
|
}}
|
||||||
title="Massstab eingeben (Enter = uebernehmen, Esc = abbrechen)"
|
title="Massstab eingeben (Enter = uebernehmen, Esc = abbrechen)"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user