diff --git a/docs/api/structures/display.md b/docs/api/structures/display.md index 8782d34d1b4..37dfa26b7ae 100644 --- a/docs/api/structures/display.md +++ b/docs/api/structures/display.md @@ -1,6 +1,7 @@ # Display Object * `id` number - Unique identifier associated with the display. +* `label` string - User-friendly label, determined by the platform. * `rotation` number - Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees. * `scaleFactor` number - Output device's pixel scale factor. diff --git a/shell/common/gin_converters/gfx_converter.cc b/shell/common/gin_converters/gfx_converter.cc index 23c7d873893..4fc3294323f 100644 --- a/shell/common/gin_converters/gfx_converter.cc +++ b/shell/common/gin_converters/gfx_converter.cc @@ -144,6 +144,7 @@ v8::Local Converter::ToV8( gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("id", val.id()); + dict.Set("label", val.label()); dict.Set("bounds", val.bounds()); dict.Set("workArea", val.work_area()); dict.Set("accelerometerSupport", val.accelerometer_support()); diff --git a/spec/api-screen-spec.ts b/spec/api-screen-spec.ts index 102e68155d2..2f6631e454c 100644 --- a/spec/api-screen-spec.ts +++ b/spec/api-screen-spec.ts @@ -34,6 +34,7 @@ describe('screen module', () => { expect(display).to.have.property('scaleFactor').that.is.a('number'); expect(display).to.have.property('id').that.is.a('number'); + expect(display).to.have.property('label').that.is.a('string'); expect(display).to.have.property('rotation').that.is.a('number'); expect(display).to.have.property('touchSupport').that.is.a('string'); expect(display).to.have.property('accelerometerSupport').that.is.a('string');