summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorIgnacio Casal Quinteiro <icq@gnome.org>2014-02-20 08:38:27 +0100
committerIgnacio Casal Quinteiro <icq@gnome.org>2014-02-20 08:38:27 +0100
commit4e333377ebc74788dbcae56d85c01962ca391144 (patch)
treed967bb1bfa2182aea4a75bd26e8b785a2fbe2e53 /plugins
parente8ed0a4e53b1382e1f3c75f716eaadabeef65e5a (diff)
downloadgedit-4e333377ebc74788dbcae56d85c01962ca391144.tar.gz
tools: add custom css styling for manager
Diffstat (limited to 'plugins')
-rw-r--r--plugins/externaltools/tools/appactivatable.py39
-rw-r--r--plugins/externaltools/tools/tools.ui9
2 files changed, 47 insertions, 1 deletions
diff --git a/plugins/externaltools/tools/appactivatable.py b/plugins/externaltools/tools/appactivatable.py
index 0e931e72c..cbf77af50 100644
--- a/plugins/externaltools/tools/appactivatable.py
+++ b/plugins/externaltools/tools/appactivatable.py
@@ -16,7 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-from gi.repository import GLib, Gio, GObject, Gtk, Gedit
+from gi.repository import GLib, Gio, GObject, Gtk, Gdk, Gedit
from .library import ToolLibrary
import os
@@ -78,6 +78,41 @@ class AppActivatable(GObject.Object, Gedit.AppActivatable):
self._library = ToolLibrary()
self._library.set_locations(os.path.join(self.plugin_info.get_data_dir(), 'tools'))
+ self.css = Gtk.CssProvider()
+ self.css.load_from_data("""
+.gedit-tool-manager-paned {
+ border-style: solid;
+ border-color: @borders;
+}
+
+.gedit-tool-manager-paned:dir(ltr) {
+ border-width: 0 1px 0 0;
+}
+
+.gedit-tool-manager-paned:dir(rtl) {
+ border-width: 0 0 0 1px;
+}
+
+.gedit-tool-manager-view {
+ border-width: 0 0 1px 0;
+}
+
+.gedit-tool-manager-treeview {
+ border-top-width: 0;
+}
+
+.gedit-tool-manager-treeview:dir(ltr) {
+ border-left-width: 0;
+}
+
+.gedit-tool-manager-treeview:dir(rtl) {
+ border-right-width: 0;
+}
+""".encode('utf-8'))
+
+ Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
+ self.css, 600)
+
self.menu_ext = self.extend_menu("preferences-section")
item = Gio.MenuItem.new(_("Manage _External Tools..."), "win.manage-tools")
self.menu_ext.append_menu_item(item)
@@ -95,5 +130,7 @@ class AppActivatable(GObject.Object, Gedit.AppActivatable):
self.menu.deactivate()
self.menu_ext = None
self.submenu_ext = None
+ Gtk.StyleContext.remove_for_screen(Gdk.Screen.get_default(),
+ self.css)
# ex:ts=4:et:
diff --git a/plugins/externaltools/tools/tools.ui b/plugins/externaltools/tools/tools.ui
index 407bfda02..5719cb152 100644
--- a/plugins/externaltools/tools/tools.ui
+++ b/plugins/externaltools/tools/tools.ui
@@ -173,6 +173,9 @@
<property name="vexpand">True</property>
<property name="position">275</property>
<property name="position_set">True</property>
+ <style>
+ <class name="gedit-tool-manager-paned"/>
+ </style>
<child>
<object class="GtkBox" id="vbox2">
<property name="visible">True</property>
@@ -183,6 +186,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
+ <style>
+ <class name="gedit-tool-manager-treeview"/>
+ </style>
<child>
<object class="GtkTreeView" id="view">
<property name="visible">True</property>
@@ -518,6 +524,9 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="shadow_type">in</property>
+ <style>
+ <class name="gedit-tool-manager-view"/>
+ </style>
<child>
<object class="GeditView" id="commands">
<property name="buffer">commands_buffer</property>