summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-01-31 19:35:49 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-01-31 19:39:20 +0530
commit96f597acf70ce52f2bdb59c85dd052be54b8d629 (patch)
tree3a6112858ffc0da1e400c682a45fc625c0f6ef1b /libreofficekit
parent0270018b683b2734ba60771e777aa71f873f7252 (diff)
gtktiledviewer: gtk version checks
There is no major harm in excluding these lines of code on platforms with older gtk. Change-Id: Ica3f1e2b4f60f0bab55254632663ace7b4c61d4d
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 430742637f51..675341f6ee23 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -258,8 +258,9 @@ static void userPromptDialog(GtkWidget* pDocView, const std::string& aTitle, std
for (const auto& entry : aEntries)
{
GtkWidget* pEntry = gtk_entry_new();
+#if GTK_CHECK_VERSION(3,2,0)
gtk_entry_set_placeholder_text(GTK_ENTRY(pEntry), entry.first.c_str());
-
+#endif
gtk_container_add(GTK_CONTAINER(pEntryArea), pEntry);
}
@@ -447,9 +448,11 @@ 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");
+#if GTK_CHECK_VERSION(3,12,0)
// 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);
+#endif
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);
@@ -691,15 +694,21 @@ static void addMoreUnoParam(GtkWidget* /*pWidget*/, gpointer userdata)
GtkWidget* pTypeEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pParamContainer), pTypeEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
gtk_entry_set_placeholder_text(GTK_ENTRY(pTypeEntry), "Param type (Eg. boolean, string etc.)");
+#endif
GtkWidget* pNameEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pParamContainer), pNameEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
gtk_entry_set_placeholder_text(GTK_ENTRY(pNameEntry), "Param name");
+#endif
GtkWidget* pValueEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(pParamContainer), pValueEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
gtk_entry_set_placeholder_text(GTK_ENTRY(pValueEntry), "Param value");
+#endif
GtkWidget* pRemoveButton = gtk_button_new_from_icon_name("list-remove-symbolic", GTK_ICON_SIZE_BUTTON);
g_signal_connect(pRemoveButton, "clicked", G_CALLBACK(removeUnoParam), pUnoParamAreaBox);
@@ -942,8 +951,9 @@ static void unoCommandDebugger(GtkWidget* pButton, gpointer /* pItem */)
GtkWidget* pUnoCmdEntry = gtk_entry_new ();
gtk_box_pack_start(GTK_BOX(pUnoCmdAreaBox), pUnoCmdEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
gtk_entry_set_placeholder_text(GTK_ENTRY(pUnoCmdEntry), "UNO command (Eg. Bold, Italic etc.)");
-
+#endif
GtkWidget* pUnoParamAreaBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start(GTK_BOX(pDialogMessageArea), pUnoParamAreaBox, TRUE, TRUE, 2);