[gnome-logs] Add some simple styling to the detailed event view
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-logs] Add some simple styling to the detailed event view
- Date: Tue, 1 Oct 2013 12:48:25 +0000 (UTC)
commit f5da06e3d98eb0feeca678cbd7bea28087f2e6c3
Author: David King <davidk gnome org>
Date: Tue Oct 1 13:34:02 2013 +0100
Add some simple styling to the detailed event view
data/gl-style.css | 9 +++++++++
src/gl-eventview.c | 12 ++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/data/gl-style.css b/data/gl-style.css
index 13446db..3458ac2 100644
--- a/data/gl-style.css
+++ b/data/gl-style.css
@@ -18,6 +18,15 @@
padding: 10px;
}
+.detail-comm {
+ font-weight: bold;
+ padding: 10px;
+}
+
+.detail-catalog, .detail-time {
+ padding: 10px;
+}
+
.event {
padding: 5px;
}
diff --git a/src/gl-eventview.c b/src/gl-eventview.c
index c026548..03e54cf 100644
--- a/src/gl-eventview.c
+++ b/src/gl-eventview.c
@@ -157,6 +157,7 @@ on_listbox_row_activated (GtkListBox *listbox,
GDateTime *datetime;
GtkWidget *grid;
GtkWidget *label;
+ GtkStyleContext *style;
GtkStack *stack;
GtkWidget *toplevel;
@@ -225,6 +226,8 @@ on_listbox_row_activated (GtkListBox *listbox,
grid = gtk_grid_new ();
label = gtk_label_new (strchr (comm, '=') + 1);
+ style = gtk_widget_get_style_context (label);
+ gtk_style_context_add_class (style, "detail-comm");
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
ret = sd_journal_get_realtime_usec (journal, µsec);
@@ -255,11 +258,16 @@ on_listbox_row_activated (GtkListBox *listbox,
}
label = gtk_label_new (time);
- gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
+ gtk_widget_set_hexpand (label, TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ style = gtk_widget_get_style_context (label);
+ gtk_style_context_add_class (style, "detail-time");
+ gtk_grid_attach (GTK_GRID (grid), label, 1, 0, 1, 1);
g_free (time);
label = gtk_label_new (catalog);
- gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 2, 1);
gtk_widget_show_all (grid);
stack = GTK_STACK (view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]