|
|
|
|
@ -321,53 +321,70 @@ int yon_ubl_status_box_despawn_infinite(GtkContainer *container){
|
|
|
|
|
GThread *thread = g_thread_new("StatusThread",(GThreadFunc)_yon_ubl_status_box_despawn_infinite,container);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *__yon_ubl_status_box_despawn(GtkContainer *status_container){
|
|
|
|
|
GList *list = gtk_container_get_children(status_container);
|
|
|
|
|
GtkWidget *revealer = g_list_nth_data(list,0);
|
|
|
|
|
struct temp_statusbox *statusstruct = malloc(sizeof(struct temp_statusbox));
|
|
|
|
|
statusstruct->revealer = revealer;
|
|
|
|
|
statusstruct->times = 0;
|
|
|
|
|
g_idle_add((GSourceFunc)yon_ubl_status_hide_revealer,statusstruct);
|
|
|
|
|
sleep(1);
|
|
|
|
|
gtk_widget_destroy(statusstruct->revealer);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_ubl_status_box_despawn(GtkContainer *status_container){
|
|
|
|
|
g_thread_new("status_despawn",(GThreadFunc)__yon_ubl_status_box_despawn,status_container);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int timeout,BACKGROUND_IMAGE_TYPE type){
|
|
|
|
|
g_mutex_lock(&_render_block_mutex);
|
|
|
|
|
int blocked = _render_blocked;
|
|
|
|
|
g_mutex_unlock(&_render_block_mutex);
|
|
|
|
|
if (blocked) return;
|
|
|
|
|
if (!gtk_container_get_children(container)){
|
|
|
|
|
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5);
|
|
|
|
|
GtkWidget *revealer = gtk_revealer_new();
|
|
|
|
|
GtkWidget *label = gtk_label_new("");
|
|
|
|
|
GtkWidget *icon = gtk_image_new();
|
|
|
|
|
gtk_label_set_line_wrap(GTK_LABEL(label),1);
|
|
|
|
|
gtk_label_set_line_wrap_mode(GTK_LABEL(label),PANGO_WRAP_WORD);
|
|
|
|
|
gtk_container_add(GTK_CONTAINER(revealer),box);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(box),icon,0,0,5);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(box),label,0,0,5);
|
|
|
|
|
gtk_container_add(container,revealer);
|
|
|
|
|
|
|
|
|
|
gtk_widget_show_all(revealer);
|
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(revealer),1);
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_margin_bottom(label,9);
|
|
|
|
|
gtk_widget_set_margin_top(label,9);
|
|
|
|
|
gtk_label_set_xalign(GTK_LABEL(label),0.0);
|
|
|
|
|
PangoAttrList *attributes = pango_attr_list_new();
|
|
|
|
|
PangoAttribute *boldAttr = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
|
|
|
|
|
pango_attr_list_insert(attributes, boldAttr);
|
|
|
|
|
gtk_label_set_attributes(GTK_LABEL(label),attributes);
|
|
|
|
|
if (gtk_container_get_children(container)){
|
|
|
|
|
|
|
|
|
|
GdkRGBA textColor;
|
|
|
|
|
gdk_rgba_parse(&textColor, "#4d4d4d4d4d4d");
|
|
|
|
|
PangoAttribute *colorAttr = pango_attr_foreground_new(
|
|
|
|
|
(int)(textColor.red * 65535),
|
|
|
|
|
(int)(textColor.green * 65535),
|
|
|
|
|
(int)(textColor.blue * 65535)
|
|
|
|
|
);
|
|
|
|
|
pango_attr_list_insert(attributes, colorAttr);
|
|
|
|
|
|
|
|
|
|
yon_ubl_status_box_set(type,box,GTK_IMAGE(icon));
|
|
|
|
|
if (display_text)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(label),display_text);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5);
|
|
|
|
|
GtkWidget *revealer = gtk_revealer_new();
|
|
|
|
|
GtkWidget *label = gtk_label_new("");
|
|
|
|
|
GtkWidget *icon = gtk_image_new();
|
|
|
|
|
gtk_label_set_line_wrap(GTK_LABEL(label),1);
|
|
|
|
|
gtk_label_set_line_wrap_mode(GTK_LABEL(label),PANGO_WRAP_WORD);
|
|
|
|
|
gtk_container_add(GTK_CONTAINER(revealer),box);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(box),icon,0,0,5);
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(box),label,0,0,5);
|
|
|
|
|
gtk_container_add(container,revealer);
|
|
|
|
|
|
|
|
|
|
gtk_widget_show_all(revealer);
|
|
|
|
|
gtk_revealer_set_reveal_child(GTK_REVEALER(revealer),1);
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_margin_bottom(label,9);
|
|
|
|
|
gtk_widget_set_margin_top(label,9);
|
|
|
|
|
gtk_label_set_xalign(GTK_LABEL(label),0.0);
|
|
|
|
|
PangoAttrList *attributes = pango_attr_list_new();
|
|
|
|
|
PangoAttribute *boldAttr = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
|
|
|
|
|
pango_attr_list_insert(attributes, boldAttr);
|
|
|
|
|
gtk_label_set_attributes(GTK_LABEL(label),attributes);
|
|
|
|
|
|
|
|
|
|
GdkRGBA textColor;
|
|
|
|
|
gdk_rgba_parse(&textColor, "#4d4d4d4d4d4d");
|
|
|
|
|
PangoAttribute *colorAttr = pango_attr_foreground_new(
|
|
|
|
|
(int)(textColor.red * 65535),
|
|
|
|
|
(int)(textColor.green * 65535),
|
|
|
|
|
(int)(textColor.blue * 65535)
|
|
|
|
|
);
|
|
|
|
|
pango_attr_list_insert(attributes, colorAttr);
|
|
|
|
|
|
|
|
|
|
yon_ubl_status_box_set(type,box,GTK_IMAGE(icon));
|
|
|
|
|
if (display_text)
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(label),display_text);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int yon_ubl_status_set_text(GtkContainer *status_placeholder,char *text){
|
|
|
|
|
|