diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-31 19:35:49 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-18 00:52:14 +0100 |
commit | 55ec2440eba11b034c6617ac06e24003e8feae5c (patch) | |
tree | 1abcb38094e97e7a1c0bc1613a5b7a2948e763e8 /libreofficekit | |
parent | tdf#105103 assertion failure crash (diff) | |
download | core-55ec2440eba11b034c6617ac06e24003e8feae5c.tar.gz core-55ec2440eba11b034c6617ac06e24003e8feae5c.zip |
gtktiledviewer: gtk version checks
There is no major harm in excluding these lines of code on
platforms with older gtk.
Change-Id: Ica3f1e2b4f60f0bab55254632663ace7b4c61d4d
(cherry picked from commit 96f597acf70ce52f2bdb59c85dd052be54b8d629)
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index e5f56a92e653..502ccf7f028e 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -257,8 +257,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); } @@ -446,9 +447,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); @@ -690,15 +693,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); @@ -941,8 +950,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); |