Commit b0da1cce authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

add a way to add edge (snapped) panels

Sat Jul 04 01:41:42 1998  George Lebl  <jirka@5z.com>

        * menu.c: add a way to add edge (snapped) panels
parent 87196b6a
Sat Jul 04 01:41:42 1998 George Lebl <jirka@5z.com>
* menu.c: add a way to add edge (snapped) panels
Sat Jul 04 00:00:25 1998 George Lebl <jirka@5z.com>
* panel-widget.c: optimize sending of the applet_move signal
......
Sat Jul 04 01:41:42 1998 George Lebl <jirka@5z.com>
* menu.c: add a way to add edge (snapped) panels
Sat Jul 04 00:00:25 1998 George Lebl <jirka@5z.com>
* panel-widget.c: optimize sending of the applet_move signal
......
......@@ -7,7 +7,6 @@ AUTOMAKE_OPTIONS = 1.2f
# (it's after 0.20 so I guess swallows can be enabled,
# maybe someone will fix it up)
CFLAGS += -D_SWALLOW_
CFLAGS += -D_DRAWER_
#CXX = mico-c++
## We set this to force the values in mico-c++ to be used. Otherwise,
......
......@@ -133,9 +133,6 @@ static struct argp parser =
};
/*needed for drawers*/
static void panel_setup(GtkWidget *panel);
static int really_exec_prog(int applet_id, char *path, char *param);
static void exec_queue_start_next(void);
......@@ -1149,7 +1146,7 @@ panel_widget_setup(PanelWidget *panel)
NULL);
}
static void
void
panel_setup(GtkWidget *panelw)
{
GtkWidget *panel_menu;
......
......@@ -33,6 +33,8 @@ void back_change(int applet_id, PanelWidget *panel);
PanelOrientType get_applet_orient(PanelWidget *panel);
void panel_setup(GtkWidget *panel);
/* this applet has finished loading, if it was the one we were waiting
on, start the next applet */
void exec_queue_done(int applet_id);
......
......@@ -665,6 +665,55 @@ create_applets_menu(GList **finfo)
return applet_menu;
}
static void
create_new_panel(GtkWidget *w,gpointer data)
{
PanelType type = PTOI(data);
GdkColor bcolor = {0,0,0,1};
GtkWidget *panel;
switch(type) {
case DRAWER_PANEL:
break; /*we don't handle this one here*/
case SNAPPED_PANEL:
panel = snapped_widget_new(SNAPPED_BOTTOM,
SNAPPED_EXPLICIT_HIDE,
SNAPPED_SHOWN,
PANEL_BACK_NONE,
NULL,
TRUE,
&bcolor);
panel_setup(panel);
gtk_widget_show(panel);
break;
}
}
static GtkWidget *
create_add_panel_submenu (void)
{
GtkWidget *menu, *menuitem;
menu = gtk_menu_new ();
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Drawer"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_applet_to_panel_data,
DRAWER_ID);
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Edge Panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) create_new_panel,
(gpointer)SNAPPED_PANEL);
return menu;
}
static GtkWidget *
create_panel_submenu (GtkWidget *app_menu, GtkWidget *applet_menu)
{
......@@ -673,7 +722,7 @@ create_panel_submenu (GtkWidget *app_menu, GtkWidget *applet_menu)
menu = gtk_menu_new ();
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add to panel"));
setup_menuitem (menuitem, 0, _("Add app to panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), app_menu);
......@@ -682,6 +731,12 @@ create_panel_submenu (GtkWidget *app_menu, GtkWidget *applet_menu)
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), applet_menu);
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add new panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
create_add_panel_submenu());
add_menu_separator(menu);
menuitem = gtk_menu_item_new ();
......@@ -698,14 +753,6 @@ create_panel_submenu (GtkWidget *app_menu, GtkWidget *applet_menu)
(GtkSignalFunc) add_applet_to_panel_data,
LOGOUT_ID);
#ifdef _DRAWER_
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add drawer"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_applet_to_panel_data,
DRAWER_ID);
#endif
#ifdef _SWALLOW_
menuitem = gtk_menu_item_new ();
......
......@@ -198,21 +198,21 @@ snapped_widget_set_size(SnappedWidget *snapped)
{
PanelWidget *panel = PANEL_WIDGET(snapped->panel);
if(panel->orient == PANEL_HORIZONTAL) {
gtk_widget_set_usize(GTK_WIDGET(snapped),
gdk_screen_width(),
0);
if(GTK_WIDGET(snapped)->window)
resize_window(GTK_WIDGET(snapped),
gdk_screen_width(),
panel->thick);
gtk_widget_set_usize(GTK_WIDGET(snapped),
gdk_screen_width(),
0);
} else { /*vertical*/
gtk_widget_set_usize(GTK_WIDGET(snapped),
0,
gdk_screen_height());
if(GTK_WIDGET(snapped)->window)
resize_window(GTK_WIDGET(snapped),
panel->thick,
gdk_screen_height());
gtk_widget_set_usize(GTK_WIDGET(snapped),
0,
gdk_screen_height());
}
}
......
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