cleanup: Use consistent style for GObject property definitions

Go with the style preferred by gjs.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608
This commit is contained in:
Florian Müllner 2019-01-29 19:15:23 +01:00 committed by Georges Basile Stavracas Neto
parent 02db21fc55
commit 6f8dd065a4
4 changed files with 46 additions and 38 deletions

View File

@ -32,18 +32,20 @@ function isPopupMetaWindow(actor) {
} }
var MonitorConstraint = GObject.registerClass({ var MonitorConstraint = GObject.registerClass({
Properties: {'primary': GObject.ParamSpec.boolean('primary', Properties: {
'Primary', 'Track primary monitor', 'primary': GObject.ParamSpec.boolean('primary',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, 'Primary', 'Track primary monitor',
false), GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
'index': GObject.ParamSpec.int('index', false),
'Monitor index', 'Track specific monitor', 'index': GObject.ParamSpec.int('index',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, 'Monitor index', 'Track specific monitor',
-1, 64, -1), GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
'work-area': GObject.ParamSpec.boolean('work-area', -1, 64, -1),
'Work-area', 'Track monitor\'s work-area', 'work-area': GObject.ParamSpec.boolean('work-area',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, 'Work-area', 'Track monitor\'s work-area',
false)}, GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
false)
},
}, class MonitorConstraint extends Clutter.Constraint { }, class MonitorConstraint extends Clutter.Constraint {
_init(props) { _init(props) {
this._primary = false; this._primary = false;

View File

@ -197,12 +197,14 @@ class ScaleLayout extends Clutter.BinLayout {
}); });
var LabelExpanderLayout = GObject.registerClass({ var LabelExpanderLayout = GObject.registerClass({
Properties: { 'expansion': GObject.ParamSpec.double('expansion', Properties: {
'Expansion', 'expansion': GObject.ParamSpec.double('expansion',
'Expansion of the layout, between 0 (collapsed) ' + 'Expansion',
'and 1 (fully expanded', 'Expansion of the layout, between 0 (collapsed) ' +
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE, 'and 1 (fully expanded',
0, 1, 0) }, GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
0, 1, 0)
},
}, class LabelExpanderLayout extends Clutter.LayoutManager { }, class LabelExpanderLayout extends Clutter.LayoutManager {
_init(params) { _init(params) {
this._expansion = 0; this._expansion = 0;

View File

@ -21,11 +21,13 @@ var State = {
}; };
var ModalDialog = GObject.registerClass({ var ModalDialog = GObject.registerClass({
Properties: { 'state': GObject.ParamSpec.int('state', 'Dialog state', 'state', Properties: {
GObject.ParamFlags.READABLE, 'state': GObject.ParamSpec.int('state', 'Dialog state', 'state',
Math.min(...Object.values(State)), GObject.ParamFlags.READABLE,
Math.max(...Object.values(State)), Math.min(...Object.values(State)),
State.CLOSED) }, Math.max(...Object.values(State)),
State.CLOSED)
},
Signals: { 'opened': {}, 'closed': {} } Signals: { 'opened': {}, 'closed': {} }
}, class ModalDialog extends St.Widget { }, class ModalDialog extends St.Widget {
_init(params) { _init(params) {

View File

@ -275,21 +275,23 @@ var ActionEditor = class {
Signals.addSignalMethods(ActionEditor.prototype); Signals.addSignalMethods(ActionEditor.prototype);
var PadDiagram = GObject.registerClass({ var PadDiagram = GObject.registerClass({
Properties: { 'left-handed': GObject.ParamSpec.boolean('left-handed', Properties: {
'left-handed', 'Left handed', 'left-handed': GObject.ParamSpec.boolean('left-handed',
GObject.ParamFlags.READWRITE | 'left-handed', 'Left handed',
GObject.ParamFlags.CONSTRUCT_ONLY, GObject.ParamFlags.READWRITE |
false), GObject.ParamFlags.CONSTRUCT_ONLY,
'image': GObject.ParamSpec.string('image', 'image', 'Image', false),
GObject.ParamFlags.READWRITE | 'image': GObject.ParamSpec.string('image', 'image', 'Image',
GObject.ParamFlags.CONSTRUCT_ONLY, GObject.ParamFlags.READWRITE |
null), GObject.ParamFlags.CONSTRUCT_ONLY,
'editor-actor': GObject.ParamSpec.object('editor-actor', null),
'editor-actor', 'editor-actor': GObject.ParamSpec.object('editor-actor',
'Editor actor', 'editor-actor',
GObject.ParamFlags.READWRITE | 'Editor actor',
GObject.ParamFlags.CONSTRUCT_ONLY, GObject.ParamFlags.READWRITE |
Clutter.Actor.$gtype) }, GObject.ParamFlags.CONSTRUCT_ONLY,
Clutter.Actor.$gtype)
},
}, class PadDiagram extends St.DrawingArea { }, class PadDiagram extends St.DrawingArea {
_init(params) { _init(params) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/pad-osd.css'); let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/pad-osd.css');