Move inline css for padding to gnucash.css

This commit is contained in:
Robert Fewell 2017-08-31 13:55:30 +01:00
parent 03dd7ab399
commit 1ec2817c77
2 changed files with 12 additions and 20 deletions

View File

@ -2,3 +2,11 @@
unless they have been named or have style classes added. Only unless they have been named or have style classes added. Only
the widget type can be configured unless they are named in code */ the widget type can be configured unless they are named in code */
/* Register Cursor padding settings, make sure entry matches sheet.h */
cursor entry {
padding: 2px 5px 2px 5px;
}
cursor button {
padding: 1px 1px 1px 1px;
}

View File

@ -555,18 +555,8 @@ gnc_item_edit_new (GnucashSheet *sheet)
gtk_entry_set_width_chars (GTK_ENTRY(item_edit->editor), 1); gtk_entry_set_width_chars (GTK_ENTRY(item_edit->editor), 1);
gtk_box_pack_start (GTK_BOX(item_edit), item_edit->editor, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX(item_edit), item_edit->editor, TRUE, TRUE, 0);
/* Force padding on the entry to align with the rest of the register */ /* Force padding on the entry to align with the rest of the register this
hpad_str = g_strdup_printf("%i", CELL_HPADDING); is done in the gnucash.css file which should be in line with sheet.h */
vpad_str = g_strdup_printf("%i", CELL_VPADDING);
entry_css = g_strconcat ("* { padding: ", vpad_str, "px ", hpad_str, "px ", vpad_str, "px ", hpad_str, "px }", NULL);
provider = gtk_css_provider_new();
gtk_css_provider_load_from_data (provider, entry_css, -1, NULL);
stylecontext = gtk_widget_get_style_context (item_edit->editor);
gtk_style_context_add_provider (stylecontext, GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_free (hpad_str);
g_free (vpad_str);
g_free (entry_css);
/* Create the popup button /* Create the popup button
It will only be displayed when the cell being edited provides It will only be displayed when the cell being edited provides
@ -574,14 +564,8 @@ gnc_item_edit_new (GnucashSheet *sheet)
item_edit->popup_toggle.tbutton = gtk_toggle_button_new(); item_edit->popup_toggle.tbutton = gtk_toggle_button_new();
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (item_edit->popup_toggle.tbutton), FALSE); gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (item_edit->popup_toggle.tbutton), FALSE);
/* Force padding on the button to /* Force padding on the button to keep it small and display as much as
1. keep it small possible of the arrow which is done in the gnucash.css file */
2. display as much as possible of the arrow */
provider = gtk_css_provider_new();
gtk_css_provider_load_from_data (provider, "* { padding: 1px }", -1, NULL);
stylecontext = gtk_widget_get_style_context (item_edit->popup_toggle.tbutton);
gtk_style_context_add_provider (stylecontext, GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
/* Wrap the popup button in an event box to give it its own gdkwindow. /* Wrap the popup button in an event box to give it its own gdkwindow.
* Without one the button would disappear behind the grid object. */ * Without one the button would disappear behind the grid object. */