adds option to have the popup centered above the window instead of centered, and fix the last occurance of that reversed variable

This commit is contained in:
Mikael Magnusson 2004-03-21 00:48:48 +00:00
parent e8339970d8
commit 64c65f3b67
3 changed files with 26 additions and 7 deletions

View file

@ -42,6 +42,7 @@ gint config_screen_firstdesk;
gboolean config_resize_redraw;
gint config_resize_popup_show;
gint config_resize_popup_pos;
ObStackingLayer config_dock_layer;
gboolean config_dock_floating;
@ -301,6 +302,12 @@ static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
else if (parse_contains("Nonpixel", doc, n))
config_resize_popup_show = 1;
}
if ((n = parse_find_node("popupPosition", node))) {
if (parse_contains("Top", doc, n))
config_resize_popup_pos = 1;
else if (parse_contains("Center", doc, n))
config_resize_popup_pos = 0;
}
}
static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
@ -540,7 +547,8 @@ void config_startup(ObParseInst *i)
parse_register(i, "desktops", parse_desktops, NULL);
config_resize_redraw = TRUE;
config_resize_popup_show = 1;
config_resize_popup_show = 1; /* nonpixel increments */
config_resize_popup_pos = 0; /* center of client */
parse_register(i, "resize", parse_resize, NULL);

View file

@ -43,7 +43,12 @@ extern ObPlacePolicy config_place_policy;
/*! When true windows' contents are refreshed while they are resized; otherwise
they are not updated until the resize is complete */
extern gboolean config_redraw_resize;
extern gboolean config_resize_redraw;
/*! show move/resize popups? 0 = no, 1 = always, 2 = only
resizing !1 increments */
extern gint config_resize_popup_show;
/*! where to show the popup, currently above the window or centered */
extern gint config_resize_popup_pos;
/*! The stacking layer the dock will reside in */
extern ObStackingLayer config_dock_layer;

View file

@ -77,11 +77,17 @@ static void popup_coords(ObClient *c, gchar *format, gint a, gint b)
gchar *text;
text = g_strdup_printf(format, a, b);
popup_position(popup, CenterGravity,
c->frame->area.x + c->frame->size.left +
c->area.width / 2,
c->frame->area.y + c->frame->size.top +
c->area.height / 2);
if (config_resize_popup_pos == 1) /* == "Top" */
popup_position(popup, SouthGravity,
c->frame->area.x
+ c->frame->area.width/2,
c->frame->area.y);
else /* == "Center" */
popup_position(popup, CenterGravity,
c->frame->area.x + c->frame->size.left +
c->area.width / 2,
c->frame->area.y + c->frame->size.top +
c->area.height / 2);
popup_show(popup, text);
g_free(text);
}