self->x = self->y = self->textw = self->h = 0;
self->a_bg = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg);
self->a_text = RrAppearanceCopy(ob_rr_theme->osd_hilite_label);
+ self->iconwm = self->iconhm = 1;
attrib.override_redirect = True;
self->bg = XCreateWindow(ob_display, RootWindow(ob_display, ob_screen),
InputOutput, RrVisual(ob_rr_inst), 0, NULL);
XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->fbwidth);
- XSetWindowBorder(ob_display, self->bg, ob_rr_theme->frame_b_color->pixel);
+ XSetWindowBorder(ob_display, self->bg,
+ RrColorPixel(ob_rr_theme->frame_focused_border_color));
XMapWindow(ob_display, self->text);
gint emptyx, emptyy; /* empty space between elements */
gint textx, texty, textw, texth;
gint iconx, icony, iconw, iconh;
+ Rect *area;
+
+ area = screen_physical_area();
RrMargins(self->a_bg, &l, &t, &r, &b);
/* get the height, which is also used for the icon width */
emptyy = t + b + ob_rr_theme->paddingy * 2;
- if (self->h) {
- h = self->h;
- texth = h - emptyy;
- } else
- h = texth + emptyy;
+ if (self->h)
+ texth = self->h - emptyy;
+ h = texth * self->iconhm + emptyy;
if (self->textw)
textw = self->textw;
iconx = textx = l + ob_rr_theme->paddingx;
- icony = texty = t + ob_rr_theme->paddingy;
emptyx = l + r + ob_rr_theme->paddingx * 2;
if (self->hasicon) {
- iconw = iconh = texth;
+ iconw = texth * self->iconwm;
+ iconh = texth * self->iconhm;
textx += iconw + ob_rr_theme->paddingx;
if (textw)
emptyx += ob_rr_theme->paddingx; /* between the icon and text */
} else
iconw = 0;
+ texty = (h - texth - emptyy) / 2 + t + ob_rr_theme->paddingy;
+ icony = (h - iconh - emptyy) / 2 + t + ob_rr_theme->paddingy;
+
w = textw + emptyx + iconw;
/* cap it at maxw/minw */
if (self->maxw) w = MIN(w, self->maxw);
break;
}
+ x=MAX(MIN(x, area->width-w),0);
+ y=MAX(MIN(y, area->height-h),0);
+
/* set the windows/appearances up */
XMoveResizeWindow(ob_display, self->bg, x, y, w, h);
RrPaint(self->a_bg, self->bg, w, h);
self->mapped = FALSE;
/* kill enter events cause by this unmapping */
- event_ignore_queued_enters();
+ event_ignore_all_queued_enters();
} else if (self->delay_mapped) {
ob_main_loop_timeout_remove(ob_main_loop, popup_show_timeout);
self->delay_mapped = FALSE;
popup_delay_show(self->popup, usec, text);
}
+void icon_popup_icon_size_multiplier(ObIconPopup *self, guint wm, guint hm)
+{
+ /* cap them at 1 */
+ self->popup->iconwm = MAX(1, wm);
+ self->popup->iconhm = MAX(1, hm);
+}
+
static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
gpointer data)
{
for (i = self->desks; i < screen_num_desktops; ++i) {
XSetWindowAttributes attr;
- attr.border_pixel = RrColorPixel(ob_rr_theme->frame_b_color);
+ attr.border_pixel =
+ RrColorPixel(ob_rr_theme->frame_focused_border_color);
self->wins[i] = XCreateWindow(ob_display, self->popup->bg,
0, 0, 1, 1, ob_rr_theme->fbwidth,
RrDepth(ob_rr_inst), InputOutput,
popup_delay_show(self->popup, usec, text);
}
+
+void pager_popup_icon_size_multiplier(ObPagerPopup *self, guint wm, guint hm)
+{
+ /* cap them at 1 */
+ self->popup->iconwm = MAX(1, wm);
+ self->popup->iconhm = MAX(1, hm);
+}