Caret differentiated + Accent-Hover wie in Elemente
User: 1. Wireframe-Caret war fast draussen (zu weit rechts), bei anderen minimal mehr rechts erwartet 2. Hover-Effekt mit accent-border wie in Elemente fuer alle Pills Fix 1: backgroundPosition differenziert: - Ohne Gear: 'right 10px center' (normaler Pill-Rand-Abstand) - Mit Gear: 'right 1px center' (klebt am Gear) So sitzt der Caret optisch konsistent — bei Display innen, bei den anderen direkt vor dem Gear. Fix 2: Hover-Akzent analog ElementeApp PillButton: - BarCombo Pill-Container: bg → bg-item-hover, border → accent - BarButton (Camera, Settings-Gears in Pills, Print-Toggle): selbe Logik, active-State bleibt accent-fill - View-Toggle-Buttons: bg → bg-item-hover, text → accent-light, active bleibt accent-fill Transitions 0.15s fuer smooth feel. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+38
-5
@@ -160,13 +160,24 @@ function BarCombo({
|
|||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{/* Combined pill: select + optional gear, gemeinsamer bg + border */}
|
{/* Combined pill: select + optional gear, gemeinsamer bg + border */}
|
||||||
<div title={title} style={{
|
<div title={title}
|
||||||
|
onMouseEnter={(e) => {
|
||||||
|
if (disabled) return
|
||||||
|
e.currentTarget.style.borderColor = 'var(--accent)'
|
||||||
|
e.currentTarget.style.background = 'var(--bg-item-hover)'
|
||||||
|
}}
|
||||||
|
onMouseLeave={(e) => {
|
||||||
|
e.currentTarget.style.borderColor = 'var(--border)'
|
||||||
|
e.currentTarget.style.background = 'var(--bg-input)'
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
display: 'inline-flex', alignItems: 'stretch',
|
display: 'inline-flex', alignItems: 'stretch',
|
||||||
height: BAR_H, width,
|
height: BAR_H, width,
|
||||||
background: 'var(--bg-input)',
|
background: 'var(--bg-input)',
|
||||||
border: '1px solid var(--border)',
|
border: '1px solid var(--border)',
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
|
transition: 'border-color 0.15s, background 0.15s',
|
||||||
}}>
|
}}>
|
||||||
<select
|
<select
|
||||||
value={value || ''}
|
value={value || ''}
|
||||||
@@ -183,10 +194,10 @@ function BarCombo({
|
|||||||
appearance: 'none', WebkitAppearance: 'none',
|
appearance: 'none', WebkitAppearance: 'none',
|
||||||
backgroundImage: 'var(--select-arrow)',
|
backgroundImage: 'var(--select-arrow)',
|
||||||
backgroundRepeat: 'no-repeat',
|
backgroundRepeat: 'no-repeat',
|
||||||
// Caret klebt am rechten Rand des Select-Bereichs (= direkt
|
// Caret-Position differenziert: ohne Gear normaler Abstand
|
||||||
// links vom Gear). Mit Gear: symmetrische Abstaende
|
// (10px vom Pill-Rand), mit Gear minimaler Abstand damit
|
||||||
// caret-to-gear ≈ gear-to-pill-right-edge.
|
// er an den Gear ranruckt.
|
||||||
backgroundPosition: 'right 2px center',
|
backgroundPosition: onGear ? 'right 1px center' : 'right 10px center',
|
||||||
cursor: disabled ? 'not-allowed' : 'pointer',
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
||||||
letterSpacing: 0,
|
letterSpacing: 0,
|
||||||
}}
|
}}
|
||||||
@@ -213,6 +224,16 @@ function BarCombo({
|
|||||||
function BarButton({ icon, onClick, title, disabled, active, joinedLeft }) {
|
function BarButton({ icon, onClick, title, disabled, active, joinedLeft }) {
|
||||||
return (
|
return (
|
||||||
<button onClick={onClick} disabled={disabled} title={title}
|
<button onClick={onClick} disabled={disabled} title={title}
|
||||||
|
onMouseEnter={(e) => {
|
||||||
|
if (disabled || active) return
|
||||||
|
e.currentTarget.style.borderColor = 'var(--accent)'
|
||||||
|
e.currentTarget.style.background = 'var(--bg-item-hover)'
|
||||||
|
}}
|
||||||
|
onMouseLeave={(e) => {
|
||||||
|
if (active) return
|
||||||
|
e.currentTarget.style.borderColor = 'var(--border)'
|
||||||
|
e.currentTarget.style.background = 'var(--bg-input)'
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
height: BAR_H, width: BAR_H,
|
height: BAR_H, width: BAR_H,
|
||||||
background: active ? 'var(--accent)' : 'var(--bg-input)',
|
background: active ? 'var(--accent)' : 'var(--bg-input)',
|
||||||
@@ -225,6 +246,7 @@ function BarButton({ icon, onClick, title, disabled, active, joinedLeft }) {
|
|||||||
cursor: disabled ? 'not-allowed' : 'pointer',
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
||||||
opacity: disabled ? 0.5 : 1, flexShrink: 0,
|
opacity: disabled ? 0.5 : 1, flexShrink: 0,
|
||||||
padding: 0,
|
padding: 0,
|
||||||
|
transition: 'border-color 0.15s, background 0.15s',
|
||||||
}}>
|
}}>
|
||||||
<Icon name={icon} size={13}
|
<Icon name={icon} size={13}
|
||||||
style={{ color: active ? 'var(--bg-panel)' : 'var(--text-muted)' }} />
|
style={{ color: active ? 'var(--bg-panel)' : 'var(--text-muted)' }} />
|
||||||
@@ -422,6 +444,16 @@ export default function OberleisteApp() {
|
|||||||
key={v.value}
|
key={v.value}
|
||||||
onClick={() => setView(v.value)}
|
onClick={() => setView(v.value)}
|
||||||
title={`Ansicht ${v.label}`}
|
title={`Ansicht ${v.label}`}
|
||||||
|
onMouseEnter={(e) => {
|
||||||
|
if (isActive) return
|
||||||
|
e.currentTarget.style.background = 'var(--bg-item-hover)'
|
||||||
|
e.currentTarget.style.color = 'var(--accent-light)'
|
||||||
|
}}
|
||||||
|
onMouseLeave={(e) => {
|
||||||
|
if (isActive) return
|
||||||
|
e.currentTarget.style.background = 'var(--bg-input)'
|
||||||
|
e.currentTarget.style.color = 'var(--text-primary)'
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
height: BAR_H, padding: '0 10px',
|
height: BAR_H, padding: '0 10px',
|
||||||
background: isActive ? 'var(--accent)' : 'var(--bg-input)',
|
background: isActive ? 'var(--accent)' : 'var(--bg-input)',
|
||||||
@@ -435,6 +467,7 @@ export default function OberleisteApp() {
|
|||||||
display: 'inline-flex', alignItems: 'center', gap: 4,
|
display: 'inline-flex', alignItems: 'center', gap: 4,
|
||||||
fontSize: 10, fontWeight: isActive ? 600 : 500,
|
fontSize: 10, fontWeight: isActive ? 600 : 500,
|
||||||
cursor: 'pointer', flexShrink: 0,
|
cursor: 'pointer', flexShrink: 0,
|
||||||
|
transition: 'background 0.15s, color 0.15s',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon name={v.icon} size={13} />
|
<Icon name={v.icon} size={13} />
|
||||||
|
|||||||
Reference in New Issue
Block a user