From e5a5f212bcf4a9644369f6223e7fcdbe49cd8c27 Mon Sep 17 00:00:00 2001 From: Sam Manzi Date: Sun, 11 Mar 2018 10:32:19 +1100 Subject: [PATCH] Allow Copying of text fields for Details tabs (#575) Allow selection of text fields from details tab in selected views with Details gramplets. - Person Details - Place Details - Repository Details Resolves #7874 --- gramps/plugins/gramplet/persondetails.py | 4 ++++ gramps/plugins/gramplet/placedetails.py | 4 ++++ gramps/plugins/gramplet/repositorydetails.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/gramps/plugins/gramplet/persondetails.py b/gramps/plugins/gramplet/persondetails.py index 664021be4..13f64afe7 100644 --- a/gramps/plugins/gramplet/persondetails.py +++ b/gramps/plugins/gramplet/persondetails.py @@ -62,6 +62,7 @@ class PersonDetails(Gramplet): self.photo.show() self.name = Gtk.Label(halign=Gtk.Align.START) self.name.override_font(Pango.FontDescription('sans bold 12')) + self.name.set_selectable(True) vbox.pack_start(self.name, fill=True, expand=False, padding=7) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL) self.grid.set_column_spacing(10) @@ -77,8 +78,10 @@ class PersonDetails(Gramplet): """ label = Gtk.Label(label=title + COLON, halign=Gtk.Align.END, valign=Gtk.Align.START) + label.set_selectable(True) label.show() value = Gtk.Label(label=value, halign=Gtk.Align.START) + value.set_selectable(True) value.show() self.grid.add(label) self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1) @@ -176,6 +179,7 @@ class PersonDetails(Gramplet): """ label = Gtk.Label(label='') label.override_font(Pango.FontDescription('sans 4')) + label.set_selectable(True) label.show() self.grid.add(label) diff --git a/gramps/plugins/gramplet/placedetails.py b/gramps/plugins/gramplet/placedetails.py index c79dc9aa7..b89029c9d 100644 --- a/gramps/plugins/gramplet/placedetails.py +++ b/gramps/plugins/gramplet/placedetails.py @@ -56,6 +56,7 @@ class PlaceDetails(Gramplet): self.photo = Photo(self.uistate.screen_height() < 1000) self.title = Gtk.Label(halign=Gtk.Align.START) self.title.override_font(Pango.FontDescription('sans bold 12')) + self.title.set_selectable(True) vbox.pack_start(self.title, False, True, 7) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL) self.grid.set_column_spacing(10) @@ -71,8 +72,10 @@ class PlaceDetails(Gramplet): """ label = Gtk.Label(label=title + COLON, halign=Gtk.Align.END, valign=Gtk.Align.START) + label.set_selectable(True) label.show() value = Gtk.Label(label=value, halign=Gtk.Align.START) + value.set_selectable(True) value.show() self.grid.add(label) self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1) @@ -157,6 +160,7 @@ class PlaceDetails(Gramplet): """ label = Gtk.Label(label='') label.override_font(Pango.FontDescription('sans 4')) + label.set_selectable(True) label.show() self.grid.add(label) diff --git a/gramps/plugins/gramplet/repositorydetails.py b/gramps/plugins/gramplet/repositorydetails.py index 0d23e8868..b23767750 100644 --- a/gramps/plugins/gramplet/repositorydetails.py +++ b/gramps/plugins/gramplet/repositorydetails.py @@ -52,6 +52,7 @@ class RepositoryDetails(Gramplet): vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.name = Gtk.Label(halign=Gtk.Align.START) self.name.override_font(Pango.FontDescription('sans bold 12')) + self.name.set_selectable(True) vbox.pack_start(self.name, fill=True, expand=False, padding=7) self.grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL) self.grid.set_column_spacing(10) @@ -66,8 +67,10 @@ class RepositoryDetails(Gramplet): """ label = Gtk.Label(label=title + COLON, halign=Gtk.Align.END, valign=Gtk.Align.START) + label.set_selectable(True) label.show() value = Gtk.Label(label=value, halign=Gtk.Align.START) + value.set_selectable(True) value.show() self.grid.add(label) self.grid.attach_next_to(value, label, Gtk.PositionType.RIGHT, 1, 1) @@ -153,5 +156,6 @@ class RepositoryDetails(Gramplet): """ label = Gtk.Label(label='') label.override_font(Pango.FontDescription('sans 4')) + label.set_selectable(True) label.show() self.grid.add(label)