Update to latest libcosmic/iced

This commit is contained in:
Ian Douglas Scott 2023-12-14 15:02:45 -08:00 committed by Victoria Brekenfeld
parent 9b98c20da2
commit e569e14a99
9 changed files with 640 additions and 552 deletions

View file

@ -66,8 +66,14 @@ where
self.elem.as_widget().height()
}
fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node {
let node = self.elem.as_widget().layout(renderer, limits);
fn layout(
&self,
state: &mut Tree,
renderer: &Renderer,
limits: &layout::Limits,
) -> layout::Node {
let state = &mut state.children[0];
let node = self.elem.as_widget().layout(state, renderer, limits);
layout::Node::with_children(node.size(), vec![node])
}

View file

@ -9,7 +9,7 @@ use std::{
use calloop::LoopHandle;
use cosmic::{
iced::Background,
iced_core::{alignment::Horizontal, Length, Rectangle as IcedRectangle},
iced_core::{alignment::Horizontal, Length, Pixels, Rectangle as IcedRectangle},
iced_widget::{self, horizontal_rule, text::Appearance as TextAppearance, Column, Row},
theme,
widget::{button, horizontal_space, icon::from_name, text},
@ -395,7 +395,7 @@ impl Program for ContextMenu {
if let Some(shortcut) = shortcut.as_ref() {
components.push(
text(shortcut)
.line_height(20.)
.line_height(Pixels(20.))
.size(14)
.horizontal_alignment(Horizontal::Right)
.width(Length::Shrink)