mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
fix bookmark indicator setup
This commit is contained in:
parent
73c35d25d8
commit
48b70a263f
1 changed files with 20 additions and 14 deletions
|
|
@ -67,28 +67,34 @@ impl Suggestion {
|
||||||
.factory(&{
|
.factory(&{
|
||||||
let f = SignalListItemFactory::new();
|
let f = SignalListItemFactory::new();
|
||||||
f.connect_setup(|_, this| {
|
f.connect_setup(|_, this| {
|
||||||
this.downcast_ref::<ListItem>().unwrap().set_child(Some(
|
let r = ActionRow::builder()
|
||||||
&ActionRow::builder()
|
.use_markup(true)
|
||||||
.use_markup(true)
|
.use_underline(true)
|
||||||
.use_underline(true)
|
.build();
|
||||||
|
r.add_suffix(
|
||||||
|
>k::Image::builder()
|
||||||
|
.icon_name("starred-symbolic")
|
||||||
|
.margin_end(4)
|
||||||
|
.pixel_size(11)
|
||||||
|
.visible(false)
|
||||||
.build(),
|
.build(),
|
||||||
))
|
);
|
||||||
|
this.downcast_ref::<ListItem>().unwrap().set_child(Some(&r))
|
||||||
});
|
});
|
||||||
f.connect_bind(|_, this| {
|
f.connect_bind(|_, this| {
|
||||||
|
use gtk::prelude::ListBoxRowExt;
|
||||||
let l = this.downcast_ref::<ListItem>().unwrap();
|
let l = this.downcast_ref::<ListItem>().unwrap();
|
||||||
let i = l.item().and_downcast::<Item>().unwrap();
|
let i = l.item().and_downcast::<Item>().unwrap();
|
||||||
let r = l.child().and_downcast::<ActionRow>().unwrap();
|
let r = l.child().and_downcast::<ActionRow>().unwrap();
|
||||||
r.set_title(&i.title());
|
r.set_title(&i.title());
|
||||||
r.set_subtitle(&i.subtitle());
|
r.set_subtitle(&i.subtitle());
|
||||||
if i.has_bookmark() {
|
r.child()
|
||||||
r.add_suffix(
|
.unwrap()
|
||||||
>k::Image::builder()
|
.last_child()
|
||||||
.icon_name("starred-symbolic")
|
.unwrap()
|
||||||
.margin_end(4)
|
.last_child()
|
||||||
.pixel_size(11)
|
.unwrap()
|
||||||
.build(),
|
.set_visible(i.has_bookmark());
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
f
|
f
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue