refactor(editor): sink MCP + System settings cards to jian Card
agent_settings_mcp client-config card (card fill, r8) + agent_settings_system auto-update card (muted fill, r10) now route their chrome through jian Card, looks preserved. Three agent-settings cards now share the canonical primitive.
This commit is contained in:
parent
2d9ccce73a
commit
07e1101eb0
|
|
@ -6,9 +6,11 @@ use crate::widgets::agent_settings_i18n::t as t_settings;
|
|||
use crate::widgets::agent_settings_switch::{
|
||||
paint_settings_switch, SETTINGS_SWITCH_H, SETTINGS_SWITCH_W,
|
||||
};
|
||||
use crate::widgets::button::tokens_from_theme;
|
||||
use crate::widgets::icons::{draw_icon, Icon};
|
||||
use crate::widgets::PaintCx;
|
||||
use crate::{Color, Point2D, Rect, TextLayout};
|
||||
use jian_widgets::components::card::Card;
|
||||
use op_editor_core::agent_settings::{AgentSettings, McpCli, SettingsFocus};
|
||||
use op_editor_core::editor_ui_state::EditorUiState;
|
||||
use op_editor_core::{AgentSettingsButton, ButtonPressTarget};
|
||||
|
|
@ -381,8 +383,12 @@ fn paint_client_config(
|
|||
return;
|
||||
}
|
||||
let rect = client_config_rect(content);
|
||||
cx.backend.fill_round_rect(rect, 8.0, theme.card);
|
||||
cx.backend.stroke_round_rect(rect, 8.0, theme.border, 1.0);
|
||||
Card {
|
||||
fill: Some(theme.card),
|
||||
border: Some(theme.border),
|
||||
radius: 8.0,
|
||||
}
|
||||
.paint(cx.backend, rect, &tokens_from_theme(theme));
|
||||
let title = TextLayout::single_run(
|
||||
t_settings(ui, "agents.mcpClientConfig"),
|
||||
"system-ui",
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ use crate::widgets::agent_settings_i18n::t as t_settings;
|
|||
use crate::widgets::agent_settings_switch::{
|
||||
paint_settings_switch, SETTINGS_SWITCH_H, SETTINGS_SWITCH_W,
|
||||
};
|
||||
use crate::widgets::button::tokens_from_theme;
|
||||
use crate::widgets::PaintCx;
|
||||
use crate::{Point2D, Rect, TextLayout};
|
||||
use jian_widgets::components::card::Card;
|
||||
use op_editor_core::agent_settings::AgentSettings;
|
||||
use op_editor_core::editor_ui_state::EditorUiState;
|
||||
|
||||
|
|
@ -117,8 +119,12 @@ fn paint_toggle_card(
|
|||
desc_key: &'static str,
|
||||
enabled: bool,
|
||||
) {
|
||||
cx.backend.fill_round_rect(card, 10.0, theme.muted);
|
||||
cx.backend.stroke_round_rect(card, 10.0, theme.border, 1.0);
|
||||
Card {
|
||||
fill: Some(theme.muted),
|
||||
border: Some(theme.border),
|
||||
radius: 10.0,
|
||||
}
|
||||
.paint(cx.backend, card, &tokens_from_theme(theme));
|
||||
|
||||
let label_layout = TextLayout::single_run(
|
||||
t_settings(ui, label_key),
|
||||
|
|
|
|||
Loading…
Reference in a new issue