Change CSS class and names used in Assistants

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-'
This commit is contained in:
Robert Fewell 2020-04-05 13:51:25 +01:00
parent c6bac56e2b
commit 95c2e5b556
12 changed files with 32 additions and 23 deletions

View File

@ -1189,9 +1189,8 @@ gxi_edit_encodings_clicked_cb (GtkButton *button, GncXmlImportData *data)
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "encodings_dialog"));
data->encodings_dialog = dialog;
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncAssistXmlEncoding");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-assistant-xml-encoding");
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, data);

View File

@ -542,8 +542,8 @@ ap_assistant_create (AcctPeriodInfo *info)
window = GTK_WIDGET(gtk_builder_get_object (builder, "account_period_assistant"));
info->window = window;
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(window), "GncAssistAccountPeriod");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(window), "gnc-id-assistant-account-period");
/* Enable all pages except menu page. */
gtk_assistant_set_page_complete (GTK_ASSISTANT (window),

View File

@ -1576,8 +1576,8 @@ gnc_create_hierarchy_assistant (gboolean use_defaults, GncHierarchyAssistantFini
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "hierarchy_assistant"));
data->dialog = dialog;
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncAssistAccountHierarchy");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-assistant-account-hierarchy");
/* Enable buttons on first and last page. */
gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog),

View File

@ -477,8 +477,8 @@ gnc_loan_assistant_create( LoanAssistantData *ldd )
window = GTK_WIDGET(gtk_builder_get_object (builder, "loan_mortgage_assistant"));
ldd->window = window;
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(window), "GncAssistLoan");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(window), "gnc-id-assistant-loan");
/* Enable buttons on complete pages. */
gtk_assistant_set_page_complete (GTK_ASSISTANT (window),

View File

@ -532,8 +532,8 @@ gnc_stock_split_assistant_create (StockSplitInfo *info)
window = GTK_WIDGET(gtk_builder_get_object (builder, "stock_split_assistant"));
info->window = window;
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(window), "GncAssistStockSplit");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(window), "gnc-id-assistant-stock-split");
/* Enable buttons on first, second, fourth and last page. */
gtk_assistant_set_page_complete (GTK_ASSISTANT (window),

View File

@ -118,8 +118,9 @@ gnc_plugin_bi_import_showGUI (GtkWindow *parent)
gui->tree_view = GTK_WIDGET(gtk_builder_get_object (builder, "treeview1"));
gui->entryFilename = GTK_WIDGET(gtk_builder_get_object (builder, "entryFilename"));
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(gui->dialog), "GncBillImportDialog");
// Set the name for this dialog so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(gui->dialog), "gnc-id-bill-import");
gnc_widget_style_context_add_class (GTK_WIDGET(gui->dialog), "gnc-class-imports");
gtk_window_set_transient_for (GTK_WINDOW (gui->dialog), parent);

View File

@ -855,8 +855,9 @@ csv_export_assistant_create (CsvExportInfo *info)
gnc_builder_add_from_file (builder , "assistant-csv-export.glade", "csv_export_assistant");
info->assistant = GTK_WIDGET(gtk_builder_get_object (builder, "csv_export_assistant"));
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(info->assistant), "GncAssistExport");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(info->assistant), "gnc-id-assistant-csv-export");
gnc_widget_style_context_add_class (GTK_WIDGET(info->assistant), "gnc-class-exports");
/* Load default settings */
load_settings (info);

View File

@ -641,8 +641,9 @@ csv_import_assistant_create (CsvImportInfo *info)
gnc_builder_add_from_file (builder, "assistant-csv-account-import.glade", "csv_account_import_assistant");
info->assistant = GTK_WIDGET(gtk_builder_get_object (builder, "csv_account_import_assistant"));
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(info->assistant), "GncAssistAccountImport");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(info->assistant), "gnc-id-assistant-csv-account-import");
gnc_widget_style_context_add_class (GTK_WIDGET(info->assistant), "gnc-class-imports");
/* Load default settings */
load_settings (info);

View File

@ -524,6 +524,10 @@ CsvImpPriceAssist::CsvImpPriceAssist ()
gnc_builder_add_from_file (builder , "assistant-csv-price-import.glade", "CSV Price Assistant");
csv_imp_asst = GTK_ASSISTANT(gtk_builder_get_object (builder, "CSV Price Assistant"));
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(csv_imp_asst), "gnc-id-assistant-csv-price-import");
gnc_widget_style_context_add_class (GTK_WIDGET(csv_imp_asst), "gnc-class-imports");
/* Enable buttons on all page. */
gtk_assistant_set_page_complete (csv_imp_asst,
GTK_WIDGET(gtk_builder_get_object (builder, "start_page")),

View File

@ -459,8 +459,9 @@ CsvImpTransAssist::CsvImpTransAssist ()
gnc_builder_add_from_file (builder , "assistant-csv-trans-import.glade", "csv_transaction_assistant");
csv_imp_asst = GTK_ASSISTANT(gtk_builder_get_object (builder, "csv_transaction_assistant"));
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(csv_imp_asst), "GncAssistTransImport");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(csv_imp_asst), "gnc-id-assistant-csv-transaction-import");
gnc_widget_style_context_add_class (GTK_WIDGET(csv_imp_asst), "gnc-class-imports");
/* Enable buttons on all page. */
gtk_assistant_set_page_complete (csv_imp_asst,

View File

@ -104,8 +104,9 @@ gnc_plugin_customer_import_showGUI(GtkWindow *parent)
gui->entryFilename = GTK_WIDGET(gtk_builder_get_object (builder, "entryFilename"));
gui->type = "CUSTOMER"; // Set a default type to import
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(gui->dialog), "GncCustomerImportDialog");
// Set the name for this dialog so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(gui->dialog), "gnc-id-customer-import");
gnc_widget_style_context_add_class (GTK_WIDGET(gui->dialog), "gnc-class-imports");
gtk_window_set_transient_for (GTK_WINDOW (gui->dialog), parent);

View File

@ -3616,8 +3616,9 @@ get_assistant_widgets (QIFImportWindow *wind, GtkBuilder *builder)
GTK_TEXT_VIEW(wind->convert_log));
wind->summary_text = GTK_WIDGET(gtk_builder_get_object (builder, "summary_page"));
// Set the style context for this assistant so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(wind->window), "GncAssistQifImport");
// Set the name for this assistant so it can be easily manipulated with css
gtk_widget_set_name (GTK_WIDGET(wind->window), "gnc-id-assistant-qif-import");
gnc_widget_style_context_add_class (GTK_WIDGET(wind->window), "gnc-class-imports");
wind->new_transaction_view =
GTK_WIDGET(gtk_builder_get_object (builder, "new_transaction_view"));