use std::path::Path;
use backend::backend::BackendHandle;
use ui_rs::ui::*;
-use ui_rs::{action, button, imageviewer, tabview, ui_actions, webview, UiModel};
+use ui_rs::{action, button, imageviewer, tabview, togglebutton, ui_actions, webview, UiModel};
pub fn attachments_window_create(backend: BackendHandle, note_id: i32, selected_attachment: Option<i32>) {
let mut data = AttachmentsWindow::new(backend, note_id);
button!(obj, icon = UiIconSet::GoForward.as_str(), action = "go_forward");
button!(obj, icon = UiIconSet::SaveLocal.as_str(), action = "save_as");
});
+ hb.end(|obj|{
+ togglebutton!(obj, icon = UiIconSet::ViewFullscreen.as_str(), action = "view_fullscreen");
+
+ });
});
tabview!(obj, tabview_type = TabViewType::Invisible, varname = "attachment_view_type", fill = true, |tv|{
Some(())
}
+
+ #[action]
+ pub fn view_fullscreen(&mut self, event: &ActionEvent) {
+ let Some(obj) = self.obj.get_object() else {
+ return;
+ };
+ obj.enable_fullscreen(event.intval != 0);
+ }
}
return obj;
}
+
+void ui_window_fullscreen(UiObject *obj, UiBool fullscreen) {
+ if(fullscreen) {
+ gtk_window_fullscreen(GTK_WINDOW(obj->widget));
+ } else {
+ gtk_window_unfullscreen(GTK_WINDOW(obj->widget));
+ }
+}