Commit 79fd14ab authored by Jacob Berkman's avatar Jacob Berkman Committed by Jacob Berkman

floating config sync stuff

999-10-22  Jacob Berkman  <jberkman@andrew.cmu.edu>

* panel.c: floating config sync stuff

* menu.c: enabled conversion to/from floating widget,
fixed config sync stuff

* floating-widget.[ch] (floating_widget_change_coords):
add a _change_coords() function
parent 85685ff1
1999-10-22 Jacob Berkman <jberkman@andrew.cmu.edu>
* panel.c: floating config sync stuff
* menu.c: enabled conversion to/from floating widget,
fixed config sync stuff
* floating-widget.[ch] (floating_widget_change_coords):
add a _change_coords() function
* panel_config.c: notebook page for the floating widget
* menu.c: floating panel config stuff
......
1999-10-22 Jacob Berkman <jberkman@andrew.cmu.edu>
* panel.c: floating config sync stuff
* menu.c: enabled conversion to/from floating widget,
fixed config sync stuff
* floating-widget.[ch] (floating_widget_change_coords):
add a _change_coords() function
* panel_config.c: notebook page for the floating widget
* menu.c: floating panel config stuff
......
......@@ -428,6 +428,29 @@ floating_widget_change_orient (FloatingWidget *floating,
}
}
void
floating_widget_change_coords (FloatingWidget *floating,
gint16 x, gint16 y)
{
FloatingPos *pos = FLOATING_POS (floating->pos);
if (pos->x != x || pos->y != y) {
BasePWidget *basep = BASEP_WIDGET (floating);
PanelWidget *panel = PANEL_WIDGET (basep->panel);
floating_widget_change_params (floating,
x, y,
panel->orient,
basep->mode,
basep->state,
panel->sz,
basep->hidebuttons_enabled,
basep->hidebutton_pixmaps_enabled,
panel->back_type,
panel->back_pixmap,
panel->fit_pixmap_bg,
&panel->back_color);
}
}
GtkWidget *
floating_widget_new (gint16 x, gint16 y,
PanelOrientation orient,
......
......@@ -70,6 +70,9 @@ void floating_widget_change_params (FloatingWidget *floating,
int fit_pixmap_bg,
GdkColor *back_color);
void floating_widget_change_coords (FloatingWidget *floating,
gint16 x, gint16 y);
void floating_widget_change_orient (FloatingWidget *floating,
PanelOrientType orient);
......
......@@ -2412,6 +2412,12 @@ convert_to_panel(GtkWidget *widget, gpointer data)
if (IS_BORDER_POS (old_pos))
edge = BORDER_POS (old_pos)->edge;
else if (PANEL_WIDGET (cur_panel)->orient == PANEL_HORIZONTAL)
edge = (y > gdk_screen_height () / 2)
? BORDER_BOTTOM : BORDER_TOP;
else
edge = (x > gdk_screen_width () / 2)
? BORDER_RIGHT : BORDER_LEFT;
border_widget_change_edge (BORDER_WIDGET (basep), edge);
break;
......@@ -2426,6 +2432,13 @@ convert_to_panel(GtkWidget *widget, gpointer data)
if (IS_BORDER_POS (old_pos))
edge = BORDER_POS (old_pos)->edge;
else if (PANEL_WIDGET (cur_panel)->orient == PANEL_HORIZONTAL)
edge = (y > gdk_screen_height () / 2)
? BORDER_BOTTOM : BORDER_TOP;
else
edge = (x > gdk_screen_width () / 2)
? BORDER_RIGHT : BORDER_LEFT;
if (PANEL_WIDGET (cur_panel)->orient == PANEL_HORIZONTAL) {
mid = x + w / 2;
max = gdk_screen_width ();
......@@ -2455,6 +2468,12 @@ convert_to_panel(GtkWidget *widget, gpointer data)
if (IS_BORDER_POS (old_pos))
edge = BORDER_POS (old_pos)->edge;
else if (PANEL_WIDGET (cur_panel)->orient == PANEL_HORIZONTAL)
edge = (y > gdk_screen_height () / 2)
? BORDER_BOTTOM : BORDER_TOP;
else
edge = (x > gdk_screen_width () / 2)
? BORDER_RIGHT : BORDER_LEFT;
if (PANEL_WIDGET (cur_panel)->orient == PANEL_HORIZONTAL) {
val = x;
......@@ -2477,6 +2496,13 @@ convert_to_panel(GtkWidget *widget, gpointer data)
break;
}
case FLOATING_PANEL:
{
convert_setup (basep, FLOATING_POS_TYPE);
floating_widget_change_coords (FLOATING_WIDGET (basep),
x, y);
break;
}
default:
g_assert_not_reached ();
break;
......@@ -2673,7 +2699,9 @@ update_type_menu (GtkWidget *menu, gpointer data)
s = MENU_TYPE_ALIGNED;
else if (IS_SLIDING_WIDGET (basep))
s = MENU_TYPE_SLIDING;
else
else if (IS_FLOATING_WIDGET (basep))
s = MENU_TYPE_FLOATING;
else
return;
menuitem = gtk_object_get_data (GTK_OBJECT (menu), s);
......@@ -2852,6 +2880,7 @@ make_properties_submenu (GtkWidget *menu)
StringEnumPair types[] = { { N_(MENU_TYPE_EDGE), EDGE_PANEL },
{ N_(MENU_TYPE_ALIGNED), ALIGNED_PANEL },
{ N_(MENU_TYPE_SLIDING), SLIDING_PANEL },
{ N_(MENU_TYPE_FLOATING), FLOATING_PANEL },
{ NULL, -1 } };
StringEnumPair modes[] = { { N_(MENU_MODE_EXPLICIT_HIDE), BASEP_EXPLICIT_HIDE },
......
......@@ -73,22 +73,6 @@ static GtkTargetEntry panel_drop_types[] = {
static gint n_panel_drop_types =
sizeof(panel_drop_types) / sizeof(panel_drop_types[0]);
#if 0
static PanelData *
get_lowest_level_master_pd(PanelWidget *panel)
{
PanelData *pd;
while(panel->master_widget)
panel = PANEL_WIDGET(panel->master_widget->parent);
g_return_val_if_fail(panel->panel_parent!=NULL,NULL);
pd = gtk_object_get_user_data(panel->panel_parent);
g_return_val_if_fail(pd!=NULL,NULL);
return pd;
}
#endif
static void
change_window_cursor(GdkWindow *window, GdkCursorType cursor_type)
{
......@@ -253,8 +237,8 @@ panel_orient_change(GtkWidget *widget,
orient_change_foreach,
widget);
if (IS_FLOATING_WIDGET (widget))
update_config_floating_orient (BASEP_WIDGET (widget));
if (IS_FLOATING_WIDGET (PANEL_WIDGET (widget)->panel_parent))
update_config_floating_orient (FLOATING_WIDGET (PANEL_WIDGET (widget)->panel_parent));
panels_to_sync = TRUE;
}
......@@ -964,7 +948,7 @@ basep_pos_connect_signals (BasePWidget *basep)
gtk_signal_connect (GTK_OBJECT (basep->pos),
"floating_coords_change",
GTK_SIGNAL_FUNC (floating_pos_change),
basep);
basep);
else if (IS_SLIDING_WIDGET (basep)) {
gtk_signal_connect (GTK_OBJECT (basep->pos),
"anchor_change",
......
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