mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
cleanup previous content data
This commit is contained in:
parent
ae6fff72ac
commit
1d673029c0
@ -3,7 +3,10 @@ mod text;
|
||||
|
||||
use text::Text;
|
||||
|
||||
use gtk::{prelude::BoxExt, Box, Orientation};
|
||||
use gtk::{
|
||||
prelude::{BoxExt, WidgetExt},
|
||||
Box, Orientation,
|
||||
};
|
||||
|
||||
pub enum Mime {
|
||||
Undefined,
|
||||
@ -27,7 +30,12 @@ impl Content {
|
||||
|
||||
// Actions
|
||||
pub fn reset(&self, mime: Mime, data: &str) {
|
||||
//self.widget.remove(self.child.widget());
|
||||
// Cleanup
|
||||
while let Some(child) = self.widget.last_child() {
|
||||
self.widget.remove(&child)
|
||||
}
|
||||
|
||||
// Compose
|
||||
match mime {
|
||||
Mime::TextGemini => {
|
||||
let child = Text::gemini(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user