Commit c58d6b3b authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

gamepad-view: Fix gamepad svg loading with old librsvg

For some reason loading with 'new Rsvg.Handle.from_file()' fails, while
loading gresource manually and creating handle via 'from_data()' works, so
let's go with that.

Also remove 'resource:' prefix from paths, since they aren't needed
anymore.
parent 57cdb629
Pipeline #31889 passed with stages
in 23 minutes and 38 seconds
......@@ -51,7 +51,7 @@ private class Games.GamepadConfigurer : Gtk.Box {
};
private const GamepadViewConfiguration STANDARD_GAMEPAD_VIEW_CONFIGURATION = {
"resource:///org/gnome/Games/gamepads/standard-gamepad.svg", STANDARD_GAMEPAD_INPUT_PATHS
"/org/gnome/Games/gamepads/standard-gamepad.svg", STANDARD_GAMEPAD_INPUT_PATHS
};
private enum State {
......
......@@ -12,7 +12,10 @@ private class Games.GamepadView : Gtk.DrawingArea {
}
public void set_configuration (GamepadViewConfiguration configuration) throws Error {
handle = new Rsvg.Handle.from_file (configuration.svg_path);
var bytes = resources_lookup_data (configuration.svg_path, ResourceLookupFlags.NONE);
var data = bytes.get_data ();
handle = new Rsvg.Handle.from_data (data);
set_size_request (handle.width, handle.height);
this.configuration = configuration;
input_highlights = new bool[configuration.input_paths.length];
......
......@@ -41,7 +41,7 @@ private class Games.KeyboardConfigurer : Gtk.Box {
};
private const GamepadViewConfiguration KEYBOARD_GAMEPAD_VIEW_CONFIGURATION = {
"resource:///org/gnome/Games/gamepads/standard-gamepad.svg", KEYBOARD_GAMEPAD_INPUT_PATHS
"/org/gnome/Games/gamepads/standard-gamepad.svg", KEYBOARD_GAMEPAD_INPUT_PATHS
};
private enum State {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment