summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjapm48 <japm48@users.noreply.github.com>2020-04-02 23:33:37 +0200
committermormj <34754695+mormj@users.noreply.github.com>2020-04-03 14:32:28 -0400
commit16a80b2815c9adff636d36836eb3d4df13fd97eb (patch)
treea93f958cbb34b6c3f2a7a040efa028f0e0eb52b8
parent85a2e0ec362fcc862bfdab898d6bdbd4200431bb (diff)
grc: show file path as tooltip in tab label
Fixes #3294.
-rw-r--r--grc/gui/MainWindow.py4
-rw-r--r--grc/gui/Notebook.py9
2 files changed, 13 insertions, 0 deletions
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index 2d8de8cd08..3499a55050 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -361,6 +361,10 @@ class MainWindow(Gtk.ApplicationWindow):
foreground='black' if page.saved else 'red', ro=' (ro)' if page.get_read_only() else '',
title=Utils.encode(file_name or NEW_FLOGRAPH_TITLE),
))
+ fpath = page.file_path
+ if not fpath:
+ fpath = '(unsaved)'
+ page.set_tooltip(fpath)
# show/hide notebook tabs
self.notebook.set_show_tabs(len(self.get_pages()) > 1)
diff --git a/grc/gui/Notebook.py b/grc/gui/Notebook.py
index 77f85fd5f2..8698e9334b 100644
--- a/grc/gui/Notebook.py
+++ b/grc/gui/Notebook.py
@@ -162,6 +162,15 @@ class Page(Gtk.HBox):
"""
self.label.set_markup(markup)
+ def set_tooltip(self, text):
+ """
+ Set the tooltip text in this label.
+
+ Args:
+ text: the new tooltip text
+ """
+ self.label.set_tooltip_text(text)
+
def get_read_only(self):
"""
Get the read-only state of the file.