Prepare for resource loading

Cleanup the Clapper install path detection code in a way to make gresources loading eventually possible for compiled builds
This commit is contained in:
Rafostar
2021-09-05 17:07:11 +02:00
parent 3c765e9f17
commit dea67e4712
6 changed files with 45 additions and 41 deletions

View File

@@ -60,7 +60,7 @@ class ClapperIconToggleButton extends CustomButton
var PopoverSeparator = GObject.registerClass({
GTypeName: 'ClapperPopoverSeparator',
Template: `file://${Misc.getClapperPath()}/ui/popover-separator.ui`,
Template: Misc.getResourceUri('ui/popover-separator.ui'),
InternalChildren: ['middle_label'],
Properties: {
'label': GObject.ParamSpec.string(
@@ -138,7 +138,7 @@ class ClapperPopoverButtonBase extends Gtk.MenuButton
var ElapsedTimeButton = GObject.registerClass({
GTypeName: 'ClapperElapsedTimeButton',
Template: `file://${Misc.getClapperPath()}/ui/elapsed-time-button.ui`,
Template: Misc.getResourceUri('ui/elapsed-time-button.ui'),
Children: ['scrolledWindow', 'speedScale'],
},
class ClapperElapsedTimeButton extends PopoverButtonBase
@@ -177,7 +177,7 @@ class ClapperElapsedTimeButton extends PopoverButtonBase
var TrackSelectButton = GObject.registerClass({
GTypeName: 'ClapperTrackSelectButton',
Template: `file://${Misc.getClapperPath()}/ui/track-select-button.ui`,
Template: Misc.getResourceUri('ui/track-select-button.ui'),
Children: ['popoverBox'],
InternalChildren: ['scrolled_window', 'decoder_separator'],
},
@@ -204,7 +204,7 @@ class ClapperTrackSelectButton extends PopoverButtonBase
var VolumeButton = GObject.registerClass({
GTypeName: 'ClapperVolumeButton',
Template: `file://${Misc.getClapperPath()}/ui/volume-button.ui`,
Template: Misc.getResourceUri('ui/volume-button.ui'),
Children: ['volumeScale'],
},
class ClapperVolumeButton extends PopoverButtonBase