Kaydet (Commit) 96f597ac authored tarafından Pranav Kant's avatar Pranav Kant

gtktiledviewer: gtk version checks

There is no major harm in excluding these lines of code on
platforms with older gtk.

Change-Id: Ica3f1e2b4f60f0bab55254632663ace7b4c61d4d
üst 0270018b
......@@ -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);
......
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