From 1ec08b1dedff313e385767edb0c2b815b6dd56f3 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sat, 22 Aug 2026 22:08:47 +0800
Subject: [PATCH] fix: improve app note placeholder contrast
---
C1.source/Apptag/AppGridSupport.swift | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/C1.source/Apptag/AppGridSupport.swift b/C1.source/Apptag/AppGridSupport.swift
index 397a995..f48aa04 100644
--- a/C1.source/Apptag/AppGridSupport.swift
+++ b/C1.source/Apptag/AppGridSupport.swift
@@ -122,6 +122,9 @@
var isFocused: FocusState<Bool>.Binding
let onCommit: () -> Void
let onCancel: () -> Void
+ private static let placeholderAttributes: [NSAttributedString.Key: Any] = [
+ .foregroundColor: NSColor.white.withAlphaComponent(0.48)
+ ]
func makeCoordinator() -> Coordinator {
Coordinator(
@@ -140,7 +143,10 @@
field.focusRingType = .none
field.font = NSFont.systemFont(ofSize: 15, weight: .medium)
field.textColor = .white
- field.placeholderString = placeholder
+ field.placeholderAttributedString = NSAttributedString(
+ string: placeholder,
+ attributes: Self.placeholderAttributes
+ )
field.delegate = context.coordinator
field.target = context.coordinator
field.action = #selector(Coordinator.submitAction(_:))
@@ -158,7 +164,10 @@
context.coordinator.onCommit = onCommit
context.coordinator.onCancel = onCancel
context.coordinator.field = field
- field.placeholderString = placeholder
+ field.placeholderAttributedString = NSAttributedString(
+ string: placeholder,
+ attributes: Self.placeholderAttributes
+ )
field.setAccessibilityLabel(placeholder)
if !field.hasMarkedTextInput, field.stringValue != text {
--
Gitblit v1.9.3