Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBUS Rework #168

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[org.freedesktop.ibus.panel:Budgie]
show-icon-on-systray=false
25 changes: 19 additions & 6 deletions src/applets/tray/TrayApplet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,31 @@ public class TrayPlugin : Budgie.Plugin, Peas.ExtensionBase {
[GtkTemplate (ui="/com/solus-project/tray/settings.ui")]
public class TraySettings : Gtk.Grid {
Settings? settings = null;
Settings? ibus_settings = null;

[GtkChild]
private unowned Gtk.SpinButton? spinbutton_spacing;

[GtkChild]
private unowned Gtk.Switch? ibusicon_switch;

[GtkChild]
private unowned Gtk.Label? ibusicon_label;

public TraySettings(Settings? settings) {
this.settings = settings;
settings.bind("spacing", spinbutton_spacing, "value", SettingsBindFlags.DEFAULT);

var show_ibusicon = Environment.find_program_in_path("ibus-daemon") != null;
if (show_ibusicon) {
ibus_settings = new Settings("org.freedesktop.ibus.panel");
ibus_settings.bind("show-icon-on-systray", ibusicon_switch, "active", SettingsBindFlags.DEFAULT);
}

ibusicon_switch.show();
ibusicon_label.show();
ibusicon_switch.set_visible(show_ibusicon);
ibusicon_label.set_visible(show_ibusicon);
}
}

Expand Down Expand Up @@ -165,12 +183,7 @@ public class TrayApplet : Budgie.Applet {
}

public override void panel_position_changed(Budgie.PanelPosition position) {
if (position == Budgie.PanelPosition.LEFT || position == Budgie.PanelPosition.RIGHT) {
orient = Gtk.Orientation.VERTICAL;
} else {
orient = Gtk.Orientation.HORIZONTAL;
}

orient = (position == Budgie.PanelPosition.LEFT || position == Budgie.PanelPosition.RIGHT) ? Gtk.Orientation.VERTICAL : Gtk.Orientation.HORIZONTAL;
reintegrate_tray();
}

Expand Down
1 change: 1 addition & 0 deletions src/applets/tray/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ shared_library(

install_data(
'com.solus-project.tray.gschema.xml',
'20_buddiesofbudgie.budgie.tray.gschema.override',
install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
)
59 changes: 50 additions & 9 deletions src/applets/tray/settings.ui
Original file line number Diff line number Diff line change
@@ -1,42 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">20</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<!-- n-columns=3 n-rows=3 -->
<template class="TraySettings" parent="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Icon Spacing</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton_spacing">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can-focus">True</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="ibusicon_label">
<property name="can-focus">False</property>
<property name="no-show-all">True</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Show IBus Icon</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="ibusicon_switch">
<property name="can-focus">True</property>
<property name="no-show-all">True</property>
<property name="halign">end</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</template>
</interface>
4 changes: 2 additions & 2 deletions src/wm/ibus.vala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Budgie {
this.engines = new HashTable<string,weak IBus.EngineDesc>(str_hash, str_equal);

/* Get the bus */
bus = new IBus.Bus();
bus = new IBus.Bus.async();

/* Hook up basic signals */
bus.connected.connect(this.ibus_connected);
Expand All @@ -73,7 +73,7 @@ namespace Budgie {
* Launch the daemon as a child process so that it dies when we die
*/
private void startup_ibus() {
string[] cmdline = {"ibus-daemon", "--xim", "--panel", "disable"};
string[] cmdline = {"ibus-daemon", "--xim", "--daemonize"};
fossfreedom marked this conversation as resolved.
Show resolved Hide resolved
try {
new Subprocess.newv(cmdline, SubprocessFlags.NONE);
} catch (Error e) {
Expand Down
Loading