|
|
|
|
@ -101,17 +101,30 @@ void yon_ubl_status_list_store_highlight_incorrect(GtkListStore *list, GtkTreeIt
|
|
|
|
|
struct temp_statusbox {
|
|
|
|
|
int times;
|
|
|
|
|
GtkWidget *revealer;
|
|
|
|
|
int window_height;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static char *yon_status_thread_id=NULL;
|
|
|
|
|
|
|
|
|
|
gboolean yon_ubl_status_hide_revealer(struct temp_statusbox *statusstruct){
|
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(statusstruct->revealer),0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean yon_ubl_status_destroy_status(struct temp_statusbox *statusstruct){
|
|
|
|
|
GtkWidget *window = gtk_widget_get_toplevel(statusstruct->revealer);
|
|
|
|
|
gtk_widget_destroy(statusstruct->revealer);
|
|
|
|
|
int width, height;
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(window),&width,NULL);
|
|
|
|
|
gtk_window_resize(GTK_WINDOW(window),width,statusstruct->window_height);
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _yon_ubl_status_box_timed_remove(struct temp_statusbox *statusstruct){
|
|
|
|
|
sleep(statusstruct->times);
|
|
|
|
|
if (statusstruct->revealer){
|
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(statusstruct->revealer),0);
|
|
|
|
|
g_idle_add((GSourceFunc)yon_ubl_status_hide_revealer,statusstruct);
|
|
|
|
|
sleep(1);
|
|
|
|
|
gtk_widget_destroy(statusstruct->revealer);
|
|
|
|
|
|
|
|
|
|
g_idle_add((GSourceFunc)yon_ubl_status_destroy_status,statusstruct);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -178,6 +191,7 @@ int yon_ubl_status_box_spawn_infinite(GtkContainer *container, char *status_id,
|
|
|
|
|
struct temp_statusbox *statusstruct = malloc(sizeof(struct temp_statusbox));
|
|
|
|
|
g_signal_connect(G_OBJECT(revealer),"destroy", G_CALLBACK(__yon_ubl_status_box_destroyed),statusstruct);
|
|
|
|
|
statusstruct->revealer = revealer;
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(gtk_widget_get_toplevel(revealer)),NULL,&statusstruct->window_height);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -251,6 +265,7 @@ void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int ti
|
|
|
|
|
struct temp_statusbox *statusstruct = malloc(sizeof(struct temp_statusbox));
|
|
|
|
|
statusstruct->revealer = revealer;
|
|
|
|
|
statusstruct->times = timeout;
|
|
|
|
|
gtk_window_get_size(GTK_WINDOW(gtk_widget_get_toplevel(revealer)),NULL,&statusstruct->window_height);
|
|
|
|
|
g_signal_connect(G_OBJECT(revealer),"destroy", G_CALLBACK(__yon_ubl_status_box_destroyed),statusstruct);
|
|
|
|
|
GThread *thread = g_thread_new("StatusThread",(GThreadFunc)_yon_ubl_status_box_timed_remove,statusstruct);
|
|
|
|
|
}
|
|
|
|
|
|