[meld] filediff, ui.statubar: Remove overwrite mode indicator



commit 1982574b6b3902512a626575cdd39a675b143d72
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Nov 25 09:19:30 2017 +1000

    filediff, ui.statubar: Remove overwrite mode indicator
    
    Text editors seem split on whether to show one of these. Some (gedit,
    LibreOffice Writer) do, others (Builder, Sublime Text) just rely on the
    insert cursor changing to a block.
    
    Given that I see overwrite mode as basically a giant historical
    misfeature, and also that I don't really want to move the display code
    over to the new status bar... I'm going to remove the display of it.

 meld/filediff.py     |   13 -------------
 meld/ui/statusbar.py |   14 --------------
 2 files changed, 0 insertions(+), 27 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index d373c7b..dcaa98b 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -214,14 +214,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         for diffmap in self.diffmap:
             self.linediffer.connect('diffs-changed', diffmap.on_diffs_changed)
 
-        self.status_info_labels = []
         for statusbar, buf in zip(self.statusbar, self.textbuffer):
-            overwrite_label = Gtk.Label()
-            overwrite_label.show()
-            pane_labels = [overwrite_label]
-            self.status_info_labels.append(pane_labels)
-
-            statusbar.set_info_box(pane_labels)
             buf.bind_property(
                 'language', statusbar, 'source-language',
                 GObject.BindingFlags.BIDIRECTIONAL)
@@ -353,9 +346,6 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
                 "notify::cursor-position", self.on_cursor_position_changed)
             buf.handlers = id0, id1, id2, id3, id4
 
-    # Abbreviations for insert and overwrite that fit in the status bar
-    _insert_overwrite_text = (_("INS"), _("OVR"))
-
     def on_cursor_position_changed(self, buf, pspec, force=False):
         pane = self.textbuffer.index(buf)
         pos = buf.props.cursor_position
@@ -367,10 +357,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         offset = self.textview[pane].get_visual_column(cursor_it)
         line = cursor_it.get_line()
 
-        insert_overwrite = self._insert_overwrite_text[self.textview_overwrite]
         self.statusbar[pane].props.cursor_position = (line, offset)
-        overwrite_label = self.status_info_labels[pane][0]
-        overwrite_label.set_text(insert_overwrite)
 
         if line != self.cursor.line or force:
             chunk, prev, next_ = self.linediffer.locate_chunk(pane, line)
diff --git a/meld/ui/statusbar.py b/meld/ui/statusbar.py
index ba74f41..0066895 100644
--- a/meld/ui/statusbar.py
+++ b/meld/ui/statusbar.py
@@ -144,14 +144,6 @@ class MeldStatusBar(Gtk.Statusbar):
         hbox.remove(label)
         hbox.pack_end(label, False, True, 0)
 
-        alignment = Gtk.Alignment.new(
-            xalign=1.0, yalign=0.5, xscale=1.0, yscale=1.0)
-        self.info_box = Gtk.HBox(homogeneous=False, spacing=12)
-        self.info_box.show()
-        alignment.add(self.info_box)
-        self.pack_end(alignment, False, True, 0)
-        alignment.show()
-
         self.box_box = Gtk.HBox(homogeneous=False, spacing=6)
         self.pack_end(self.box_box, False, True, 0)
         self.box_box.pack_end(self.construct_line_display(), False, True, 0)
@@ -263,9 +255,3 @@ class MeldStatusBar(Gtk.Statusbar):
         button.show()
 
         return button
-
-    def set_info_box(self, widgets):
-        for child in self.info_box.get_children():
-            self.info_box.remove(child)
-        for widget in widgets:
-            self.info_box.pack_end(widget, False, True, 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]