Added gnome-icon-theme-legacy dependency at the moment.
This commit is contained in:
parent
38194ccce1
commit
0e99b9268d
@ -1,133 +0,0 @@
|
|||||||
From e2b07deb05182355f7bdecdd69a731a566ad832c Mon Sep 17 00:00:00 2001
|
|
||||||
From: fujiwarat <takao.fujiwara1@gmail.com>
|
|
||||||
Date: Thu, 17 Feb 2011 15:16:21 +0900
|
|
||||||
Subject: [PATCH] Use gtk_icon_factory_lookup_default for GTK stock
|
|
||||||
|
|
||||||
gtk_icon_theme_load_icon doesn't load GTK legacy stock ids because
|
|
||||||
The stock legacy symlinks are removed in the latst GTK.
|
|
||||||
---
|
|
||||||
ui/gtk/engineabout.py | 13 ++++++++++---
|
|
||||||
ui/gtk/icon.py | 40 ++++++++++++++++++++++++++++++++++++----
|
|
||||||
ui/gtk/panel.py | 4 ++--
|
|
||||||
3 files changed, 48 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/ui/gtk/engineabout.py b/ui/gtk/engineabout.py
|
|
||||||
index a34e930..1af806c 100644
|
|
||||||
--- a/ui/gtk/engineabout.py
|
|
||||||
+++ b/ui/gtk/engineabout.py
|
|
||||||
@@ -24,6 +24,7 @@ import gtk
|
|
||||||
from gtk import gdk
|
|
||||||
import pango
|
|
||||||
import ibus
|
|
||||||
+import icon as _icon
|
|
||||||
|
|
||||||
from i18n import _, N_
|
|
||||||
|
|
||||||
@@ -35,7 +36,9 @@ class EngineAbout(gtk.Dialog):
|
|
||||||
self.__init_ui()
|
|
||||||
|
|
||||||
def __init_ui(self):
|
|
||||||
- self.set_icon_name("gtk-about")
|
|
||||||
+ # Gtk stock symlink is legacy.
|
|
||||||
+ pixbufs = _icon.icon_set_get_pixbufs_default(None, gtk.STOCK_ABOUT)
|
|
||||||
+ self.set_icon_list(*pixbufs)
|
|
||||||
sw = gtk.ScrolledWindow()
|
|
||||||
sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
|
|
||||||
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
|
||||||
@@ -96,6 +99,10 @@ class EngineAbout(gtk.Dialog):
|
|
||||||
theme = gtk.icon_theme_get_default()
|
|
||||||
icon = theme.lookup_icon("ibus-engine", 48, 0)
|
|
||||||
if icon == None:
|
|
||||||
- icon = theme.lookup_icon("gtk-missing-image", 48, 0)
|
|
||||||
- pixbuf = icon.load_icon()
|
|
||||||
+ # Gtk stock symlink is legacy.
|
|
||||||
+ pixbuf = _icon.icon_set_get_pixbuf_default(None,
|
|
||||||
+ gtk.STOCK_MISSING_IMAGE,
|
|
||||||
+ 48)
|
|
||||||
+ else:
|
|
||||||
+ pixbuf = icon.load_icon()
|
|
||||||
return pixbuf
|
|
||||||
diff --git a/ui/gtk/icon.py b/ui/gtk/icon.py
|
|
||||||
index 5b5f97f..d91fe4a 100644
|
|
||||||
--- a/ui/gtk/icon.py
|
|
||||||
+++ b/ui/gtk/icon.py
|
|
||||||
@@ -22,6 +22,32 @@
|
|
||||||
|
|
||||||
import gtk
|
|
||||||
import gtk.gdk as gdk
|
|
||||||
+import sys
|
|
||||||
+
|
|
||||||
+def icon_set_get_pixbuf_default(icon_set, stock_id, size, state=gtk.STATE_NORMAL):
|
|
||||||
+ if icon_set == None:
|
|
||||||
+ icon_set = gtk.icon_factory_lookup_default(stock_id)
|
|
||||||
+ if icon_set == None:
|
|
||||||
+ return None
|
|
||||||
+ return icon_set.render_icon(gtk.widget_get_default_style(),
|
|
||||||
+ gtk.widget_get_default_direction(),
|
|
||||||
+ state,
|
|
||||||
+ size,
|
|
||||||
+ None, None)
|
|
||||||
+
|
|
||||||
+def icon_set_get_pixbufs_default(icon_set, stock_id, state=gtk.STATE_NORMAL):
|
|
||||||
+ if icon_set == None:
|
|
||||||
+ icon_set = gtk.icon_factory_lookup_default(stock_id)
|
|
||||||
+ pixbufs = []
|
|
||||||
+ if icon_set == None:
|
|
||||||
+ return []
|
|
||||||
+ for size in icon_set.get_sizes():
|
|
||||||
+ pixbufs.append(icon_set.render_icon(gtk.widget_get_default_style(),
|
|
||||||
+ gtk.widget_get_default_direction(),
|
|
||||||
+ state,
|
|
||||||
+ size,
|
|
||||||
+ None, None))
|
|
||||||
+ return pixbufs
|
|
||||||
|
|
||||||
class IconWidget(gtk.Image):
|
|
||||||
def __init__(self, icon, size):
|
|
||||||
@@ -31,11 +57,17 @@ class IconWidget(gtk.Image):
|
|
||||||
if icon.startswith("/"):
|
|
||||||
pixbuf = gdk.pixbuf_new_from_file(icon)
|
|
||||||
else:
|
|
||||||
- theme = gtk.icon_theme_get_default()
|
|
||||||
- pixbuf = theme.load_icon(icon, size, 0)
|
|
||||||
+ # Gtk stock symlink is legacy.
|
|
||||||
+ icon_set = gtk.icon_factory_lookup_default(icon)
|
|
||||||
+ if icon_set != None:
|
|
||||||
+ pixbuf = icon_set_get_pixbuf_default(icon_set, icon, size)
|
|
||||||
+ else:
|
|
||||||
+ theme = gtk.icon_theme_get_default()
|
|
||||||
+ pixbuf = theme.load_icon(icon, size, 0)
|
|
||||||
except:
|
|
||||||
- theme = gtk.icon_theme_get_default()
|
|
||||||
- pixbuf = theme.load_icon(gtk.STOCK_MISSING_IMAGE, size, 0)
|
|
||||||
+ print >> sys.stderr, "Not Found Icon", icon, size
|
|
||||||
+ # Gtk stock symlink is legacy.
|
|
||||||
+ pixbuf = icon_set_get_pixbuf_default(None, gtk.STOCK_MISSING_IMAGE, size)
|
|
||||||
|
|
||||||
width = pixbuf.get_width()
|
|
||||||
height = pixbuf.get_height()
|
|
||||||
diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py
|
|
||||||
index 07b0fa2..2244455 100644
|
|
||||||
--- a/ui/gtk/panel.py
|
|
||||||
+++ b/ui/gtk/panel.py
|
|
||||||
@@ -412,7 +412,7 @@ class Panel(ibus.PanelBase):
|
|
||||||
menu.add(item)
|
|
||||||
|
|
||||||
item = gtk.ImageMenuItem(_("Turn off input method"))
|
|
||||||
- item.set_image(_icon.IconWidget("gtk-close", size[0]))
|
|
||||||
+ item.set_image(_icon.IconWidget(gtk.STOCK_CLOSE, size[0]))
|
|
||||||
item.connect("activate", self.__im_menu_item_activate_cb, None)
|
|
||||||
if self.__focus_ic == None or not self.__focus_ic.is_enabled():
|
|
||||||
item.set_sensitive(False)
|
|
||||||
@@ -452,7 +452,7 @@ class Panel(ibus.PanelBase):
|
|
||||||
menu = gtk.Menu()
|
|
||||||
item = gtk.ImageMenuItem(_("No input window"))
|
|
||||||
size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
|
|
||||||
- item.set_image(_icon.IconWidget("gtk-info", size[0]))
|
|
||||||
+ item.set_image(_icon.IconWidget(gtk.STOCK_INFO, size[0]))
|
|
||||||
menu.add(item)
|
|
||||||
menu.show_all()
|
|
||||||
else:
|
|
||||||
--
|
|
||||||
1.7.4
|
|
||||||
|
|
23
ibus.spec
23
ibus.spec
@ -6,13 +6,13 @@
|
|||||||
%define ibus_api_version 1.0
|
%define ibus_api_version 1.0
|
||||||
|
|
||||||
%define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999")
|
%define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999")
|
||||||
%define gconf2_version 2.12.0
|
|
||||||
%define dbus_python_version 0.83.0
|
%define dbus_python_version 0.83.0
|
||||||
%define im_chooser_version 1.2.5
|
# FIXME: It's better to use the new icon names
|
||||||
|
%define gnome_icon_theme_legacy_version 2.91.6
|
||||||
|
|
||||||
Name: ibus
|
Name: ibus
|
||||||
Version: 1.3.99.20110206
|
Version: 1.3.99.20110206
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: Intelligent Input Bus for Linux OS
|
Summary: Intelligent Input Bus for Linux OS
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
@ -29,8 +29,6 @@ Patch4: ibus-657165-panel-libs.patch
|
|||||||
Patch5: ibus-657165-gjs-plugins.patch
|
Patch5: ibus-657165-gjs-plugins.patch
|
||||||
# This will be removed after the new gnome-shell is integrated.
|
# This will be removed after the new gnome-shell is integrated.
|
||||||
Patch99: ibus-675503-gnome-shell-workaround.patch
|
Patch99: ibus-675503-gnome-shell-workaround.patch
|
||||||
# The latest gnome-icon-theme removes the legacy gtk-stock symlinks.
|
|
||||||
Patch100: ibus-xx-gtk-legacy-icon.patch
|
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
@ -64,17 +62,18 @@ Requires: pyxdg
|
|||||||
Requires: iso-codes
|
Requires: iso-codes
|
||||||
Requires: dbus-python >= %{dbus_python_version}
|
Requires: dbus-python >= %{dbus_python_version}
|
||||||
Requires: dbus-x11
|
Requires: dbus-x11
|
||||||
Requires: im-chooser >= %{im_chooser_version}
|
Requires: im-chooser
|
||||||
Requires: GConf2 >= %{gconf2_version}
|
Requires: GConf2
|
||||||
Requires: notify-python
|
Requires: notify-python
|
||||||
Requires: librsvg2
|
Requires: librsvg2
|
||||||
|
Requires: gnome-icon-theme-legacy >= %{gnome_icon_theme_legacy_version}
|
||||||
|
|
||||||
Requires(post): desktop-file-utils
|
Requires(post): desktop-file-utils
|
||||||
Requires(postun): desktop-file-utils
|
Requires(postun): desktop-file-utils
|
||||||
|
|
||||||
Requires(pre): GConf2 >= %{gconf2_version}
|
Requires(pre): GConf2
|
||||||
Requires(post): GConf2 >= %{gconf2_version}
|
Requires(post): GConf2
|
||||||
Requires(preun): GConf2 >= %{gconf2_version}
|
Requires(preun): GConf2
|
||||||
|
|
||||||
Requires(post): %{_sbindir}/alternatives
|
Requires(post): %{_sbindir}/alternatives
|
||||||
Requires(postun): %{_sbindir}/alternatives
|
Requires(postun): %{_sbindir}/alternatives
|
||||||
@ -143,7 +142,6 @@ The ibus-devel-docs package contains developer documentation for ibus
|
|||||||
bzcat %SOURCE2 | tar xf -
|
bzcat %SOURCE2 | tar xf -
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch99 -p1 -b .g-s-typo
|
%patch99 -p1 -b .g-s-typo
|
||||||
%patch100 -p1 -b .legacy-stock
|
|
||||||
# start surrounding patch
|
# start surrounding patch
|
||||||
%patch1 -p1 -b .surrounding
|
%patch1 -p1 -b .surrounding
|
||||||
cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c
|
cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c
|
||||||
@ -314,9 +312,8 @@ fi
|
|||||||
%{_datadir}/gtk-doc/html/*
|
%{_datadir}/gtk-doc/html/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Feb 17 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110206-2
|
* Fri Feb 18 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110206-3
|
||||||
- Fixed Bug 677856 - left ibus snooper when im client is switched.
|
- Fixed Bug 677856 - left ibus snooper when im client is switched.
|
||||||
- Added ibus-xx-gtk-legacy-icon.patch to work without legacy gtk stock.
|
|
||||||
|
|
||||||
* Mon Feb 14 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110206-1
|
* Mon Feb 14 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110206-1
|
||||||
- Integrated the part of gjs in Bug 657165 ibus for gnome-shell.
|
- Integrated the part of gjs in Bug 657165 ibus for gnome-shell.
|
||||||
|
Loading…
Reference in New Issue
Block a user