Skip to content

Commit f0afbfe

Browse files
committed
Make it compatible with current gnome 40
1 parent dcbca17 commit f0afbfe

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

indicator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class Indicator_KimIndicator extends PanelMenu.Button {
2626
style_class: 'system-status-icon' });
2727
hbox.add_child(this.labelIcon);
2828
hbox.add_child(this.mainIcon);
29-
hbox.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM));
3029
this.add_actor(hbox);
3130
this._setIcon('input-keyboard', '');
3231

metadata.json.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extension-id": "kimpanel",
3-
"shell-version": ["3.38"],
3+
"shell-version": ["40.beta", "40"],
44
"uuid": "kimpanel@kde.org",
55
"name": "Input Method Panel",
66
"description": "Input Method Panel using KDE's kimpanel protocol for Gnome-Shell",

prefs.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
imports.gi.versions['Gtk'] = '4.0';
12
const Gtk = imports.gi.Gtk;
23

34
const Gettext = imports.gettext.domain('gnome-shell-extensions-kimpanel');
@@ -28,54 +29,51 @@ function createBoolSetting(setting) {
2829
var hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL });
2930

3031
var setting_label = new Gtk.Label({label: settings_bool[setting].label,
31-
xalign: 0 });
32+
xalign: 0, halign: Gtk.Align.FILL, hexpand: true });
3233

3334
var setting_switch = new Gtk.Switch({active: settings.get_boolean(setting)});
3435
setting_switch.connect('notify::active', function(button) {
3536
settings.set_boolean(setting, button.active);
3637
});
3738

38-
hbox.pack_start(setting_label, true, true, 0);
39-
hbox.add(setting_switch);
39+
hbox.append(setting_label);
40+
hbox.append(setting_switch);
4041

4142
return hbox;
4243
}
4344

4445
function createFontSelection() {
4546
var hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL });
46-
47-
var setting_label = new Gtk.Label( { label: _("Font"), xalign: 0});
4847

48+
var setting_label = new Gtk.Label( { label: _("Font"), xalign: 0, halign: Gtk.Align.FILL, hexpand: true});
4949

5050
var font = settings.get_string('font') || "Sans 12";
5151

52-
var button = new Gtk.FontButton( { font_name:font } );
52+
var button = new Gtk.FontButton( { font:font } );
5353

54-
button.connect("font-set", function(button){
55-
settings.set_string('font',button.get_font_name());
54+
button.connect("font-set", function(button){
55+
settings.set_string('font',button.font);
5656
});
5757

58-
hbox.pack_start(setting_label, true, true, 0);
59-
hbox.add(button);
58+
hbox.append(setting_label);
59+
hbox.append(button);
6060

6161
return hbox;
6262
}
6363

6464
function buildPrefsWidget() {
65-
var frame = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
66-
border_width: 10 });
67-
var vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
68-
margin: 20, margin_top:10 });
65+
var frame = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
66+
var vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL, margin_top: 10, margin_start: 20, margin_end: 20 });
6967

7068
var setting = null;
7169
for (setting in settings_bool) {
7270
var hbox = createBoolSetting(setting);
73-
vbox.add(hbox);
71+
vbox.append(hbox);
7472
}
7573
var hbox = createFontSelection();
76-
vbox.add(hbox);
77-
78-
frame.add(vbox);
79-
frame.show_all();
74+
vbox.append(hbox);
75+
76+
frame.append(vbox);
77+
frame.show();
8078
return frame;
8179
}

0 commit comments

Comments
 (0)