use std::any::Any;
use ui_rs::{action, ui_actions, UiModel};
use ui_rs::ui::*;
-use crate::App;
+use crate::{App, AppStates};
use entity::collection::{Model as Collection, Node};
use crate::backend::{BackendHandle, BroadcastMessage, NoteId};
use crate::newnotebook::new_notebook_dialog;
init_window_data(data, app);
data.obj = obj.obj_ref();
-
+ obj.ctx.set_state(AppStates::NoteEnableNew as i32);
obj.sidebar_builder().create(|obj|{
obj.sourcelist(|b|{
.fill(true)
.getvalue(notelist_getvalue)
.onselection_action("note_selected")
+ .onactivate_action("note_activated")
.create();
});
ui_window_fullscreen(self.ptr, fullscreen as c_int);
}
}
-}
+
+ // split_window specific API
+
+ pub fn splitview_set_pos(&mut self, pos: u32) {
+ unsafe {
+ ui_splitview_window_set_pos(self.ptr, pos as c_int);
+ }
+ }
+
+ pub fn splitview_get_pos(&self) -> u32 {
+ unsafe {
+ ui_splitview_window_get_pos(self.ptr) as u32
+ }
+ }
+
+ pub fn splitview_set_visible(&mut self, pane: u32, visible: bool) {
+ unsafe {
+ ui_splitview_window_set_visible(self.ptr, pane as c_int, visible as c_int);
+ }
+ }
+ }
/* ---------------------------------- main windows ---------------------------------- */
obj
}
+pub fn splitview_window_set_default_pos(pos: u32) {
+ unsafe {
+ ui_splitview_window_set_default_pos(pos as c_int);
+ }
+}
+
+pub fn splitview_window_use_property(enable: bool) {
+ unsafe {
+ ui_splitview_window_use_property(enable as c_int);
+ }
+}
impl<T: UiModel + UiActions> AppContext<T> {
pub fn window<F>(&self, title: &str, data: T, create_ui: F) -> toolkit::UiObject<T>
fn ui_splitview_window(title: *const c_char, sidebar: c_int) -> *mut UiObject;
fn ui_simple_window(title: *const c_char) -> *mut UiObject;
+ fn ui_splitview_window_set_pos(obj: *mut ffi::UiObject, pos: c_int);
+ fn ui_splitview_window_get_pos(obj: *mut ffi::UiObject) -> c_int;
+ fn ui_splitview_window_set_default_pos(pos: c_int);
+ fn ui_splitview_window_use_property(enable: c_int);
+ fn ui_splitview_window_set_visible(obj: *mut ffi::UiObject, pane: c_int, visible: c_int);
+
fn ui_dialog_create(parent: *mut UiObject, args: *mut UiDialogArgs);
fn ui_dialog_window_create(parent: *mut UiObject, args: *mut UiDialogWindowArgs) -> *mut UiObject;