зеркало из https://github.com/electron/electron.git
feat: add label property to Display objects (#36855)
This commit is contained in:
Родитель
a7bc579220
Коммит
2c56a06ad3
|
@ -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');
|
||||
|
|
Загрузка…
Ссылка в новой задаче