Update extension position with panel-box-index

Let the user to chose where to place the extension button within each
panel box.
From the left (with default orientation, otherwise from the right) as:
- 0, first
- 1, second
- ...
- -1, last

Note: gschema compilation needed.
This commit is contained in:
l3nn4rt
2019-09-23 14:21:00 +02:00
parent ac768a748c
commit 39d844a324

View File

@@ -106,6 +106,7 @@ const FreonMenuButton = GObject.registerClass(class Freon_FreonMenuButton extend
this._addSettingChangedSignal('drive-utility', this._driveUtilityChanged.bind(this));
this._addSettingChangedSignal('gpu-utility', this._gpuUtilityChanged.bind(this));
this._addSettingChangedSignal('position-in-panel', this._positionInPanelChanged.bind(this));
this._addSettingChangedSignal('panel-box-index', this._positionInPanelChanged.bind(this));
this._addSettingChangedSignal('group-temperature', this._querySensors.bind(this))
this._addSettingChangedSignal('group-voltage', this._rerender.bind(this))
@@ -161,7 +162,8 @@ const FreonMenuButton = GObject.registerClass(class Freon_FreonMenuButton extend
};
let p = this.positionInPanel;
boxes[p].insert_child_at_index(this.container, p == 'right' ? 0 : -1)
let i = this._settings.get_int('panel-box-index');
boxes[p].insert_child_at_index(this.container, i);
}
_showIconOnPanelChanged(){