mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug #610675: Revert the gnc-main-window parts of r18637 because it makes the tab names disappear under Windows.
This disables the enhancement of bug#608329 again, but the disappearing of the tab names is a rather major bug. Note that we either need to fix the enhancement again, or revert the rest of r18637 as well so that the account properties don't show the color chooser without any effects. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18714 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1691,68 +1691,38 @@ main_window_find_tab_items (GncMainWindow *window,
|
||||
GtkWidget **entry_p)
|
||||
{
|
||||
GncMainWindowPrivate *priv;
|
||||
GtkWidget *tab_hbox, *widget, *event_box;
|
||||
GtkWidget *tab_hbox, *widget;
|
||||
GList *children, *tmp;
|
||||
|
||||
ENTER("window %p, page %p, label_p %p, entry_p %p",
|
||||
window, page, label_p, entry_p);
|
||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||
*label_p = *entry_p = NULL;
|
||||
|
||||
event_box = gtk_notebook_get_tab_label(GTK_NOTEBOOK(priv->notebook),
|
||||
tab_hbox = gtk_notebook_get_tab_label(GTK_NOTEBOOK(priv->notebook),
|
||||
page->notebook_page);
|
||||
|
||||
tab_hbox = gtk_bin_get_child(GTK_BIN(event_box));
|
||||
|
||||
children = gtk_container_get_children(GTK_CONTAINER(tab_hbox));
|
||||
for (tmp = children; tmp; tmp = g_list_next(tmp)) {
|
||||
widget = tmp->data;
|
||||
if (GTK_IS_LABEL(widget)) {
|
||||
*label_p = widget;
|
||||
if (GTK_IS_EVENT_BOX(widget)) {
|
||||
*label_p = gtk_bin_get_child(GTK_BIN(widget));
|
||||
} else if (GTK_IS_ENTRY(widget)) {
|
||||
*entry_p = widget;
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free(children);
|
||||
|
||||
LEAVE("label %p, entry %p", *label_p, *entry_p);
|
||||
return (*label_p && *entry_p);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
main_window_find_tab_event (GncMainWindow *window,
|
||||
GncPluginPage *page,
|
||||
GtkWidget **event_p)
|
||||
{
|
||||
GncMainWindowPrivate *priv;
|
||||
GtkWidget *event_box;
|
||||
|
||||
ENTER("window %p, page %p, event %p",
|
||||
window, page, event_p);
|
||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||
*event_p = NULL;
|
||||
|
||||
event_box = gtk_notebook_get_tab_label(GTK_NOTEBOOK(priv->notebook),
|
||||
page->notebook_page);
|
||||
if (GTK_IS_EVENT_BOX(event_box)) {
|
||||
*event_p = event_box;
|
||||
LEAVE("event %p", *event_p);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
LEAVE("event %p", *event_p);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
main_window_update_page_name (GncPluginPage *page,
|
||||
const gchar *name_in)
|
||||
{
|
||||
GncMainWindow *window;
|
||||
GncMainWindowPrivate *priv;
|
||||
GtkWidget *label, *entry, *event_box;
|
||||
gchar *name, *old_page_name, *old_page_long_name;
|
||||
GtkWidget *label, *entry;
|
||||
gchar *name;
|
||||
|
||||
ENTER(" ");
|
||||
|
||||
@@ -1761,7 +1731,6 @@ main_window_update_page_name (GncPluginPage *page,
|
||||
return;
|
||||
}
|
||||
name = g_strstrip(g_strdup(name_in));
|
||||
|
||||
/* Optimization, if the name hasn't changed, don't update X. */
|
||||
if (*name == '\0' || 0 == strcmp(name, gnc_plugin_page_get_page_name(page))) {
|
||||
g_free(name);
|
||||
@@ -1769,10 +1738,6 @@ main_window_update_page_name (GncPluginPage *page,
|
||||
return;
|
||||
}
|
||||
|
||||
old_page_name = g_strdup( gnc_plugin_page_get_page_name(page));
|
||||
old_page_long_name = g_strdup( gnc_plugin_page_get_page_long_name(page));
|
||||
|
||||
|
||||
/* Update the plugin */
|
||||
window = GNC_MAIN_WINDOW(page->window);
|
||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||
@@ -1782,22 +1747,6 @@ main_window_update_page_name (GncPluginPage *page,
|
||||
main_window_find_tab_items(window, page, &label, &entry);
|
||||
gtk_label_set_text(GTK_LABEL(label), name);
|
||||
|
||||
/* Update Tooltip on notebook Tab */
|
||||
main_window_find_tab_event(window, page, &event_box);
|
||||
|
||||
if (g_strrstr(old_page_long_name,old_page_name) != NULL) {
|
||||
gchar *new_page_long_name;
|
||||
gint string_position;
|
||||
|
||||
string_position = strlen(old_page_long_name) - strlen(old_page_name);
|
||||
new_page_long_name = g_strconcat(g_strndup(old_page_long_name, string_position), name, NULL);
|
||||
|
||||
gnc_plugin_page_set_page_long_name(page, new_page_long_name);
|
||||
gtk_tooltips_set_tip(GTK_TOOLTIPS(tips), event_box, new_page_long_name, NULL);
|
||||
|
||||
g_free(new_page_long_name);
|
||||
}
|
||||
|
||||
/* Update the notebook menu */
|
||||
label = gtk_notebook_get_menu_label (GTK_NOTEBOOK(priv->notebook),
|
||||
page->notebook_page);
|
||||
@@ -1805,8 +1754,6 @@ main_window_update_page_name (GncPluginPage *page,
|
||||
|
||||
/* Force an update of the window title */
|
||||
gnc_main_window_update_title(window);
|
||||
g_free(old_page_long_name);
|
||||
g_free(old_page_name);
|
||||
g_free(name);
|
||||
LEAVE("done");
|
||||
}
|
||||
@@ -1844,11 +1791,8 @@ main_window_update_page_color (GncPluginPage *page,
|
||||
gnc_plugin_page_set_page_color(page, color_string);
|
||||
|
||||
/* Update the notebook tab */
|
||||
main_window_find_tab_event(window, page, &event_box);
|
||||
|
||||
if (gdk_color_parse(color_string, &tab_color)) {
|
||||
gtk_widget_modify_bg(event_box, GTK_STATE_NORMAL, &tab_color);
|
||||
gtk_widget_modify_bg(event_box, GTK_STATE_ACTIVE, &tab_color);
|
||||
}
|
||||
g_free(color_string);
|
||||
LEAVE("done");
|
||||
@@ -2364,11 +2308,10 @@ gnc_main_window_open_page (GncMainWindow *window,
|
||||
GncMainWindowPrivate *priv;
|
||||
GtkWidget *tab_hbox;
|
||||
GtkWidget *label, *entry, *event_box;
|
||||
const gchar *icon, *text, *color_string;
|
||||
const gchar *icon, *text;
|
||||
GtkWidget *image;
|
||||
GList *tmp;
|
||||
gint width;
|
||||
GdkColor tab_color;
|
||||
|
||||
ENTER("window %p, page %p", window, page);
|
||||
|
||||
@@ -2424,23 +2367,13 @@ gnc_main_window_open_page (GncMainWindow *window,
|
||||
image = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image);
|
||||
gtk_box_pack_start (GTK_BOX (tab_hbox), image, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (tab_hbox), label, FALSE, FALSE, 0);
|
||||
}
|
||||
else
|
||||
gtk_box_pack_start (GTK_BOX (tab_hbox), label, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
event_box = gtk_event_box_new();
|
||||
gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box), TRUE);
|
||||
gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box), FALSE);
|
||||
gtk_widget_show(event_box);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(event_box), tab_hbox);
|
||||
|
||||
color_string = gnc_plugin_page_get_page_color(page);
|
||||
if (color_string == NULL) color_string = "";
|
||||
if (gdk_color_parse(color_string, &tab_color)) {
|
||||
gtk_widget_modify_bg(event_box, GTK_STATE_NORMAL, &tab_color);
|
||||
gtk_widget_modify_bg(event_box, GTK_STATE_ACTIVE, &tab_color);
|
||||
}
|
||||
gtk_container_add(GTK_CONTAINER(event_box), label);
|
||||
gtk_box_pack_start (GTK_BOX (tab_hbox), event_box, TRUE, TRUE, 0);
|
||||
|
||||
text = gnc_plugin_page_get_page_long_name(page);
|
||||
if (text) {
|
||||
@@ -2497,7 +2430,7 @@ gnc_main_window_open_page (GncMainWindow *window,
|
||||
/*
|
||||
* Now install it all in the window.
|
||||
*/
|
||||
gnc_main_window_connect(window, page, event_box, label);
|
||||
gnc_main_window_connect(window, page, tab_hbox, label);
|
||||
|
||||
LEAVE("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user