From 56f023347d2855f1df340843e10f0331c18ba717 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 5 Apr 2020 13:47:15 +0100 Subject: [PATCH] Change CSS class and names used in gnome-utils Change the CSS classes and widget names to a standard naming for all of Gnucash. This should make it easier to adjust Gnucash appearance if required. CSS classes all begin with 'gnc-class-' and widget names begin with 'gnc-id-' --- gnucash/gnome-utils/dialog-book-close.c | 4 ++-- gnucash/gnome-utils/dialog-commodity.c | 10 ++++++---- gnucash/gnome-utils/dialog-dup-trans.c | 5 +++-- gnucash/gnome-utils/dialog-file-access.c | 4 ++-- gnucash/gnome-utils/dialog-object-references.c | 4 ++-- gnucash/gnome-utils/dialog-options.c | 4 ++-- gnucash/gnome-utils/dialog-preferences.c | 4 ++-- gnucash/gnome-utils/dialog-query-view.c | 4 ++-- gnucash/gnome-utils/dialog-reset-warnings.c | 4 ++-- gnucash/gnome-utils/dialog-tax-table.c | 10 ++++++---- gnucash/gnome-utils/dialog-totd.c | 4 ++-- gnucash/gnome-utils/dialog-transfer.c | 5 +++-- gnucash/gnome-utils/dialog-userpass.c | 4 ++-- gnucash/gnome-utils/gnc-account-sel.c | 4 ++-- gnucash/gnome-utils/gnc-amount-edit.c | 4 ++-- gnucash/gnome-utils/gnc-autosave.c | 4 ++-- gnucash/gnome-utils/gnc-combott.c | 4 ++-- gnucash/gnome-utils/gnc-currency-edit.c | 4 ++-- gnucash/gnome-utils/gnc-date-delta.c | 4 ++-- gnucash/gnome-utils/gnc-date-edit.c | 4 ++-- gnucash/gnome-utils/gnc-date-format.c | 4 ++-- gnucash/gnome-utils/gnc-dense-cal.c | 7 ++++--- gnucash/gnome-utils/gnc-embedded-window.c | 4 ++-- gnucash/gnome-utils/gnc-file.c | 4 ++-- gnucash/gnome-utils/gnc-frequency.c | 4 ++-- gnucash/gnome-utils/gnc-general-select.c | 4 ++-- gnucash/gnome-utils/gnc-main-window.c | 8 ++++++-- gnucash/gnome-utils/gnc-period-select.c | 4 ++-- gnucash/gnome-utils/gnc-query-view.c | 4 ++-- gnucash/gnome-utils/gnc-recurrence.c | 4 ++-- gnucash/gnome-utils/gnc-splash.c | 4 ++-- gnucash/gnome-utils/gnc-tree-view.c | 4 ++-- gnucash/gnome-utils/window-main-summarybar.c | 4 ++-- 33 files changed, 82 insertions(+), 71 deletions(-) diff --git a/gnucash/gnome-utils/dialog-book-close.c b/gnucash/gnome-utils/dialog-book-close.c index 49cdbea5ac..9b16222a66 100644 --- a/gnucash/gnome-utils/dialog-book-close.c +++ b/gnucash/gnome-utils/dialog-book-close.c @@ -333,8 +333,8 @@ void gnc_ui_close_book (QofBook* book, GtkWindow *parent) gnc_builder_add_from_file (builder, "dialog-book-close.glade", "close_book_dialog"); cbw->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "close_book_dialog")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(cbw->dialog), "GncBookCloseDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(cbw->dialog), "gnc-id-book-close"); /* parent */ if (parent != NULL) diff --git a/gnucash/gnome-utils/dialog-commodity.c b/gnucash/gnome-utils/dialog-commodity.c index 74675a9855..943bb85033 100644 --- a/gnucash/gnome-utils/dialog-commodity.c +++ b/gnucash/gnome-utils/dialog-commodity.c @@ -266,8 +266,9 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel, retval->ok_button = GTK_WIDGET(gtk_builder_get_object (builder, "ss_ok_button")); label = GTK_WIDGET(gtk_builder_get_object (builder, "item_label")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(retval->dialog), "GncSecurityDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(retval->dialog), "gnc-id-security-select"); + gnc_widget_style_context_add_class (GTK_WIDGET(retval->dialog), "gnc-class-securities"); gnc_cbwe_require_list_item(GTK_COMBO_BOX(retval->namespace_combo)); gnc_cbwe_require_list_item(GTK_COMBO_BOX(retval->commodity_combo)); @@ -910,8 +911,9 @@ gnc_ui_build_commodity_dialog(const char * selected_namespace, retval->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "security_dialog")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(retval->dialog), "GncSecurityDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(retval->dialog), "gnc-id-security"); + gnc_widget_style_context_add_class (GTK_WIDGET(retval->dialog), "gnc-class-securities"); if (parent != NULL) gtk_window_set_transient_for (GTK_WINDOW (retval->dialog), GTK_WINDOW (parent)); diff --git a/gnucash/gnome-utils/dialog-dup-trans.c b/gnucash/gnome-utils/dialog-dup-trans.c index 690e57f6da..50d046e6dc 100644 --- a/gnucash/gnome-utils/dialog-dup-trans.c +++ b/gnucash/gnome-utils/dialog-dup-trans.c @@ -110,8 +110,9 @@ gnc_dup_trans_dialog_create (GtkWidget * parent, DupTransDialog *dt_dialog, dialog = GTK_WIDGET(gtk_builder_get_object (builder, "duplicate_transaction_dialog")); dt_dialog->dialog = dialog; - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncDupTransDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-duplicate-transaction"); + gnc_widget_style_context_add_class (GTK_WIDGET(dialog), "gnc-class-transactions"); /* parent */ if (parent != NULL) diff --git a/gnucash/gnome-utils/dialog-file-access.c b/gnucash/gnome-utils/dialog-file-access.c index a69ee20665..363ae6fc55 100644 --- a/gnucash/gnome-utils/dialog-file-access.c +++ b/gnucash/gnome-utils/dialog-file-access.c @@ -282,8 +282,8 @@ gnc_ui_file_access (GtkWindow *parent, int type) gtk_window_set_transient_for (GTK_WINDOW (faw->dialog), parent); g_object_set_data_full( G_OBJECT(faw->dialog), "FileAccessWindow", faw, g_free ); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(faw->dialog), "GncFileAccessDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(faw->dialog), "gnc-id-file-access"); faw->frame_file = GTK_WIDGET(gtk_builder_get_object (builder, "frame_file" )); faw->frame_database = GTK_WIDGET(gtk_builder_get_object (builder, "frame_database" )); diff --git a/gnucash/gnome-utils/dialog-object-references.c b/gnucash/gnome-utils/dialog-object-references.c index c09fe15f31..c8b3c87870 100644 --- a/gnucash/gnome-utils/dialog-object-references.c +++ b/gnucash/gnome-utils/dialog-object-references.c @@ -54,8 +54,8 @@ gnc_ui_object_references_show( const gchar* explanation_text, GList* objlist ) gnc_builder_add_from_file (builder, "dialog-object-references.glade", "object_references_dialog" ); dialog = GTK_WIDGET(gtk_builder_get_object (builder, "object_references_dialog" )); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncObjectRefDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-object-reference"); explanation = GTK_LABEL(gtk_builder_get_object (builder, "lbl_explanation" )); gtk_label_set_text( explanation, explanation_text ); diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c index 72c7473a15..65ad8c59fe 100644 --- a/gnucash/gnome-utils/dialog-options.c +++ b/gnucash/gnome-utils/dialog-options.c @@ -2227,8 +2227,8 @@ gnc_options_dialog_new_modal(gboolean modal, gchar *title, retval->window = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_options_window")); retval->page_list = GTK_WIDGET(gtk_builder_get_object (builder, "page_list_scroll")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(retval->window), "GncOptionsDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(retval->window), "gnc-id-options"); /* Page List */ { diff --git a/gnucash/gnome-utils/dialog-preferences.c b/gnucash/gnome-utils/dialog-preferences.c index 34ddfe4568..0dedce9522 100644 --- a/gnucash/gnome-utils/dialog-preferences.c +++ b/gnucash/gnome-utils/dialog-preferences.c @@ -1254,8 +1254,8 @@ gnc_preferences_dialog_create(GtkWindow *parent) dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_preferences_dialog")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncPreferenceDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-preferences"); /* parent */ gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent)); diff --git a/gnucash/gnome-utils/dialog-query-view.c b/gnucash/gnome-utils/dialog-query-view.c index 4052b6bdc0..7fe6d39773 100644 --- a/gnucash/gnome-utils/dialog-query-view.c +++ b/gnucash/gnome-utils/dialog-query-view.c @@ -193,8 +193,8 @@ gnc_dialog_query_view_new (GtkWindow *parent, GList *param_list, Query *q) g_object_set_data (G_OBJECT (dqv->dialog), "dialog-info", dqv); gtk_window_set_transient_for(GTK_WINDOW(dqv->dialog), parent); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dqv->dialog), "GncQueryViewDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dqv->dialog), "gnc-id-query-view"); /* grab the widgets */ dqv->label = GTK_WIDGET(gtk_builder_get_object (builder, "dialog_label")); diff --git a/gnucash/gnome-utils/dialog-reset-warnings.c b/gnucash/gnome-utils/dialog-reset-warnings.c index c6b0602cf1..5c1d6e65b4 100644 --- a/gnucash/gnome-utils/dialog-reset-warnings.c +++ b/gnucash/gnome-utils/dialog-reset-warnings.c @@ -379,8 +379,8 @@ gnc_reset_warnings_dialog (GtkWindow *parent) gnc_builder_add_from_file (builder, "dialog-reset-warnings.glade", "reset_warnings_dialog"); dialog = GTK_WIDGET(gtk_builder_get_object (builder, "reset_warnings_dialog")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncResetWarningsDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-reset-warnings"); gtk_window_set_transient_for(GTK_WINDOW (dialog), parent); diff --git a/gnucash/gnome-utils/dialog-tax-table.c b/gnucash/gnome-utils/dialog-tax-table.c index 4151d8076d..352d82490e 100644 --- a/gnucash/gnome-utils/dialog-tax-table.c +++ b/gnucash/gnome-utils/dialog-tax-table.c @@ -235,8 +235,9 @@ new_tax_table_dialog (TaxTableWindow *ttw, gboolean new_table, ntt->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "new_tax_table_dialog")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(ntt->dialog), "GncTaxTableDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(ntt->dialog), "gnc-id-tax-table"); + gnc_widget_style_context_add_class (GTK_WIDGET(ntt->dialog), "gnc-class-taxes"); ntt->name_entry = GTK_WIDGET(gtk_builder_get_object (builder, "name_entry")); if (name) @@ -813,8 +814,9 @@ gnc_ui_tax_table_window_new (GtkWindow *parent, QofBook *book) gtk_window_set_transient_for (GTK_WINDOW (ttw->dialog), parent); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(ttw->dialog), "GncTaxTableDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(ttw->dialog), "gnc-id-new-tax-table"); + gnc_widget_style_context_add_class (GTK_WIDGET(ttw->dialog), "gnc-class-taxes"); /* Create the tax tables view */ view = GTK_TREE_VIEW(ttw->names_view); diff --git a/gnucash/gnome-utils/dialog-totd.c b/gnucash/gnome-utils/dialog-totd.c index 4c5e5995c6..059518ce02 100644 --- a/gnucash/gnome-utils/dialog-totd.c +++ b/gnucash/gnome-utils/dialog-totd.c @@ -345,8 +345,8 @@ gnc_totd_dialog (GtkWindow *parent, gboolean startup) dialog = GTK_WIDGET(gtk_builder_get_object (builder, "totd_dialog")); gtk_window_set_transient_for(GTK_WINDOW (dialog), parent); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncTotdDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-tip-of-the-day"); totd_dialog = g_new0 (TotdDialog, 1); totd_dialog->dialog = dialog; diff --git a/gnucash/gnome-utils/dialog-transfer.c b/gnucash/gnome-utils/dialog-transfer.c index 86edbd98fa..f30384e1dc 100644 --- a/gnucash/gnome-utils/dialog-transfer.c +++ b/gnucash/gnome-utils/dialog-transfer.c @@ -1879,8 +1879,9 @@ gnc_xfer_dialog_create(GtkWidget *parent, XferDialog *xferData) xferData->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "transfer_dialog")); g_object_set_data_full (G_OBJECT (xferData->dialog), "builder", builder, g_object_unref); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(xferData->dialog), "GncTransferDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(xferData->dialog), "gnc-id-transfer"); + gnc_widget_style_context_add_class (GTK_WIDGET(xferData->dialog), "gnc-class-securities"); /* parent */ if (parent != NULL) diff --git a/gnucash/gnome-utils/dialog-userpass.c b/gnucash/gnome-utils/dialog-userpass.c index c610f25467..bcbc69a407 100644 --- a/gnucash/gnome-utils/dialog-userpass.c +++ b/gnucash/gnome-utils/dialog-userpass.c @@ -51,8 +51,8 @@ gnc_get_username_password (GtkWidget *parent, dialog = GTK_WIDGET(gtk_builder_get_object (builder, "username_password_dialog")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncUserPassDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-user-password"); if (parent) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); diff --git a/gnucash/gnome-utils/gnc-account-sel.c b/gnucash/gnome-utils/gnc-account-sel.c index 7f7c919768..9d240f5678 100644 --- a/gnucash/gnome-utils/gnc-account-sel.c +++ b/gnucash/gnome-utils/gnc-account-sel.c @@ -161,8 +161,8 @@ gnc_account_sel_init (GNCAccountSel *gas) g_object_set(gas, "spacing", 2, (gchar*)NULL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gas), "GncAccountSel"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gas), "gnc-id-account-select"); gas->store = gtk_list_store_new(NUM_ACCT_COLS, G_TYPE_STRING, G_TYPE_POINTER); widget = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(gas->store)); diff --git a/gnucash/gnome-utils/gnc-amount-edit.c b/gnucash/gnome-utils/gnc-amount-edit.c index d4b24ed4f1..b334d24b9d 100644 --- a/gnucash/gnome-utils/gnc-amount-edit.c +++ b/gnucash/gnome-utils/gnc-amount-edit.c @@ -140,8 +140,8 @@ gnc_amount_edit_init (GNCAmountEdit *gae) gae->fraction = 0; gae->evaluate_on_enter = FALSE; - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gae), "GncAmountEdit"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gae), "gnc-id-amount-edit"); g_signal_connect (G_OBJECT (gae), "changed", G_CALLBACK (gnc_amount_edit_changed), NULL); diff --git a/gnucash/gnome-utils/gnc-autosave.c b/gnucash/gnome-utils/gnc-autosave.c index 15298ceedb..260ededbe5 100644 --- a/gnucash/gnome-utils/gnc-autosave.c +++ b/gnucash/gnome-utils/gnc-autosave.c @@ -98,8 +98,8 @@ static gboolean autosave_confirm(GtkWidget *toplevel) "%s", _("Save file automatically?")); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncAutoSaveDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-auto-save"); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG(dialog), diff --git a/gnucash/gnome-utils/gnc-combott.c b/gnucash/gnome-utils/gnc-combott.c index 4b73385214..f0e3595728 100644 --- a/gnucash/gnome-utils/gnc-combott.c +++ b/gnucash/gnome-utils/gnc-combott.c @@ -190,8 +190,8 @@ gnc_combott_init (GncCombott *combott) gtk_orientable_set_orientation (GTK_ORIENTABLE(combott), GTK_ORIENTATION_HORIZONTAL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(combott), "GncCombott"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(combott), "gnc-id-combo-tooltip"); priv->active = 0; priv->text_col = 0; diff --git a/gnucash/gnome-utils/gnc-currency-edit.c b/gnucash/gnome-utils/gnc-currency-edit.c index 33baa11ee6..7734659926 100644 --- a/gnucash/gnome-utils/gnc-currency-edit.c +++ b/gnucash/gnome-utils/gnc-currency-edit.c @@ -193,8 +193,8 @@ gnc_currency_edit_class_init (GNCCurrencyEditClass *klass) static void gnc_currency_edit_init (GNCCurrencyEdit *gce) { - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gce), "GncCurrencyEdit"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gce), "gnc-id-currency-edit"); g_signal_connect (gce, "notify::mnemonic", G_CALLBACK (gnc_currency_edit_mnemonic_changed), gce); diff --git a/gnucash/gnome-utils/gnc-date-delta.c b/gnucash/gnome-utils/gnc-date-delta.c index fed1ef2570..20407ad3d7 100644 --- a/gnucash/gnome-utils/gnc-date-delta.c +++ b/gnucash/gnome-utils/gnc-date-delta.c @@ -162,8 +162,8 @@ gnc_date_delta_init (GNCDateDelta *gdd) { gtk_orientable_set_orientation (GTK_ORIENTABLE(gdd), GTK_ORIENTATION_HORIZONTAL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gdd), "GncDateDelta"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gdd), "gnc-id-date-delta"); gdd->value_spin = NULL; gdd->units_combo = NULL; diff --git a/gnucash/gnome-utils/gnc-date-edit.c b/gnucash/gnome-utils/gnc-date-edit.c index a7539e7f9e..47a9563780 100644 --- a/gnucash/gnome-utils/gnc-date-edit.c +++ b/gnucash/gnome-utils/gnc-date-edit.c @@ -698,8 +698,8 @@ gnc_date_edit_init (GNCDateEdit *gde) { gtk_orientable_set_orientation (GTK_ORIENTABLE(gde), GTK_ORIENTATION_HORIZONTAL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gde), "GncDateEdit"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gde), "gnc-id-date-edit"); gde->disposed = FALSE; gde->popup_in_progress = FALSE; diff --git a/gnucash/gnome-utils/gnc-date-format.c b/gnucash/gnome-utils/gnc-date-format.c index 6e4473bd17..6bb01dc82d 100644 --- a/gnucash/gnome-utils/gnc-date-format.c +++ b/gnucash/gnome-utils/gnc-date-format.c @@ -126,8 +126,8 @@ gnc_date_format_init (GNCDateFormat *gdf) gtk_orientable_set_orientation (GTK_ORIENTABLE(gdf), GTK_ORIENTATION_HORIZONTAL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gdf), "GncDateFormat"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gdf), "gnc-id-date-format"); /* Open up the Glade and set the signals */ builder = gtk_builder_new(); diff --git a/gnucash/gnome-utils/gnc-dense-cal.c b/gnucash/gnome-utils/gnc-dense-cal.c index 043f3ad43e..7dac2530ad 100644 --- a/gnucash/gnome-utils/gnc-dense-cal.c +++ b/gnucash/gnome-utils/gnc-dense-cal.c @@ -267,9 +267,10 @@ gnc_dense_cal_init(GncDenseCal *dcal) gtk_orientable_set_orientation (GTK_ORIENTABLE(dcal), GTK_ORIENTATION_VERTICAL); // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(dcal), "calendar"); + gnc_widget_style_context_add_class (GTK_WIDGET(dcal), "calendar"); - gtk_widget_set_name (GTK_WIDGET(dcal), "dense-cal"); + // Set the name of this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(dcal), "gnc-id-dense-calendar"); gtk_style_context_add_class (context, GTK_STYLE_CLASS_CALENDAR); { @@ -331,7 +332,7 @@ gnc_dense_cal_init(GncDenseCal *dcal) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE); - gtk_widget_set_name (GTK_WIDGET(dcal->transPopup), "dense-cal-popup"); + gtk_widget_set_name (GTK_WIDGET(dcal->transPopup), "gnc-id-dense-calendar-popup"); l = gtk_label_new(_("Date: ")); gtk_widget_set_margin_start (l, 5); diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c index 7682aeafcd..6513c91dc9 100644 --- a/gnucash/gnome-utils/gnc-embedded-window.c +++ b/gnucash/gnome-utils/gnc-embedded-window.c @@ -231,8 +231,8 @@ gnc_embedded_window_init (GncEmbeddedWindow *window, void *data) gtk_orientable_set_orientation (GTK_ORIENTABLE(window), GTK_ORIENTATION_VERTICAL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(window), "GncEmbeddedWindow"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(window), "gnc-id-embedded-window"); gnc_embedded_window_setup_window (window); diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c index c526ac09c3..555cf2d2fb 100644 --- a/gnucash/gnome-utils/gnc-file.c +++ b/gnucash/gnome-utils/gnc-file.c @@ -169,8 +169,8 @@ gnc_file_dialog (GtkWindow *parent, response = gtk_dialog_run(GTK_DIALOG(file_box)); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(file_box), "GncFileDialog"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(file_box), "gnc-id-file"); if (response == GTK_RESPONSE_ACCEPT) { diff --git a/gnucash/gnome-utils/gnc-frequency.c b/gnucash/gnome-utils/gnc-frequency.c index af6238e1ec..d07961b12c 100644 --- a/gnucash/gnome-utils/gnc-frequency.c +++ b/gnucash/gnome-utils/gnc-frequency.c @@ -203,8 +203,8 @@ gnc_frequency_init(GncFrequency *gf) gtk_orientable_set_orientation (GTK_ORIENTABLE(gf), GTK_ORIENTATION_VERTICAL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gf), "GncFrequency"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gf), "gnc-id-frequency"); builder = gtk_builder_new(); gnc_builder_add_from_file (builder , "gnc-frequency.glade", "adjustment1"); diff --git a/gnucash/gnome-utils/gnc-general-select.c b/gnucash/gnome-utils/gnc-general-select.c index fc68bcfc62..3cd9091048 100644 --- a/gnucash/gnome-utils/gnc-general-select.c +++ b/gnucash/gnome-utils/gnc-general-select.c @@ -145,8 +145,8 @@ gnc_general_select_init (GNCGeneralSelect *gsl) { gtk_orientable_set_orientation (GTK_ORIENTABLE(gsl), GTK_ORIENTATION_HORIZONTAL); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gsl), "GncGeneralSelect"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gsl), "gnc-id-general-select"); gsl->disposed = FALSE; gsl->selected_item = NULL; diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c index b07381b298..05f6eae719 100644 --- a/gnucash/gnome-utils/gnc-main-window.c +++ b/gnucash/gnome-utils/gnc-main-window.c @@ -2570,8 +2570,8 @@ gnc_main_window_init (GncMainWindow *window, void *data) priv->merged_actions_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(window), "GncMainWindow"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(window), "gnc-id-main-window"); priv->event_handler_id = qof_event_register_handler(gnc_main_window_event_handler, window); @@ -3008,6 +3008,10 @@ gnc_main_window_open_page (GncMainWindow *window, gtk_widget_show (label); tab_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); + + if (g_strcmp0 (gnc_plugin_page_get_plugin_name (page), "GncPluginPageAccountTree") == 0) + gtk_widget_set_name (GTK_WIDGET(tab_hbox), "gnc-id-account-page-tab-box"); + gtk_box_set_homogeneous (GTK_BOX (tab_hbox), FALSE); gtk_widget_show (tab_hbox); diff --git a/gnucash/gnome-utils/gnc-period-select.c b/gnucash/gnome-utils/gnc-period-select.c index 9f07204c96..b1d5c93067 100644 --- a/gnucash/gnome-utils/gnc-period-select.c +++ b/gnucash/gnome-utils/gnc-period-select.c @@ -577,8 +577,8 @@ gnc_period_select_init (GncPeriodSelect *period) gtk_orientable_set_orientation (GTK_ORIENTABLE(period), GTK_ORIENTATION_HORIZONTAL); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(period), "GncPeriodSelect"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(period), "gnc-id-period-select"); priv = GNC_PERIOD_SELECT_GET_PRIVATE(period); priv->start = TRUE; diff --git a/gnucash/gnome-utils/gnc-query-view.c b/gnucash/gnome-utils/gnc-query-view.c index d5dcfa6c91..49b5acffd2 100644 --- a/gnucash/gnome-utils/gnc-query-view.c +++ b/gnucash/gnome-utils/gnc-query-view.c @@ -191,8 +191,8 @@ gnc_query_view_init (GNCQueryView *qview) { GNCQueryViewPrivate *priv; - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(qview), "GncQueryView"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(qview), "gnc-id-query-view"); qview->query = NULL; diff --git a/gnucash/gnome-utils/gnc-recurrence.c b/gnucash/gnome-utils/gnc-recurrence.c index ce72553891..ceeab66bca 100644 --- a/gnucash/gnome-utils/gnc-recurrence.c +++ b/gnucash/gnome-utils/gnc-recurrence.c @@ -189,8 +189,8 @@ gnc_recurrence_init( GncRecurrence *gr ) recurrenceSet(&gr->recurrence, 1, PERIOD_MONTH, NULL, WEEKEND_ADJ_NONE); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(gr), "GncRecurrence"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(gr), "gnc-id-recurrence"); /* Open up the builder file */ builder = gtk_builder_new(); diff --git a/gnucash/gnome-utils/gnc-splash.c b/gnucash/gnome-utils/gnc-splash.c index 9ea7b20e10..efee10df6f 100644 --- a/gnucash/gnome-utils/gnc-splash.c +++ b/gnucash/gnome-utils/gnc-splash.c @@ -69,8 +69,8 @@ gnc_show_splash_screen (void) gtk_window_set_decorated(GTK_WINDOW (splash), FALSE); gtk_window_set_skip_taskbar_hint (GTK_WINDOW (splash), TRUE); - // Set the style context for this dialog so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(splash), "GncSplash"); + // Set the name for this dialog so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(splash), "gnc-id-splash"); g_signal_connect (splash, "destroy", G_CALLBACK (splash_destroy_cb), NULL); diff --git a/gnucash/gnome-utils/gnc-tree-view.c b/gnucash/gnome-utils/gnc-tree-view.c index f89f81e96f..d2d05c1533 100644 --- a/gnucash/gnome-utils/gnc-tree-view.c +++ b/gnucash/gnome-utils/gnc-tree-view.c @@ -256,8 +256,8 @@ gnc_tree_view_init (GncTreeView *view, void *data) priv->sort_column_changed_cb_id = 0; priv->size_allocate_cb_id = 0; - // Set the style context for this page so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(view), "GncTreeView"); + // Set the name for this widget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(view), "gnc-id-tree-view"); /* Handle column drag and drop */ gtk_tree_view_set_column_drag_function (GTK_TREE_VIEW(view), diff --git a/gnucash/gnome-utils/window-main-summarybar.c b/gnucash/gnome-utils/window-main-summarybar.c index ca1369ee6b..a1f39da523 100644 --- a/gnucash/gnome-utils/window-main-summarybar.c +++ b/gnucash/gnome-utils/window-main-summarybar.c @@ -634,8 +634,8 @@ gnc_main_window_summary_new (void) retval->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_box_set_homogeneous (GTK_BOX (retval->hbox), FALSE); - // Set the style context for this widget so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(retval->hbox), "summary-bar"); + // Set the name for this wodget so it can be easily manipulated with css + gtk_widget_set_name (GTK_WIDGET(retval->hbox), "gnc-id-account-summary-bar"); retval->totals_combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (retval->datamodel)); g_object_unref (retval->datamodel);