mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-21 16:38:06 -06:00
Bump minimum Gtk version to 3.18
This commit is contained in:
parent
c1324304ca
commit
3d150de16f
@ -225,7 +225,7 @@ if (WITH_GNUCASH)
|
||||
endif (NOT WEBKIT2_4_FOUND)
|
||||
endif (WIN32 OR APPLE)
|
||||
|
||||
pkg_check_modules (GTK3 REQUIRED gtk+-3.0>=3.10.0)
|
||||
pkg_check_modules (GTK3 REQUIRED gtk+-3.0>=3.18.0)
|
||||
endif (WITH_GNUCASH)
|
||||
|
||||
pkg_check_modules (ZLIB REQUIRED zlib)
|
||||
|
@ -428,16 +428,8 @@ static void go_option_menu_init(GOOptionMenu *option_menu)
|
||||
|
||||
option_menu->button_label = GTK_LABEL(gtk_label_new(""));
|
||||
gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(option_menu->button_label), FALSE, TRUE, 0);
|
||||
#if GTK_CHECK_VERSION(3,14,0)
|
||||
arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
|
||||
#else
|
||||
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
|
||||
#endif
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(arrow), 5);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(arrow), 5);
|
||||
#endif
|
||||
|
||||
gtk_box_pack_end(GTK_BOX(box), arrow, FALSE, FALSE, 0);
|
||||
|
||||
|
@ -1219,11 +1219,7 @@ gnc_option_create_currency_accounting_widget (char *name, GNCOption *option)
|
||||
gtk_widget_set_halign (GTK_WIDGET(vbox), GTK_ALIGN_FILL);
|
||||
gtk_widget_set_hexpand (GTK_WIDGET(vbox), TRUE);
|
||||
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_end (GTK_WIDGET(vbox), 12);
|
||||
#else
|
||||
gtk_widget_set_margin_right (GTK_WIDGET(vbox), 12);
|
||||
#endif
|
||||
gtk_widget_set_margin_bottom (GTK_WIDGET(vbox), 12);
|
||||
|
||||
/* Iterate over the three options and create a radio button for each one */
|
||||
@ -1309,11 +1305,7 @@ gnc_option_create_currency_accounting_widget (char *name, GNCOption *option)
|
||||
gtk_box_pack_start (GTK_BOX (book_currency_data->book_currency_vbox),
|
||||
book_currency_data->book_currency_table,
|
||||
TRUE, TRUE, 0);
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(book_currency_data->book_currency_table), 12);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(book_currency_data->book_currency_table), 12);
|
||||
#endif
|
||||
gtk_grid_set_row_spacing (GTK_GRID (policy_table), 6);
|
||||
gtk_grid_set_column_spacing (GTK_GRID (policy_table), 6);
|
||||
|
||||
@ -1336,11 +1328,7 @@ gnc_option_create_currency_accounting_widget (char *name, GNCOption *option)
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (book_currency_data->book_currency_vbox),
|
||||
policy_table, TRUE, TRUE, 0);
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(policy_table), 12);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(policy_table), 12);
|
||||
#endif
|
||||
book_currency_data->gain_loss_account_table = gtk_grid_new ();
|
||||
gtk_grid_set_row_spacing (GTK_GRID (book_currency_data->gain_loss_account_table), 6);
|
||||
gtk_grid_set_column_spacing (GTK_GRID (book_currency_data->gain_loss_account_table), 6);
|
||||
@ -1358,11 +1346,7 @@ gnc_option_create_currency_accounting_widget (char *name, GNCOption *option)
|
||||
gtk_box_pack_start (GTK_BOX (book_currency_data->book_currency_vbox),
|
||||
book_currency_data->gain_loss_account_table,
|
||||
TRUE, TRUE, 0);
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(book_currency_data->gain_loss_account_table), 12);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(book_currency_data->gain_loss_account_table), 12);
|
||||
#endif
|
||||
gtk_grid_attach (GTK_GRID(table), book_currency_data->book_currency_vbox, 1, 2, 1, 1);
|
||||
}
|
||||
else /* trading or neither */
|
||||
|
@ -325,12 +325,8 @@ gnc_window_adjust_for_screen(GtkWindow * window)
|
||||
void
|
||||
gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3,16,0)
|
||||
gtk_label_set_xalign (GTK_LABEL (widget), xalign);
|
||||
gtk_label_set_yalign (GTK_LABEL (widget), yalign);
|
||||
#else
|
||||
gtk_misc_set_alignment (GTK_MISC (widget), xalign, yalign);
|
||||
#endif
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
|
@ -204,11 +204,7 @@ gnc_combott_init (GncCombott *combott)
|
||||
g_signal_connect (G_OBJECT (arrow), "draw",
|
||||
G_CALLBACK (gnc_draw_arrow_cb), GINT_TO_POINTER(1));
|
||||
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(arrow), 5);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(arrow), 5);
|
||||
#endif
|
||||
gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
|
||||
|
||||
sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
|
@ -292,11 +292,7 @@ gnc_dense_cal_init(GncDenseCal *dcal)
|
||||
|
||||
gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_END);
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_end (label, 5);
|
||||
#else
|
||||
gtk_widget_set_margin_right (label, 5);
|
||||
#endif
|
||||
gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(dcal->view_options), FALSE, FALSE, 0);
|
||||
|
||||
@ -338,11 +334,7 @@ gnc_dense_cal_init(GncDenseCal *dcal)
|
||||
gtk_widget_set_name (GTK_WIDGET(dcal->transPopup), "dense-cal-popup");
|
||||
|
||||
l = gtk_label_new(_("Date: "));
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (l, 5);
|
||||
#else
|
||||
gtk_widget_set_margin_left (l, 5);
|
||||
#endif
|
||||
gtk_container_add(GTK_CONTAINER(hbox), l);
|
||||
l = gtk_label_new("YY/MM/DD");
|
||||
g_object_set_data(G_OBJECT(dcal->transPopup), "dateLabel", l);
|
||||
|
@ -166,33 +166,6 @@ gnc_configure_date_completion (void)
|
||||
qof_date_completion_set(dc, backmonths);
|
||||
}
|
||||
|
||||
/* This function was copied from GTK3.22 as it was only introduced in
|
||||
* version 3.16 */
|
||||
#if !GTK_CHECK_VERSION(3,16,0)
|
||||
static void
|
||||
gtk_css_provider_load_from_resource (GtkCssProvider *css_provider,
|
||||
const gchar *resource_path)
|
||||
{
|
||||
GFile *file;
|
||||
gchar *uri, *escaped;
|
||||
|
||||
g_return_if_fail (GTK_IS_CSS_PROVIDER (css_provider));
|
||||
g_return_if_fail (resource_path != NULL);
|
||||
|
||||
escaped = g_uri_escape_string (resource_path,
|
||||
G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, FALSE);
|
||||
uri = g_strconcat ("resource://", escaped, NULL);
|
||||
g_free (escaped);
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
g_free (uri);
|
||||
|
||||
gtk_css_provider_load_from_file (css_provider, file, NULL);
|
||||
|
||||
g_object_unref (file);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gnc_add_css_file (void)
|
||||
{
|
||||
|
@ -2949,11 +2949,7 @@ gnc_main_window_open_page (GncMainWindow *window,
|
||||
image = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image);
|
||||
gtk_box_pack_start (GTK_BOX (tab_hbox), image, FALSE, FALSE, 0);
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(image), 5);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(image), 5);
|
||||
#endif
|
||||
gtk_box_pack_start (GTK_BOX (tab_hbox), label, TRUE, TRUE, 0);
|
||||
}
|
||||
else
|
||||
@ -3003,11 +2999,7 @@ gnc_main_window_open_page (GncMainWindow *window,
|
||||
G_CALLBACK(gnc_main_window_close_page), page);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (tab_hbox), close_button, FALSE, FALSE, 0);
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_end (GTK_WIDGET(close_button), 5);
|
||||
#else
|
||||
gtk_widget_set_margin_right (GTK_WIDGET(close_button), 5);
|
||||
#endif
|
||||
g_object_set_data (G_OBJECT (page), PLUGIN_PAGE_CLOSE_BUTTON, close_button);
|
||||
}
|
||||
|
||||
|
@ -329,11 +329,7 @@ gnc_period_select_set_date_common (GncPeriodSelect *period, const GDate *date)
|
||||
if (priv->date_label == NULL)
|
||||
{
|
||||
priv->date_label = gtk_label_new("");
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(priv->date_label), 6);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(priv->date_label), 6);
|
||||
#endif
|
||||
gtk_box_pack_start(GTK_BOX(period), priv->date_label, TRUE, TRUE, 0);
|
||||
gtk_widget_show_all(priv->date_label);
|
||||
}
|
||||
|
@ -753,12 +753,7 @@ gnc_loan_assistant_create( LoanAssistantData *ldd )
|
||||
rouid = ldd->repayOptsUI[i];
|
||||
vb = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
||||
gtk_box_set_homogeneous (GTK_BOX (vb), FALSE);
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 12, 0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(vb), 12);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(vb), 12);
|
||||
#endif
|
||||
|
||||
/* Add payment checkbox. */
|
||||
|
||||
@ -782,12 +777,8 @@ gnc_loan_assistant_create( LoanAssistantData *ldd )
|
||||
FALSE );
|
||||
|
||||
gtk_box_pack_start( GTK_BOX(vb), GTK_WIDGET(rouid->escrowCb), FALSE, FALSE, 2 );
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 12, 0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(rouid->escrowCb), 12);
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(rouid->escrowCb), 12);
|
||||
#endif
|
||||
|
||||
g_signal_connect( rouid->optCb, "toggled",
|
||||
G_CALLBACK(loan_opt_toggled_cb),
|
||||
rouid );
|
||||
|
@ -1202,12 +1202,7 @@ gnc_reconcile_window_create_view_box(Account *account,
|
||||
label = gtk_label_new("");
|
||||
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
|
||||
*total_save = label;
|
||||
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_end (GTK_WIDGET(label), 10 + nat_sb.width);
|
||||
#else
|
||||
gtk_widget_set_margin_right (GTK_WIDGET(label), 10 + nat_sb.width);
|
||||
#endif
|
||||
|
||||
return vbox;
|
||||
}
|
||||
@ -1973,13 +1968,8 @@ recnWindowWithBalance (GtkWidget *parent, Account *account, gnc_numeric new_endi
|
||||
gint recn_widthc = gnc_reconcile_view_get_column_width (GNC_RECONCILE_VIEW(recnData->credit), REC_RECN);
|
||||
gint recn_widthd = gnc_reconcile_view_get_column_width (GNC_RECONCILE_VIEW(recnData->debit), REC_RECN);
|
||||
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_end (GTK_WIDGET(recnData->total_credit), 10 + recn_widthc);
|
||||
gtk_widget_set_margin_end (GTK_WIDGET(recnData->total_debit), 10 + recn_widthd);
|
||||
#else
|
||||
gtk_widget_set_margin_right (GTK_WIDGET(recnData->total_credit), 10 + recn_widthc);
|
||||
gtk_widget_set_margin_right (GTK_WIDGET(recnData->total_debit), 10 + recn_widthd);
|
||||
#endif
|
||||
}
|
||||
return recnData;
|
||||
}
|
||||
|
@ -1153,11 +1153,7 @@ gnc_reconcile_window_create_view_box (Account *account,
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||
*total_save = label;
|
||||
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_end (GTK_WIDGET(label), 10);
|
||||
#else
|
||||
gtk_widget_set_margin_right (GTK_WIDGET(label), 10);
|
||||
#endif
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
@ -854,17 +854,10 @@ gnc_item_edit_new (GnucashSheet *sheet)
|
||||
gtk_entry_set_has_frame (GTK_ENTRY(item_edit->editor), FALSE);
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,20,0)
|
||||
#if GTK_CHECK_VERSION(3,12,0)
|
||||
gtk_widget_set_margin_start (GTK_WIDGET(item_edit->editor),
|
||||
gnc_item_edit_get_margin (item_edit, left));
|
||||
gtk_widget_set_margin_end (GTK_WIDGET(item_edit->editor),
|
||||
gnc_item_edit_get_margin (item_edit, right));
|
||||
#else
|
||||
gtk_widget_set_margin_left (GTK_WIDGET(item_edit->editor),
|
||||
gnc_item_edit_get_margin (item_edit, left));
|
||||
gtk_widget_set_margin_right (GTK_WIDGET(item_edit->editor),
|
||||
gnc_item_edit_get_margin (item_edit, right));
|
||||
#endif
|
||||
gtk_widget_set_margin_top (GTK_WIDGET(item_edit->editor),
|
||||
gnc_item_edit_get_margin (item_edit, top));
|
||||
gtk_widget_set_margin_bottom (GTK_WIDGET(item_edit->editor),
|
||||
|
Loading…
Reference in New Issue
Block a user