mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
Help: Make section books open and close when toggled
Much more satisfying!
This commit is contained in:
parent
cbf3c2caeb
commit
d86dbfe9e8
Notes:
sideshowbarker
2024-07-19 05:02:42 +09:00
Author: https://github.com/thankyouverycool
Commit: d86dbfe9e8
Pull-request: https://github.com/SerenityOS/serenity/pull/2726
6 changed files with 27 additions and 1 deletions
|
@ -147,6 +147,7 @@ int main(int argc, char* argv[])
|
|||
String path = model->page_path(tree_view.selection().first());
|
||||
if (path.is_null()) {
|
||||
page_view.set_document(nullptr);
|
||||
window->set_title("Help");
|
||||
return;
|
||||
}
|
||||
history.push(path);
|
||||
|
@ -154,6 +155,10 @@ int main(int argc, char* argv[])
|
|||
open_page(path);
|
||||
};
|
||||
|
||||
tree_view.on_toggle = [&](const GUI::ModelIndex& index, const bool open) {
|
||||
model->update_section_node_on_toggle(index, open);
|
||||
};
|
||||
|
||||
page_view.on_link_click = [&](auto& url, auto&, unsigned) {
|
||||
char* current_path = strdup(history.current().characters());
|
||||
char* path = realpath(url.path().characters(), nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue