Commit 389b49b4 authored by John Sullivan's avatar John Sullivan

Reordered code to fix bug where "View as blank space" option menu wasn't sizing

itself correctly; also changed its text and grayed it out to make it obvious
that it isn't working.
parent 0e11f0e3
1999-12-14 John Sullivan <sullivan@eazel.com>
* src/ntl-window.c: (nautilus-window-constructed): Reordered option menu
creation code to fix bug where it wasn't sizing itself properly. Changed
label of placeholder item and desensitized it to make it more obvious that
it's a non-working placeholder.
1999-12-14 Elliot Lee <sopwith@redhat.com>
* configure.in, Makefile.am, icons/: Add icons
......
......@@ -29,6 +29,7 @@
#include "nautilus.h"
#include "explorer-location-bar.h"
typedef struct {
POA_Nautilus_ViewWindow servant;
gpointer gnome_object;
......@@ -283,25 +284,34 @@ nautilus_window_constructed(NautilusWindow *window)
menu_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
menubar = gtk_menu_bar_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, TRUE, TRUE, GNOME_PAD_BIG);
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, FALSE, TRUE, GNOME_PAD_BIG);
gnome_app_fill_menu_with_data(GTK_MENU_SHELL(menubar), main_menu, ag, TRUE, 0, window);
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, TRUE, TRUE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
window->menu_cvtype = gtk_menu_new();
// FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
// Since menu doesn't yet work, make it insensitive.
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
// For mysterious reasons, connecting these signals before laying out the menu
// and option menu ends up making the option menu not know how to size itself (i.e,
// it is zero-width unless you turn on expand and fill). So we do it here afterwards.
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
wtmp = gtk_menu_item_new_with_label(_("View as blank space"));
gtk_container_add(GTK_CONTAINER(window->menu_cvtype), wtmp);
gtk_widget_show(wtmp);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_widget_queue_resize(window->menu_cvtype);
/* A hacked-up version of gnome_app_set_menu(). We need this to use our 'menubar' for the actual menubar stuff,
but our menu_hbox for the widget being docked. */
......
......@@ -29,6 +29,7 @@
#include "nautilus.h"
#include "explorer-location-bar.h"
typedef struct {
POA_Nautilus_ViewWindow servant;
gpointer gnome_object;
......@@ -283,25 +284,34 @@ nautilus_window_constructed(NautilusWindow *window)
menu_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
menubar = gtk_menu_bar_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, TRUE, TRUE, GNOME_PAD_BIG);
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, FALSE, TRUE, GNOME_PAD_BIG);
gnome_app_fill_menu_with_data(GTK_MENU_SHELL(menubar), main_menu, ag, TRUE, 0, window);
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, TRUE, TRUE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
window->menu_cvtype = gtk_menu_new();
// FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
// Since menu doesn't yet work, make it insensitive.
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
// For mysterious reasons, connecting these signals before laying out the menu
// and option menu ends up making the option menu not know how to size itself (i.e,
// it is zero-width unless you turn on expand and fill). So we do it here afterwards.
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
wtmp = gtk_menu_item_new_with_label(_("View as blank space"));
gtk_container_add(GTK_CONTAINER(window->menu_cvtype), wtmp);
gtk_widget_show(wtmp);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_widget_queue_resize(window->menu_cvtype);
/* A hacked-up version of gnome_app_set_menu(). We need this to use our 'menubar' for the actual menubar stuff,
but our menu_hbox for the widget being docked. */
......
......@@ -29,6 +29,7 @@
#include "nautilus.h"
#include "explorer-location-bar.h"
typedef struct {
POA_Nautilus_ViewWindow servant;
gpointer gnome_object;
......@@ -283,25 +284,34 @@ nautilus_window_constructed(NautilusWindow *window)
menu_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
menubar = gtk_menu_bar_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, TRUE, TRUE, GNOME_PAD_BIG);
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, FALSE, TRUE, GNOME_PAD_BIG);
gnome_app_fill_menu_with_data(GTK_MENU_SHELL(menubar), main_menu, ag, TRUE, 0, window);
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, TRUE, TRUE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
window->menu_cvtype = gtk_menu_new();
// FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
// Since menu doesn't yet work, make it insensitive.
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
// For mysterious reasons, connecting these signals before laying out the menu
// and option menu ends up making the option menu not know how to size itself (i.e,
// it is zero-width unless you turn on expand and fill). So we do it here afterwards.
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
wtmp = gtk_menu_item_new_with_label(_("View as blank space"));
gtk_container_add(GTK_CONTAINER(window->menu_cvtype), wtmp);
gtk_widget_show(wtmp);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_widget_queue_resize(window->menu_cvtype);
/* A hacked-up version of gnome_app_set_menu(). We need this to use our 'menubar' for the actual menubar stuff,
but our menu_hbox for the widget being docked. */
......
......@@ -29,6 +29,7 @@
#include "nautilus.h"
#include "explorer-location-bar.h"
typedef struct {
POA_Nautilus_ViewWindow servant;
gpointer gnome_object;
......@@ -283,25 +284,34 @@ nautilus_window_constructed(NautilusWindow *window)
menu_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
menubar = gtk_menu_bar_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, TRUE, TRUE, GNOME_PAD_BIG);
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, FALSE, TRUE, GNOME_PAD_BIG);
gnome_app_fill_menu_with_data(GTK_MENU_SHELL(menubar), main_menu, ag, TRUE, 0, window);
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, TRUE, TRUE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
window->menu_cvtype = gtk_menu_new();
// FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
// Since menu doesn't yet work, make it insensitive.
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
// For mysterious reasons, connecting these signals before laying out the menu
// and option menu ends up making the option menu not know how to size itself (i.e,
// it is zero-width unless you turn on expand and fill). So we do it here afterwards.
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
wtmp = gtk_menu_item_new_with_label(_("View as blank space"));
gtk_container_add(GTK_CONTAINER(window->menu_cvtype), wtmp);
gtk_widget_show(wtmp);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_widget_queue_resize(window->menu_cvtype);
/* A hacked-up version of gnome_app_set_menu(). We need this to use our 'menubar' for the actual menubar stuff,
but our menu_hbox for the widget being docked. */
......
......@@ -29,6 +29,7 @@
#include "nautilus.h"
#include "explorer-location-bar.h"
typedef struct {
POA_Nautilus_ViewWindow servant;
gpointer gnome_object;
......@@ -283,25 +284,34 @@ nautilus_window_constructed(NautilusWindow *window)
menu_hbox = gtk_hbox_new(FALSE, GNOME_PAD);
menubar = gtk_menu_bar_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, TRUE, TRUE, GNOME_PAD_BIG);
gtk_box_pack_end(GTK_BOX(menu_hbox), menubar, FALSE, TRUE, GNOME_PAD_BIG);
gnome_app_fill_menu_with_data(GTK_MENU_SHELL(menubar), main_menu, ag, TRUE, 0, window);
window->option_cvtype = gtk_option_menu_new();
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, TRUE, TRUE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
window->menu_cvtype = gtk_menu_new();
// FIXME: Add in placeholder item for now; rework this when we get the right views showing up.
// Since menu doesn't yet work, make it insensitive.
gtk_container_add(GTK_CONTAINER(window->menu_cvtype),
gtk_menu_item_new_with_label(_("View as (placeholder)")));
gtk_widget_set_sensitive(window->option_cvtype, FALSE);
gtk_widget_show_all(window->menu_cvtype);
gtk_option_menu_set_menu(GTK_OPTION_MENU(window->option_cvtype), window->menu_cvtype);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_box_pack_end(GTK_BOX(menu_hbox), window->option_cvtype, FALSE, FALSE, GNOME_PAD_BIG);
gtk_widget_show(window->option_cvtype);
// For mysterious reasons, connecting these signals before laying out the menu
// and option menu ends up making the option menu not know how to size itself (i.e,
// it is zero-width unless you turn on expand and fill). So we do it here afterwards.
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "add",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
gtk_signal_connect_while_alive(GTK_OBJECT(window->menu_cvtype), "remove",
GTK_SIGNAL_FUNC(gtk_option_menu_do_resize), window->option_cvtype,
GTK_OBJECT(window->option_cvtype));
wtmp = gtk_menu_item_new_with_label(_("View as blank space"));
gtk_container_add(GTK_CONTAINER(window->menu_cvtype), wtmp);
gtk_widget_show(wtmp);
gtk_option_menu_set_history(GTK_OPTION_MENU(window->option_cvtype), 0);
gtk_widget_queue_resize(window->menu_cvtype);
/* A hacked-up version of gnome_app_set_menu(). We need this to use our 'menubar' for the actual menubar stuff,
but our menu_hbox for the widget being docked. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment