You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
921 B
39 lines
921 B
use adw::subclass::prelude::*; |
|
use gtk::glib; |
|
|
|
mod imp { |
|
use super::*; |
|
|
|
#[derive(Debug, Default)] |
|
pub struct CustomEntry {} |
|
|
|
#[glib::object_subclass] |
|
impl ObjectSubclass for CustomEntry { |
|
const NAME: &'static str = "CustomEntry"; |
|
type Type = super::CustomEntry; |
|
type ParentType = adw::Bin; |
|
|
|
fn class_init(klass: &mut Self::Class) { |
|
klass.set_css_name("entry"); |
|
} |
|
} |
|
|
|
impl ObjectImpl for CustomEntry {} |
|
impl WidgetImpl for CustomEntry {} |
|
impl BinImpl for CustomEntry {} |
|
} |
|
|
|
glib::wrapper! { |
|
/// Wrapper object acting as an entry. |
|
/// |
|
/// Wrap your custom widgets with CustomEntry to get stock entry styling and |
|
/// behavior for free. |
|
pub struct CustomEntry(ObjectSubclass<imp::CustomEntry>) |
|
@extends gtk::Widget, adw::Bin; |
|
} |
|
|
|
impl CustomEntry { |
|
pub fn new() -> Self { |
|
glib::Object::new() |
|
} |
|
}
|
|
|