From 6e736627912be0873cd3001b180040761a75184a Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 16 Sep 2024 15:37:08 -0500 Subject: [PATCH] Fix description destroy --- .pre-commit-config.yaml | 9 --------- src/Layouts/ItemSidebarView.vala | 15 ++++++--------- src/MainWindow.vala | 2 +- 3 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 605b438cd..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,9 +0,0 @@ -repos: - - repo: https://github.com/vala-lang/vala-lint - rev: 4ed1443c35a8a84445fb59292d539358365d8263 - hooks: - - id: vala-lint - language: docker_image - entry: --entrypoint /usr/bin/io.elementary.vala-lint valalang/lint:latest --fix - description: Check Vala code files for code-style errors. - files: \.vala$ diff --git a/src/Layouts/ItemSidebarView.vala b/src/Layouts/ItemSidebarView.vala index 3d798236c..abf26a583 100644 --- a/src/Layouts/ItemSidebarView.vala +++ b/src/Layouts/ItemSidebarView.vala @@ -290,7 +290,9 @@ public class Layouts.ItemSidebarView : Adw.Bin { } public void present_item (Objects.Item _item) { - disconnect_all (); + if (Services.Settings.get_default ().settings.get_boolean ("always-show-details-sidebar")) { + disconnect_all (); + } item = _item; update_id = Util.get_default ().generate_id (); @@ -363,9 +365,7 @@ public class Layouts.ItemSidebarView : Adw.Bin { subitems.disconnect_all (); attachments.disconnect_all (); - if (!Services.Settings.get_default ().settings.get_boolean ("always-show-details-sidebar")) { - destroy_markdown_edit_view (); - } + destroy_markdown_edit_view (); } public void update_request () { @@ -660,10 +660,7 @@ public class Layouts.ItemSidebarView : Adw.Bin { private void destroy_markdown_edit_view () { markdown_revealer.reveal_child = false; - Timeout.add (markdown_revealer.transition_duration, () => { - markdown_revealer.child = null; - markdown_edit_view = null; - return GLib.Source.REMOVE; - }); + markdown_revealer.child = null; + markdown_edit_view = null; } } diff --git a/src/MainWindow.vala b/src/MainWindow.vala index b9782c577..b1c3f43ed 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -107,7 +107,7 @@ public class MainWindow : Adw.ApplicationWindow { item_sidebar_view.add_css_class ("sidebar"); } - var views_split_view = new Adw.OverlaySplitView () { + var views_split_view = new Adw.OverlaySplitView () { sidebar_position = Gtk.PackType.END, collapsed = !Services.Settings.get_default ().settings.get_boolean ("always-show-details-sidebar"), max_sidebar_width = 375,