Fix timer

This commit is contained in:
daleclack 2023-11-08 17:31:52 +08:00
parent eec32edb4d
commit dc5ad08c15
3 changed files with 10 additions and 4 deletions

View File

@ -8,13 +8,13 @@
/* @import url("resource://org/gtk/daleclack/reset.css"); */
.finder_box{
background-color:alpha(gray,0.7);
background-color:alpha(white,0.7);
}
.finder_separator{
background-color:alpha(gray,0.7);
background-color:alpha(white ,0.7);
}
label{
color:black;
color:rgb(35, 27, 27);
}

View File

@ -106,6 +106,12 @@ static void my_dock_init(MyDock *self)
self->finder = my_finder_new(GTK_ORIENTATION_HORIZONTAL, 5);
gtk_box_append(GTK_BOX(self->finder_box), self->finder);
GtkCssProvider *provider = gtk_css_provider_new();
gtk_css_provider_load_from_resource(provider, "/org/gtk/daleclack/style.css");
gtk_widget_add_css_class(self->finder, ".finder_box");
gtk_style_context_add_provider_for_display(gtk_widget_get_display(self->finder),
GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
// Link Signals
g_signal_connect(self->btnlaunch, "clicked", G_CALLBACK(btnlaunch_clicked), self);

View File

@ -40,7 +40,7 @@ static gboolean timeout_func(gpointer data)
struct tm *local;
local = localtime(&t);
char time_data[57];
snprintf(time_data, sizeof(time_data), "%d/%d/%d %d:%d:%d", local->tm_year + 1900,
snprintf(time_data, sizeof(time_data), "%04d/%02d/%02d %02d:%02d:%02d", local->tm_year + 1900,
local->tm_mon + 1, local->tm_mday, local->tm_hour, local->tm_min, local->tm_sec);
gtk_label_set_label(GTK_LABEL(data), time_data);
return TRUE;