[meld/pathlabel] ui.pathlabel: Fix summarisation display with root parents
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/pathlabel] ui.pathlabel: Fix summarisation display with root parents
- Date: Wed, 13 Jan 2021 21:06:38 +0000 (UTC)
commit 8095e1c441354e05e356f18844ce762a40a01b67
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Jan 13 06:53:19 2021 +1000
ui.pathlabel: Fix summarisation display with root parents
meld/ui/pathlabel.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/meld/ui/pathlabel.py b/meld/ui/pathlabel.py
index 6cdcaf1f..301a0fb3 100644
--- a/meld/ui/pathlabel.py
+++ b/meld/ui/pathlabel.py
@@ -224,13 +224,15 @@ class PathLabel(Gtk.MenuButton):
elided_path = base_path_gfile.get_relative_path(
descendant_parent)
+ show_parent = not parent.has_parent()
label_segments = [
- '…' if base_path_str else None,
+ '…' if not show_parent else None,
base_path_str,
'…' if elided_path else None,
descendant.get_basename(),
]
- label_text = GLib.build_filenamev([s for s in label_segments if s])
+ label_text = parent.get_parse_name() if show_parent else ''
+ label_text += GLib.build_filenamev([s for s in label_segments if s])
self._path_label = label_text
self.notify('path_label')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]