Skip to content

Commit

Permalink
for gnome 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Sep 28, 2013
1 parent ca1dca3 commit 2af7939
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 20 deletions.
17 changes: 14 additions & 3 deletions indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ const Lib = Me.imports.lib;

const KimIndicator = new Lang.Class({
Name: "KimIndicator",
Extends: PanelMenu.SystemStatusButton,
Extends: PanelMenu.Button,

_init: function(params){
this.parent(0.0, 'kimpanel');
params = Params.parse(params, {kimpanel: null});
this._properties = {};
this._propertySwitch = {};

PanelMenu.SystemStatusButton.prototype._init.call(this, 'input-keyboard-symbolic', 'kimpanel');
this._box = new St.BoxLayout({ style_class: 'panel-status-button-box' });
this.actor.add_actor(this._box);
this._setIcon('input-keyboard-symbolic');

this.kimpanel = params.kimpanel;

Expand Down Expand Up @@ -127,7 +130,15 @@ const KimIndicator = new Lang.Class({
},

_setIcon: function(iconName) {
this.setGIcon(Lib.createIcon(iconName));
let gicon = Lib.createIcon(iconName);
if (this.mainIcon) {
this.mainIcon.gicon = gicon;
} else {
let icon = new St.Icon({ gicon: gicon,
style_class: 'system-status-icon' });
this._box.add_actor(icon);
this.mainIcon = icon;
}
},

_active: function(){
Expand Down
13 changes: 9 additions & 4 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ const KimMenuItem = new Lang.Class({
this.parent(params);

this.label = new St.Label({ text: text });
this.addActor(this.label);
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
this.addActor(this._icon, { align: St.Align.END });
this.actor.add_child(this.label);
this.actor.label_actor = this.label
this._icon = new St.Icon({ x_align: St.Align.END, style_class: 'popup-menu-icon' });
this.actor.add_child(this._icon);

this.setIcon(iconName);
},
Expand Down Expand Up @@ -66,7 +67,11 @@ function createIcon(name, params) {
if (name[0] == '/') {
return Gio.FileIcon.new(Gio.File.new_for_path(name));
}
return Gio.ThemedIcon.new_with_default_fallbacks(name + '-symbolic');
// this is to hack through the gtk silly icon theme code.
// gtk doesn't want to mix symbolic icon and normal icon together,
// while in our case, it's much better to show an icon instead of
// hide everything.
return Gio.ThemedIcon.new_with_default_fallbacks(name + '-symbolic-hack');
}

function createMenuItem(property) {
Expand Down
1 change: 1 addition & 0 deletions menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const KimMenu = new Lang.Class({
},

execMenu: function(properties) {
let p = null;
for (p in this._propertySwitch) {
this._propertySwitch[p].destroy();
delete this._propertySwitch[p];
Expand Down
2 changes: 1 addition & 1 deletion metadata.json.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extension-id": "kimpanel",
"shell-version": ["3.7.91", "3.8"],
"shell-version": ["3.10"],
"uuid": "@uuid@",
"name": "@extensionname@",
"description": "KDE Input Method Panel for Gnome-Shell",
Expand Down
24 changes: 12 additions & 12 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@ msgstr ""
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-SourceCharset: UTF-8\n"

#: ../build/_build/kimpanel@kde.org/prefs.js:48
#: ../build/_build/usr/local/share/gnome-shell/extensions/kimpanel@kde.org/prefs.js:48
#: ../prefs.js:48
msgid "Font"
msgstr "Schriftart"

#: ../build/_build/kimpanel@kde.org/indicator.js:26
#: ../build/_build/usr/local/share/gnome-shell/extensions/kimpanel@kde.org/indicator.js:26
#: ../indicator.js:26
msgid "IM Settings"
msgstr "IM-Einstellungen"

#: ../build/_build/kimpanel@kde.org/indicator.js:30
#: ../build/_build/usr/local/share/gnome-shell/extensions/kimpanel@kde.org/indicator.js:30
#: ../indicator.js:30
msgid "Reload Configuration"
msgstr "Konfiguration neu laden"

#: ../build/_build/kimpanel@kde.org/indicator.js:40
#: ../build/_build/usr/local/share/gnome-shell/extensions/kimpanel@kde.org/indicator.js:40
#: ../indicator.js:40
msgid "Panel Preferences"
msgstr "Panel-Einstellungen"

#: ../build/_build/kimpanel@kde.org/indicator.js:30
#: ../build/_build/usr/local/share/gnome-shell/extensions/kimpanel@kde.org/indicator.js:30
#: ../indicator.js:30
msgid "Reload Configuration"
msgstr "Konfiguration neu laden"

#: ../build/_build/kimpanel@kde.org/prefs.js:19
#: ../build/_build/usr/local/share/gnome-shell/extensions/kimpanel@kde.org/prefs.js:19
#: ../prefs.js:19
msgid "Vertical List"
msgstr "Vertikale Liste"

#: ../build/_build/kimpanel@kde.org/prefs.js:48
#: ../build/_build/usr/local/share/gnome-shell/extensions/kimpanel@kde.org/prefs.js:48
#: ../prefs.js:48
msgid "Font"
msgstr "Schriftart"

0 comments on commit 2af7939

Please sign in to comment.