button!(obj, label = "Close", action = "note_title_close");
});
hbox!(obj, visibility_states = &[AppStates::NoteHasAttachments], margin = 10, spacing = 4, |obj|{
- let mut w = scrolledwindow!(obj, |obj|{
+ let mut w = scrolledwindow!(obj, fill = true, |obj|{
obj.itemlist::<Attachment>()
.varname("note_attachments")
+ .container(SubContainer::HBox)
.createui(|obj, data, _i|{
let imgviewer = imageviewer!(obj,
scrollview = false,
if let Some(thumbnail) = &data.attachment.thumbnail {
imgviewer.load_data(thumbnail);
}
+
})
.create();
});
}
ui_hbox_w(obj, wdata->attachments, .margin = 10, .visibility_states = UI_STATES(APP_STATE_NOTE_HAS_ATTACHMENTS)) {
UIWIDGET sw;
- ui_scrolledwindow_w(obj, sw, .name = "note_attachments_sw") {
+ ui_scrolledwindow_w(obj, sw, .fill = true, .name = "note_attachments_sw") {
ui_itemlist(obj, .varname = "note_attachments", .container = UI_CONTAINER_HBOX, .create_ui = attachment_item, .userdata = wdata);
}
ui_widget_set_size(sw, -1, 120);
self
}
+ pub fn container(&mut self, cttype: SubContainer) -> &mut Self {
+ unsafe {
+ ui_itemlist_container_args_set_container(self.args, cttype as c_int);
+ }
+ self
+ }
+
pub fn subcontainer_type(&mut self, subtype: SubContainer) -> &mut Self {
unsafe {
ui_itemlist_container_args_set_subcontainer(self.args, subtype as c_int);