mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 07:54:14 +00:00
use adw Clamp for input
This commit is contained in:
parent
9be583044f
commit
78c2765d2a
@ -4,7 +4,7 @@ mod widget;
|
||||
use content::Content;
|
||||
use widget::Widget;
|
||||
|
||||
use adw::ToolbarView;
|
||||
use adw::Clamp;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Input {
|
||||
@ -32,7 +32,7 @@ impl Input {
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gobject(&self) -> &ToolbarView {
|
||||
pub fn gobject(&self) -> &Clamp {
|
||||
&self.widget.gobject()
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc() -> Arc<Self> {
|
||||
let gobject = Button::builder()
|
||||
.css_classes(["accent"])
|
||||
//.css_classes(["accent"])
|
||||
.halign(Align::End)
|
||||
.label("Send")
|
||||
.build();
|
||||
|
@ -1,16 +1,18 @@
|
||||
use adw::ToolbarView;
|
||||
use adw::Clamp;
|
||||
use gtk::{prelude::WidgetExt, Box};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Widget {
|
||||
gobject: ToolbarView,
|
||||
gobject: Clamp,
|
||||
}
|
||||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_arc(content: &Box) -> Arc<Self> {
|
||||
let gobject = ToolbarView::builder()
|
||||
.content(content)
|
||||
pub fn new_arc(child: &Box) -> Arc<Self> {
|
||||
let gobject = Clamp::builder()
|
||||
.child(child)
|
||||
.css_classes(["app-notification"])
|
||||
.maximum_size(800)
|
||||
.visible(false)
|
||||
.build();
|
||||
|
||||
@ -23,7 +25,7 @@ impl Widget {
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gobject(&self) -> &ToolbarView {
|
||||
pub fn gobject(&self) -> &Clamp {
|
||||
&self.gobject
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use adw::ToolbarView;
|
||||
use adw::Clamp;
|
||||
use gtk::{
|
||||
gio::{SimpleAction, SimpleActionGroup},
|
||||
glib::uuid_string_random,
|
||||
@ -20,7 +20,7 @@ impl Widget {
|
||||
// Components
|
||||
navigation: &Box,
|
||||
content: &Box,
|
||||
input: &ToolbarView,
|
||||
input: &Clamp,
|
||||
) -> Arc<Self> {
|
||||
// Init additional action group
|
||||
let action_group = SimpleActionGroup::new();
|
||||
@ -33,8 +33,8 @@ impl Widget {
|
||||
.build();
|
||||
|
||||
gobject.append(navigation);
|
||||
gobject.append(input);
|
||||
gobject.append(content);
|
||||
gobject.append(input);
|
||||
|
||||
gobject.insert_action_group(&uuid_string_random(), Some(&action_group));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user