yoda: libcosmic-yoda dead-code purge (14→0 warnings)

Real bug fixes:
- spin_button::vertical(): was constructing the SpinButton with
  Orientation::Horizontal — vertical() rendered horizontally. Fixed
  to use Orientation::Vertical, which also resolves the
  'Vertical never constructed' warning.
- text_input/input.rs: rewrite the iterator-skip logic for trailing
  icon layout. The previous `let mut icon_layout = ...; if has_start
  ... = ...; ... = ...;` triggered two value-never-read warnings and
  obscured the intent. Now it reads as 'skip text, optionally skip
  start-icon, then take the trailing-icon layout'.

Dead code removed:
- core::Core::portal_is_high_contrast — assigned at construction,
  never read anywhere
- widget::menu::menu_bar::bar_pressed field and the
  pub fn get_mut_or_default helper — no callers
- widget::popover::State — declared, never constructed
- widget::segmented_button::widget::Focus.now — sibling of updated_at,
  never read
- widget::wayland::tooltip::widget::Variant — orphan enum (and the
  cargo fix follow-up dropped a now-unused Element import)
- widget::button::widget::Button::is_hovered method — trivial getter
  with no callers; the underlying `is_hovered` field is still used

Visibility / nits:
- segmented_button::widget::TabDragSource: gain pub(super) so the
  pub(super) field tab_drag stops exposing a more private type
- widget::menu::flex::resolve: #[allow(dead_code)] (170-line public
  helper, kept for future use)
- app/cosmic.rs: drop one unreachable arm in the surface-message match
- widget::dropdown::multi: drop unused Paragraph import

Leyoda 2026 – GPLv3
This commit is contained in:
Lionel DARNIS 2026-05-05 19:02:31 +02:00
parent a9492d764c
commit 84437e219b
11 changed files with 8 additions and 43 deletions

View file

@ -2794,11 +2794,11 @@ pub fn draw<'a, Message>(
// draw the end icon in the text input
if let (Some(icon), Some(tree)) = (trailing_icon, trailing_icon_tree) {
let mut children = text_layout.children();
let mut icon_layout = children.next().unwrap();
children.next().unwrap(); // skip text layout
if has_start_icon {
icon_layout = children.next().unwrap();
children.next().unwrap(); // skip start-icon layout
}
icon_layout = children.next().unwrap();
let icon_layout = children.next().unwrap(); // trailing-icon layout
icon.as_widget().draw(
tree,