Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Issue #862 - Add size_allocate vfunc to gtk::Widget #959

Closed
wants to merge 1 commit into from

Conversation

hfiguiere
Copy link
Contributor

(patch is against 0.8 but should go into master too)

@hfiguiere
Copy link
Contributor Author

Uh sorry I forgot a change by mistake. It's now in.

@EPashkin
Copy link
Member

Is not better add it against master branch and then mass cherry-pick it on next minor release ?

@sdroege
Copy link
Member

sdroege commented Feb 21, 2020

Yes, please update this to the master branch. Everything should first go to master :)

@@ -209,6 +210,10 @@ pub trait WidgetImpl: WidgetImplExt + ObjectImpl + 'static {
fn get_preferred_height_for_width(&self, widget: &Widget, width: i32) -> (i32, i32) {
self.parent_get_preferred_height_for_width(widget, width)
}

fn size_allocate(&self, widget: &Widget, allocation: &mut Allocation) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a mutable reference? In GTK it's all const. AFAIU this gives the allocation to the subclass, not returns the allocation from the subclass.

Also the gtk_widget_size_allocate() function should probably be exposed at the same time.

Copy link
Contributor Author

@hfiguiere hfiguiere Feb 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is exposed as gtk::WidgetExt::size_allocate. or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a mutable reference? In GTK it's all const. AFAIU this gives the allocation to the subclass, not returns the allocation from the subclass.

See PR #961

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

@hfiguiere
Copy link
Contributor Author

Replaced by PR #961

@hfiguiere hfiguiere closed this Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants