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

Add subclass support for Fixed #955

Merged
merged 3 commits into from Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/subclass/fixed.rs
@@ -0,0 +1,17 @@
// Copyright 2020, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>

use glib::subclass::prelude::*;
Copy link
Member

Choose a reason for hiding this comment

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

Please add the header we use in other files here as well.


use super::container::ContainerImpl;
use ContainerClass;
use FixedClass;

pub trait FixedImpl: ContainerImpl + 'static {}

unsafe impl<T: ObjectSubclass + FixedImpl> IsSubclassable<T> for FixedClass {
fn override_vfuncs(&mut self) {
<ContainerClass as IsSubclassable<T>>::override_vfuncs(self);
}
}
2 changes: 2 additions & 0 deletions src/subclass/mod.rs
Expand Up @@ -19,6 +19,7 @@ pub mod container;
pub mod dialog;
pub mod drawing_area;
pub mod event_box;
pub mod fixed;
pub mod header_bar;
pub mod icon_view;
pub mod stack;
Expand All @@ -43,6 +44,7 @@ pub mod prelude {
pub use super::dialog::DialogImpl;
pub use super::drawing_area::DrawingAreaImpl;
pub use super::event_box::EventBoxImpl;
pub use super::fixed::FixedImpl;
pub use super::header_bar::HeaderBarImpl;
pub use super::icon_view::IconViewImpl;
pub use super::stack::StackImpl;
Expand Down