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 text::Text;
|
||||||
|
|
||||||
use gtk::{prelude::BoxExt, Box, Orientation};
|
use gtk::{
|
||||||
|
prelude::{BoxExt, WidgetExt},
|
||||||
|
Box, Orientation,
|
||||||
|
};
|
||||||
|
|
||||||
pub enum Mime {
|
pub enum Mime {
|
||||||
Undefined,
|
Undefined,
|
||||||
@ -27,7 +30,12 @@ impl Content {
|
|||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn reset(&self, mime: Mime, data: &str) {
|
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 {
|
match mime {
|
||||||
Mime::TextGemini => {
|
Mime::TextGemini => {
|
||||||
let child = Text::gemini(data);
|
let child = Text::gemini(data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user