[gedit-latex] Small tidy up when show/hiding the toolbar



commit c7b0ef14a40c1a7491a1a6fc12cde832fd2063b2
Author: John Stowers <john stowers gmail com>
Date:   Wed Jun 29 19:57:20 2011 +1200

    Small tidy up when show/hiding the toolbar

 latex/base/windowactivatable.py |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/latex/base/windowactivatable.py b/latex/base/windowactivatable.py
index 29628a5..6f99a2f 100644
--- a/latex/base/windowactivatable.py
+++ b/latex/base/windowactivatable.py
@@ -411,14 +411,12 @@ class LaTeXWindowActivatable(GObject.Object, Gedit.WindowActivatable, PeasGtk.Co
 
         self._log.debug("---------- ADJUST: %s" % (extension))
 
-        if self._toolbar:
-            # FIXME: the toolbar should hide when it doesn't contain any visible items
-            latex_extensions = self._preferences.get("latex-extensions").split(",")
-            show_toolbar = self._preferences.get_bool("show-latex-toolbar")
-            if show_toolbar and extension in latex_extensions:
-                self._toolbar.show()
-            else:
-                self._toolbar.hide()
+        latex_extensions = self._preferences.get("latex-extensions").split(",")
+        show_toolbar = self._preferences.get_bool("show-latex-toolbar")
+        if show_toolbar and extension in latex_extensions:
+            self.show_toolbar()
+        else:
+            self.hide_toolbar()
 
         #
         # adjust actions



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