What can I do to help fix unpadded Text gramplets?

The Gramps dashboard (with the example.gramps tree) looks like:

Look at the left edge of the “Welcome to Gramps!” Gramplet. The underlined of the hotlinked lines runs right into the left edge of the window. The text is only slightly better with a single pixel of kerning space. There are no vertical gutters. The right edge has a bit worse example with the “it’s” running offscreen.

Having the content text butting right against the edge gives an amateurish false impression.

What Python lines need to be hacked in to add a few gutter pixels between the left & right borders & the text?


The dashboard Gramplets use the GrampletPane class, which in turn uses the grampletpane.glade file (in gramps.gui.glade subdir).

In that file there is a section that defines the “Textview”:

                  <object class="GtkTextView" id="gvtextview">
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="editable">False</property>
                    <property name="wrap_mode">word</property>

You would want to add some margins to that view, below the other properties:

                    <property name="left_margin">6</property>
                    <property name="right_margin">6</property>

Since it is likely that the Textview pane for all gramplets won’t want to have side margins, is it better to insert margin definitions in each individual gramplet instead of wholesale in the grampletpane.glade file? Or, is it more reasonable to expect margins and override them when not needed?

(The Dashboard and the split bars seem to have different Glade definitions, right? To avoid a exception, the default margins for text panes in both will probably need to be harmonized.)

Using the Welcomegramplet.py as an example,

    def build_gui(self):
        Build the GUI interface.
        top = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        scrolledwindow = Gtk.ScrolledWindow()
        self.texteditor = StyledTextEditor()


        top.pack_start(scrolledwindow, True, True, 0)
        return top

I just insert margin definitions after the line: self.texteditor.set_wrap_mode(Gtk.WrapMode.WORD)


Nevermind. After changing both the Glade file and the welcomegramplet.py file, it looks like there’s no conflict.

@prculley could you review the newly filed bug with the revised glade file ? And possibly submit a corresponding pull request?

I added a Top margin

              `<property name="top_margin">6</property>`

Cannot see a need to add a bottom margin.

EDIT: which doesn’t do anything :smiling_face_with_tear: