diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-30 15:00:02 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-30 17:50:32 +0530 |
commit | a9153b4e1c00f7e85e50c333fdba94cc5601acb8 (patch) | |
tree | df9622ae38f343ecbdac2e94bf744a3f3098d353 /libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | |
parent | bc713d0670b02c9f267fcf1e5f3373525bcda047 (diff) |
gtktiledviewer: Mark reply comments with lightgreen background
Change-Id: Ic6623ebc05f1a09d5fc1b6bae5fab149d98724ab
Diffstat (limited to 'libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx')
-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 bfdaea5e760c..4381fc5fa1a4 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -354,6 +354,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()); @@ -437,6 +447,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); |