diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-30 15:00:02 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-18 00:51:21 +0100 |
commit | a5a115a92184774b6b25b4d3f2fffd66a2fa3a2b (patch) | |
tree | 573925e2b6a6f9690ad93cac9126c132b5826209 /libreofficekit | |
parent | 8749daf7ccbe884018b997ed01c7ffdc723e6f0b (diff) |
gtktiledviewer: Mark reply comments with lightgreen background
Change-Id: Ic6623ebc05f1a09d5fc1b6bae5fab149d98724ab
(cherry picked from commit a9153b4e1c00f7e85e50c333fdba94cc5601acb8)
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 5c6e6f9bc8ce..95de95140644 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -353,6 +353,16 @@ GtkWidget* CommentsSidebar::createCommentBox(const boost::property_tree::ptree& *id = aComment.get<int>("id"); g_object_set_data_full(G_OBJECT(pCommentVBox), "id", id, g_free); + // Set left-margin if its a reply comment + if (aComment.get<int>("parent") > 0) + { + GtkStyleContext* pStyleContext = gtk_widget_get_style_context(pCommentVBox); + GtkCssProvider* pCssProvider = gtk_css_provider_get_default(); + gtk_style_context_add_class(pStyleContext, "commentbox"); + gtk_style_context_add_provider(pStyleContext, GTK_STYLE_PROVIDER(pCssProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_css_provider_load_from_data(pCssProvider, ".commentbox {background-color: lightgreen;}", -1, nullptr); + } + GtkWidget* pCommentText = gtk_label_new(aComment.get<std::string>("text").c_str()); GtkWidget* pCommentAuthor = gtk_label_new(aComment.get<std::string>("author").c_str()); GtkWidget* pCommentDate = gtk_label_new(aComment.get<std::string>("dateTime").c_str()); @@ -436,6 +446,9 @@ gboolean CommentsSidebar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfigu gtk_container_add(GTK_CONTAINER(rWindow.m_pMainHBox), rWindow.m_pCommentsSidebar->m_pMainVBox); rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton = gtk_button_new_with_label(".uno:ViewAnnotations"); + // Hack to make sidebar grid wide enough to not need any horizontal scrollbar + gtk_widget_set_margin_start(rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton, 20); + gtk_widget_set_margin_end(rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton, 20); gtk_container_add(GTK_CONTAINER(rWindow.m_pCommentsSidebar->m_pMainVBox), rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton); g_signal_connect(rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton, "clicked", G_CALLBACK(CommentsSidebar::unoViewAnnotations), nullptr); |