Commit 4555b661 authored by Tobias Bernard's avatar Tobias Bernard

Message bubbles: de-duplicate CSS, nicer shadows, color tweaks

parent 28fa1d34
Pipeline #21018 passed with stages
in 3 minutes and 56 seconds
......@@ -81,77 +81,6 @@ header_strings_t header_strings[3] = {
},
};
static void
init_css (void)
{
GdkScreen *screen;
GtkCssProvider *cssProvider;
screen = gdk_screen_get_default ();
cssProvider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (cssProvider),
" .message_list {\n"
" color: black;\n"
" background-color: white;\n"
"}\n"
" .bubble_green {\n"
" font-size: 17px;\n"
" background-color: #e0fad0;\n"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);\n"
" border-radius: 6px;\n"
" padding-left: 10px;\n"
" padding-right: 10px;\n"
" padding-top: 8px;\n"
" padding-bottom: 8px;\n"
"}\n"
" .bubble_blue {\n"
" font-size: 17px;\n"
" color: black;\n"
" background-color: #e4f0fc;\n"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);\n"
" border-radius: 6px;\n"
" padding-left: 10px;\n"
" padding-right: 10px;\n"
" padding-top: 8px;\n"
" padding-bottom: 8px;\n"
"}\n"
" .bubble_purple {\n"
" font-size: 14px;\n"
" color: white;\n"
" background-color: #862d86;\n"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);\n"
" border-radius: 6px;\n"
" padding-left: 10px;\n"
" padding-right: 10px;\n"
" padding-top: 8px;\n"
" padding-bottom: 8px;\n"
"}\n"
" .bubble_white {\n"
" font-size: 17px;\n"
" color: black;\n"
" background-color: white;\n"
" box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.3);\n"
" border-radius: 6px;\n"
" padding-left: 10px;\n"
" padding-right: 10px;\n"
" padding-top: 8px;\n"
" padding-bottom: 8px;\n"
"}\n"
" .label_disclaim {\n"
" font-size: 16px;\n"
" font-weight: bold;\n"
" padding-top: 120px;\n"
" padding-bottom: 20px;\n"
"}\n", -1, NULL);
gtk_style_context_add_provider_for_screen (screen,
GTK_STYLE_PROVIDER(cssProvider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
static void
msg_list_cmd_copy (GSimpleAction *action,
GVariant *parameter,
......@@ -688,6 +617,7 @@ chatty_msg_list_add_message (ChattyMsgList *self,
}
sc = gtk_widget_get_style_context (GTK_WIDGET(label_msg));
gtk_style_context_add_class (sc, "message_bubble");
gtk_style_context_add_class (sc, style);
gtk_box_pack_start (vbox, GTK_WIDGET(ebox), FALSE, FALSE, 0);
......@@ -734,8 +664,6 @@ chatty_msg_list_constructed (GObject *object)
ChattyMsgListPrivate *priv = chatty_msg_list_get_instance_private (self);
const gchar *path;
init_css();
sc = gtk_widget_get_style_context (GTK_WIDGET(priv->list));
gtk_style_context_add_class (sc, "message_list");
......
......@@ -77,3 +77,46 @@
.list_select:selected {
background-color: #f5f5f5;
}
/* MESSAGE LIST AND BUBBLES */
.message_list {
color: black;
background-color: white;
}
.message_bubble {
font-size: 16px;
color: black;
border-radius: 9px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
padding-top: 6px;
padding-bottom: 6px;
padding-left: 10px;
padding-right: 10px;
}
.bubble_white {
background-color: white;
}
.bubble_blue {
background-color: #e4f0fc;
}
.bubble_green {
background-color: #e2fae7;
}
.bubble_purple {
font-size: 14px;
color: white;
background-color: #862d86;
}
.label_disclaim {
font-size: 16px;
font-weight: bold;
padding-top: 120px;
padding-bottom: 20px;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment