fix: more text widgets unicode-capable now

This commit is contained in:
2026-04-04 22:17:19 +02:00
parent 5239c7bee3
commit bf8d6a376c
7 changed files with 33 additions and 19 deletions

View File

@@ -151,7 +151,7 @@ Rules:
### `bds-ui/views` ### `bds-ui/views`
- sidebar post filtering: text search box, status filter, tag/category filter dropdown — wired to existing `search_posts_filtered()` engine. The 500 post limit applies after filtering. - sidebar post filtering: text search box, status filter, tag/category filter dropdowns, language filter, year/month selectors, date range picker — wired to existing `PostSearchFilters` / `search_posts_filtered()` in bds-core. The 500 post limit applies AFTER filtering, not before.
- dashboard - dashboard
- post editor (bds-editor with markdown + YAML frontmatter highlighting) - post editor (bds-editor with markdown + YAML frontmatter highlighting)
- translation editor (bds-editor) - translation editor (bds-editor)

View File

@@ -1,4 +1,5 @@
use iced::widget::{button, column, container, row, scrollable, text, Space}; use iced::widget::{button, column, container, row, scrollable, text, Space};
use iced::widget::text::Shaping;
use iced::{Alignment, Background, Border, Color, Element, Length, Theme}; use iced::{Alignment, Background, Border, Color, Element, Length, Theme};
use bds_core::i18n::UiLocale; use bds_core::i18n::UiLocale;
@@ -70,17 +71,17 @@ pub fn view(
let muted = Color::from_rgb(0.50, 0.50, 0.55); let muted = Color::from_rgb(0.50, 0.50, 0.55);
// Tab header // Tab header
let tasks_btn = button(text(t(locale, "common.tasks")).size(12)) let tasks_btn = button(text(t(locale, "common.tasks")).size(12).shaping(Shaping::Advanced))
.on_press(Message::SetPanelTab(PanelTab::Tasks)) .on_press(Message::SetPanelTab(PanelTab::Tasks))
.padding([4, 8]) .padding([4, 8])
.style(if panel_tab == PanelTab::Tasks { tab_active } else { tab_inactive }); .style(if panel_tab == PanelTab::Tasks { tab_active } else { tab_inactive });
let output_btn = button(text(t(locale, "panel.output")).size(12)) let output_btn = button(text(t(locale, "panel.output")).size(12).shaping(Shaping::Advanced))
.on_press(Message::SetPanelTab(PanelTab::Output)) .on_press(Message::SetPanelTab(PanelTab::Output))
.padding([4, 8]) .padding([4, 8])
.style(if panel_tab == PanelTab::Output { tab_active } else { tab_inactive }); .style(if panel_tab == PanelTab::Output { tab_active } else { tab_inactive });
let close_btn = button(text("\u{2715}").size(12)) let close_btn = button(text("\u{2715}").size(12).shaping(Shaping::Advanced))
.on_press(Message::TogglePanel) .on_press(Message::TogglePanel)
.padding([4, 6]) .padding([4, 6])
.style(close_btn_style); .style(close_btn_style);
@@ -99,7 +100,7 @@ pub fn view(
let content: Element<'static, Message> = match panel_tab { let content: Element<'static, Message> = match panel_tab {
PanelTab::Tasks => { PanelTab::Tasks => {
if task_snapshots.is_empty() { if task_snapshots.is_empty() {
container(text(t(locale, "tasks.noActive")).size(12).color(muted)) container(text(t(locale, "tasks.noActive")).size(12).shaping(Shaping::Advanced).color(muted))
.padding(8) .padding(8)
.into() .into()
} else { } else {
@@ -120,7 +121,7 @@ pub fn view(
progress_str, progress_str,
phase_str, phase_str,
); );
text(status_text).size(11).color(Color::from_rgb(0.70, 0.70, 0.75)).into() text(status_text).size(11).shaping(Shaping::Advanced).color(Color::from_rgb(0.70, 0.70, 0.75)).into()
}) })
.collect(); .collect();
scrollable( scrollable(
@@ -133,7 +134,7 @@ pub fn view(
} }
PanelTab::Output => { PanelTab::Output => {
if output_entries.is_empty() { if output_entries.is_empty() {
container(text(t(locale, "panel.noOutput")).size(12).color(muted)) container(text(t(locale, "panel.noOutput")).size(12).shaping(Shaping::Advanced).color(muted))
.padding(8) .padding(8)
.into() .into()
} else { } else {
@@ -142,6 +143,7 @@ pub fn view(
.map(|entry| { .map(|entry| {
text(entry.text.clone()) text(entry.text.clone())
.size(11) .size(11)
.shaping(Shaping::Advanced)
.color(Color::from_rgb(0.70, 0.70, 0.75)) .color(Color::from_rgb(0.70, 0.70, 0.75))
.into() .into()
}) })

View File

@@ -1,4 +1,5 @@
use iced::widget::{button, container, row, svg, text, Column, Space}; use iced::widget::{button, container, row, svg, text, Column, Space};
use iced::widget::text::Shaping;
use iced::{Background, Border, Color, Element, Length, Theme}; use iced::{Background, Border, Color, Element, Length, Theme};
use bds_core::i18n::UiLocale; use bds_core::i18n::UiLocale;
@@ -103,6 +104,7 @@ pub fn view(
let header = container( let header = container(
text(t(locale, "projectSelector.projectsHeader")) text(t(locale, "projectSelector.projectsHeader"))
.size(11) .size(11)
.shaping(Shaping::Advanced)
.color(Color::from_rgb(0.55, 0.55, 0.60)), .color(Color::from_rgb(0.55, 0.55, 0.60)),
) )
.padding([4, 8]) .padding([4, 8])
@@ -118,14 +120,14 @@ pub fn view(
let label = if is_active { let label = if is_active {
row![ row![
text("\u{2713}").size(12).color(Color::from_rgb(0.40, 0.80, 0.40)), text("\u{2713}").size(12).shaping(Shaping::Advanced).color(Color::from_rgb(0.40, 0.80, 0.40)),
text(name).size(12).color(Color::WHITE), text(name).size(12).shaping(Shaping::Advanced).color(Color::WHITE),
] ]
.spacing(6) .spacing(6)
} else { } else {
row![ row![
Space::with_width(Length::Fixed(14.0)), Space::with_width(Length::Fixed(14.0)),
text(name).size(12).color(Color::from_rgb(0.80, 0.80, 0.85)), text(name).size(12).shaping(Shaping::Advanced).color(Color::from_rgb(0.80, 0.80, 0.85)),
] ]
.spacing(6) .spacing(6)
}; };
@@ -157,8 +159,8 @@ pub fn view(
items.push( items.push(
button( button(
row![ row![
text("+").size(14).color(Color::from_rgb(0.55, 0.75, 0.95)), text("+").size(14).shaping(Shaping::Advanced).color(Color::from_rgb(0.55, 0.75, 0.95)),
text(t(locale, "projectSelector.newProject")).size(12), text(t(locale, "projectSelector.newProject")).size(12).shaping(Shaping::Advanced),
] ]
.spacing(6), .spacing(6),
) )
@@ -208,10 +210,12 @@ pub fn trigger_button(project_name: &str) -> Element<'static, Message> {
let name = text(project_name.to_string()) let name = text(project_name.to_string())
.size(12) .size(12)
.shaping(Shaping::Advanced)
.color(Color::from_rgb(0.80, 0.80, 0.85)); .color(Color::from_rgb(0.80, 0.80, 0.85));
let chevron = text("\u{25BE}") let chevron = text("\u{25BE}")
.size(10) .size(10)
.shaping(Shaping::Advanced)
.color(Color::from_rgb(0.55, 0.55, 0.60)); .color(Color::from_rgb(0.55, 0.55, 0.60));
button( button(

View File

@@ -1,4 +1,5 @@
use iced::widget::{button, column, container, scrollable, text, Space}; use iced::widget::{button, column, container, scrollable, text, Space};
use iced::widget::text::Shaping;
use iced::{Background, Border, Color, Element, Length, Theme}; use iced::{Background, Border, Color, Element, Length, Theme};
use bds_core::i18n::UiLocale; use bds_core::i18n::UiLocale;
@@ -62,6 +63,7 @@ pub fn view(
let header = text(header_text) let header = text(header_text)
.size(13) .size(13)
.shaping(Shaping::Advanced)
.color(Color::from_rgb(0.85, 0.85, 0.90)); .color(Color::from_rgb(0.85, 0.85, 0.90));
let body: Element<'static, Message> = match sidebar_view { let body: Element<'static, Message> = match sidebar_view {
@@ -69,6 +71,7 @@ pub fn view(
if posts.is_empty() { if posts.is_empty() {
text(t(locale, placeholder_key(sidebar_view))) text(t(locale, placeholder_key(sidebar_view)))
.size(12) .size(12)
.shaping(Shaping::Advanced)
.color(muted) .color(muted)
.into() .into()
} else { } else {
@@ -81,7 +84,7 @@ pub fn view(
bds_core::model::PostStatus::Archived => "\u{25A1} ", // □ bds_core::model::PostStatus::Archived => "\u{25A1} ", // □
}; };
let label = format!("{status_indicator}{}", p.title); let label = format!("{status_indicator}{}", p.title);
button(text(label).size(12)) button(text(label).size(12).shaping(Shaping::Advanced))
.on_press(Message::OpenTab(Tab { .on_press(Message::OpenTab(Tab {
id: p.id.clone(), id: p.id.clone(),
tab_type: TabType::Post, tab_type: TabType::Post,
@@ -102,6 +105,7 @@ pub fn view(
_ => { _ => {
text(t(locale, placeholder_key(sidebar_view))) text(t(locale, placeholder_key(sidebar_view)))
.size(12) .size(12)
.shaping(Shaping::Advanced)
.color(muted) .color(muted)
.into() .into()
} }

View File

@@ -146,7 +146,7 @@ pub fn view(
} else { } else {
format!("{phase_str}{progress_str}{extra}") format!("{phase_str}{progress_str}{extra}")
}; };
text(display).size(11).color(label_color).into() text(display).size(11).shaping(Shaping::Advanced).color(label_color).into()
} else { } else {
Space::with_width(0).into() Space::with_width(0).into()
}; };
@@ -180,11 +180,11 @@ pub fn view(
.style(dropdown_trigger); .style(dropdown_trigger);
let right = row![ let right = row![
text(posts_label).size(11).color(label_color), text(posts_label).size(11).shaping(Shaping::Advanced).color(label_color),
text(media_label).size(11).color(label_color), text(media_label).size(11).shaping(Shaping::Advanced).color(label_color),
airplane_btn, airplane_btn,
locale_trigger, locale_trigger,
text("bDS").size(11).color(Color::from_rgb(0.45, 0.45, 0.50)), text("bDS").size(11).shaping(Shaping::Advanced).color(Color::from_rgb(0.45, 0.45, 0.50)),
] ]
.spacing(8) .spacing(8)
.align_y(Alignment::Center); .align_y(Alignment::Center);

View File

@@ -1,4 +1,5 @@
use iced::widget::{button, container, row, text, Space}; use iced::widget::{button, container, row, text, Space};
use iced::widget::text::Shaping;
use iced::{Background, Border, Color, Element, Length, Theme}; use iced::{Background, Border, Color, Element, Length, Theme};
use crate::app::Message; use crate::app::Message;
@@ -88,8 +89,8 @@ pub fn view(
let close_id = tab.id.clone(); let close_id = tab.id.clone();
let label = row![ let label = row![
text(title_text).size(12), text(title_text).size(12).shaping(Shaping::Advanced),
button(text("\u{2715}").size(10)) button(text("\u{2715}").size(10).shaping(Shaping::Advanced))
.on_press(Message::CloseTab(close_id)) .on_press(Message::CloseTab(close_id))
.padding(2) .padding(2)
.style(close_style), .style(close_style),

View File

@@ -1,4 +1,5 @@
use iced::widget::{column, container, text}; use iced::widget::{column, container, text};
use iced::widget::text::Shaping;
use iced::{Background, Color, Element, Length, Theme}; use iced::{Background, Color, Element, Length, Theme};
use bds_core::i18n::UiLocale; use bds_core::i18n::UiLocale;
@@ -14,9 +15,11 @@ pub fn view(locale: UiLocale) -> Element<'static, Message> {
column![ column![
text(title) text(title)
.size(28) .size(28)
.shaping(Shaping::Advanced)
.color(Color::from_rgb(0.85, 0.85, 0.90)), .color(Color::from_rgb(0.85, 0.85, 0.90)),
text(subtitle) text(subtitle)
.size(14) .size(14)
.shaping(Shaping::Advanced)
.color(Color::from_rgb(0.55, 0.55, 0.60)), .color(Color::from_rgb(0.55, 0.55, 0.60)),
] ]
.spacing(12) .spacing(12)