[gedit] Remove bottom panel icon from python console plugin
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Remove bottom panel icon from python console plugin
- Date: Fri, 18 Oct 2013 15:16:10 +0000 (UTC)
commit 2d6208fc077e307cdf25e70a474960209652a576
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri Oct 18 17:15:51 2013 +0200
Remove bottom panel icon from python console plugin
gedit/gedit-panel.c | 19 ++++++++-----------
plugins/pythonconsole/pythonconsole/__init__.py | 6 +-----
2 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/gedit/gedit-panel.c b/gedit/gedit-panel.c
index b7e4957..1eafa71 100644
--- a/gedit/gedit-panel.c
+++ b/gedit/gedit-panel.c
@@ -684,7 +684,10 @@ build_tab_label (GeditPanel *panel,
gtk_container_add (GTK_CONTAINER (label_ebox), label_hbox);
/* setup icon */
- gtk_box_pack_start (GTK_BOX (label_hbox), icon, FALSE, FALSE, 0);
+ if (icon != NULL)
+ {
+ gtk_box_pack_start (GTK_BOX (label_hbox), icon, FALSE, FALSE, 0);
+ }
/* setup label */
label = gtk_label_new (name);
@@ -774,21 +777,15 @@ gedit_panel_add_item (GeditPanel *panel,
data = g_slice_new (GeditPanelItem);
data->id = g_strdup (id);
data->display_name = g_strdup (display_name);
+ data->icon = NULL;
- if (image == NULL)
- {
- /* default to empty */
- data->icon = gtk_image_new_from_icon_name ("text-x-generic",
- GTK_ICON_SIZE_MENU);
- }
- else
+ if (image != NULL)
{
data->icon = image;
+ gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
+ gtk_widget_set_size_request (data->icon, w, h);
}
- gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
- gtk_widget_set_size_request (data->icon, w, h);
-
g_object_set_data (G_OBJECT (item),
PANEL_ITEM_KEY,
data);
diff --git a/plugins/pythonconsole/pythonconsole/__init__.py b/plugins/pythonconsole/pythonconsole/__init__.py
index 0d33608..ca9d700 100644
--- a/plugins/pythonconsole/pythonconsole/__init__.py
+++ b/plugins/pythonconsole/pythonconsole/__init__.py
@@ -29,8 +29,6 @@ from gi.repository import GObject, Gtk, Gedit, Peas, PeasGtk
from .console import PythonConsole
from .config import PythonConsoleConfigWidget
-PYTHON_ICON = 'gnome-mime-text-x-python'
-
class PythonConsolePlugin(GObject.Object, Gedit.WindowActivatable, PeasGtk.Configurable):
__gtype_name__ = "PythonConsolePlugin"
@@ -46,10 +44,8 @@ class PythonConsolePlugin(GObject.Object, Gedit.WindowActivatable, PeasGtk.Confi
self._console.eval('print("You can access the main window through ' \
'\'window\' :\\n%s" % window)', False)
bottom = self.window.get_bottom_panel()
- image = Gtk.Image()
- image.set_from_icon_name(PYTHON_ICON, Gtk.IconSize.MENU)
bottom.add_item(self._console, "GeditPythonConsolePanel",
- _('Python Console'), image)
+ _('Python Console'), None)
def do_deactivate(self):
self._console.stop()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]