fix: 送出/停止按鈕跟著「聊天的顏色」——安靜和只用黑色時是墨色,只有「跟著 Bot」才用 Bot 的顏色

This commit is contained in:
王性驊 2026-11-16 23:05:07 +08:00
parent ea8fccd9a4
commit fe222507f4
1 changed files with 3 additions and 1 deletions

View File

@ -4203,7 +4203,9 @@ impl App {
let has_text = !draft.trim().is_empty() || self.has_pending_attachments(bot.id); let has_text = !draft.trim().is_empty() || self.has_pending_attachments(bot.id);
let call = self.call_state(); let call = self.call_state();
let in_call = call.map(|c| c.0 == bot.id).unwrap_or(false); let in_call = call.map(|c| c.0 == bot.id).unwrap_or(false);
let colour = self.bot_color(bot); // The send / stop button follows 聊天的顏色 like the bubbles: the bot's
// colour only under 「跟著 Bot」; ink otherwise (安靜, 只用黑色).
let colour = if self.state.accent == Accent::BotColor { self.bot_color(bot) } else { p.primary };
let colour = if colour.r() as u32 + colour.g() as u32 + colour.b() as u32 <= 0x30 * 3 { p.primary } else { colour }; let colour = if colour.r() as u32 + colour.g() as u32 + colour.b() as u32 <= 0x30 * 3 { p.primary } else { colour };
let ink = if colour == p.primary { p.on_primary } else { Color32::WHITE }; let ink = if colour == p.primary { p.on_primary } else { Color32::WHITE };
if has_text { if has_text {