mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add label property to Display objects (#36932)
Co-authored-by: Milan Burda <milan.burda@gmail.com> Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -144,6 +144,7 @@ v8::Local<v8::Value> Converter<display::Display>::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());
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user