WindowAttr #127

Merged
merged 2 commits into from Jul 25, 2016

Projects

None yet

3 participants

@EPashkin
Member

Rename Attributes to WindowAttr, implement Default
Fixes #126
Related to gtk-rs/gtk#366

@EPashkin EPashkin changed the title from Window attr to WindowAttr Jul 23, 2016
@GuillaumeGomez
Member

๐Ÿ‘

@gkoz gkoz and 1 other commented on an outdated diff Jul 23, 2016
src/window.rs
@@ -42,7 +42,26 @@ pub struct Attributes {
pub type_hint: Option<WindowTypeHint>,
}
-impl Attributes {
+impl Default for WindowAttr {
+ fn default () -> WindowAttr {
+ WindowAttr {
+ title: None,
+ event_mask: 0,
+ x: None,
+ y: None,
+ width: 800,
+ height: 600,
@gkoz
gkoz Jul 23, 2016 Member

These a are bit concerning to me. Wouldn't 'neutral' values be smaller somewhere between 100 and 400?

@EPashkin
EPashkin Jul 23, 2016 Member

400x300 ?

@gkoz
gkoz Jul 23, 2016 Member

๐Ÿ‘

BTW, this might be a good occasion to make these fields unsigned.

@EPashkin
EPashkin Jul 23, 2016 Member

And event_mask ?

@EPashkin
EPashkin Jul 23, 2016 Member

No, IMHO x and y can be negative

@EPashkin
EPashkin Jul 23, 2016 Member

After checking, too many width\heights signed so better don't make unsigned in one place.

@gkoz
Member
gkoz commented Jul 23, 2016

Apparently check_init_asserts is unhappy.

@EPashkin EPashkin Implement Default for WindowAttr
eeb581f
@EPashkin
Member

Updated

@GuillaumeGomez
Member

Seems good for me. I'll let @gkoz handles the merge. ;)

@gkoz gkoz merged commit a6f6a67 into gtk-rs:master Jul 25, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gkoz
Member
gkoz commented Jul 25, 2016

Thanks!

@EPashkin EPashkin deleted the EPashkin:window_attr branch Jul 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment