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,7 +32,8 @@ function isPopupMetaWindow(actor) {
}
var MonitorConstraint = GObject.registerClass({
Properties: {'primary': GObject.ParamSpec.boolean('primary',
Properties: {
'primary': GObject.ParamSpec.boolean('primary',
'Primary', 'Track primary monitor',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
false),
@ -43,7 +44,8 @@ var MonitorConstraint = GObject.registerClass({
'work-area': GObject.ParamSpec.boolean('work-area',
'Work-area', 'Track monitor\'s work-area',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
false)},
false)
},
}, class MonitorConstraint extends Clutter.Constraint {
_init(props) {
this._primary = false;

View File

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

View File

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

View File

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