]> uap-core.de Git - note.git/commitdiff
use AppStates enum directly instead of casting it to i32 main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 11 Aug 2026 19:50:42 +0000 (21:50 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 11 Aug 2026 19:50:42 +0000 (21:50 +0200)
application/note/src/main.rs
application/note/src/window.rs

index 14bbb7b8e4a60c36dc48f3b33832de668aacfdef..0ed09021658a47446192262d794da316e8557877 100644 (file)
@@ -187,6 +187,7 @@ fn create_toolbar(app: &AppContext<MainWindow>) {
 
 
 #[repr(i32)]
+#[derive(Copy, Clone, Debug)]
 pub enum AppStates {
     Null = 0,
     NoteEnableNew,
index 03b452b66e11b95fd6ef0a556aade726e8bf7892..7538daf88335cdbdab614dca9d7f34db440deca6 100644 (file)
@@ -272,12 +272,12 @@ pub fn create_window(app: &App, ctx: &AppContext<MainWindow>) -> UiObject<MainWi
                 tabview.tab("textnote", |obj| {
                     label!(obj, margin = 4, varname = "note_info", visibility_states = &[AppStates::NoteShowInfo as i32]);
 
-                    hbox!(obj, visibility_states = &[AppStates::NoteShowExtModInfo as i32], spacing = 4, |obj|{
+                    hbox!(obj, visibility_states = &[AppStates::NoteShowExtModInfo], spacing = 4, |obj|{
                         label!(obj, fill = true, label = "The note has been modified by an external program");
                         button!(obj, label = "Reload", action = "note_reload");
                         button!(obj, label = "Close", action = "note_extmod_close");
                     });
-                    hbox!(obj, visibility_states = &[AppStates::NoteTitleInput as i32], spacing = 4, margin = 4, |obj|{
+                    hbox!(obj, visibility_states = &[AppStates::NoteTitleInput], spacing = 4, margin = 4, |obj|{
                         label!(obj, label = "Title:");
                         textfield!(obj, fill = true, varname = "note_title", onchange_action = "note_title_changed");
                         button!(obj, label = "Close", action = "note_title_close");