diff --git a/src/reader.rs b/src/reader.rs index 3f2a5b4..8ea9501 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -324,6 +324,9 @@ pub fn reading_view( if ui.button("← 返回").on_hover_text("返回书架").clicked() { action.go_back = true; } + if ui.button("☰").on_hover_text("打开/关闭目录").clicked() { + *sidebar_open = !*sidebar_open; + } ui.separator(); ui.label(format!("《{}》", &book.title)); ui.label(format!("[{}]", book.layout.label())); @@ -390,9 +393,6 @@ pub fn reading_view( } }); } - if ui.button("☰").on_hover_text("打开/关闭目录").clicked() { - *sidebar_open = !*sidebar_open; - } }); }); });