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