/*----------------------------------------------------------------------*/ static void LayoutTitle(Widget w) { XfeFancyBoxPart * fp = _XfeFancyBoxPart(w); XfeComboBoxPart * cp = _XfeComboBoxPart(w); int x; int total_icon_width = 0; if (_XfeIsAlive(fp->icon)) { x = _XfeX(fp->icon) + _XfeWidth(fp->icon); total_icon_width = _XfeWidth(fp->icon) + cp->spacing; } else { x = CB_OFFSET_LEFT(w,cp) + cp->title_shadow_thickness; } _XfeConfigureWidget(cp->title, x, (_XfeHeight(w) - _XfeHeight(cp->title)) / 2, CB_RECT_WIDTH(w,cp) - cp->spacing - _XfeWidth(cp->arrow) - total_icon_width - 2 * cp->title_shadow_thickness, CB_RECT_HEIGHT(w,cp) - 2 * cp->title_shadow_thickness); }
/*----------------------------------------------------------------------*/ static void DrawTitleShadow(Widget w,XEvent * event,Region region,XRectangle * clip_rect) { XfeFancyBoxPart * fp = _XfeFancyBoxPart(w); XfeComboBoxPart * cp = _XfeComboBoxPart(w); /* Make sure the shadow is needed */ if (!cp->title_shadow_thickness) { return; } if (_XfeIsAlive(fp->icon)) { Dimension icon_x1 = _XfeX(fp->icon) - cp->spacing; Dimension title_x2 = _XfeX(cp->title) + _XfeWidth(cp->title); /* Draw the shadow around the icon and text */ _XmDrawShadows(XtDisplay(w), _XfeWindow(w), _XfemTopShadowGC(w),_XfemBottomShadowGC(w), CB_OFFSET_LEFT(w,cp), _XfeY(cp->title) - cp->title_shadow_thickness, (title_x2 - icon_x1) + 2 * cp->title_shadow_thickness, _XfeHeight(cp->title) + 2 * cp->title_shadow_thickness, cp->title_shadow_thickness, cp->title_shadow_type); } else { /* Draw the shadow around the text only */ XfeDrawShadowsAroundWidget(w, cp->title, _XfemTopShadowGC(w), _XfemBottomShadowGC(w), 0, cp->title_shadow_thickness, cp->title_shadow_type); } }
/*----------------------------------------------------------------------*/ static void PreferredGeometry(Widget w,Dimension * width,Dimension * height) { XfeComboBoxPart * cp = _XfeComboBoxPart(w); *height = CB_OFFSET_TOP(w,cp) + CB_OFFSET_BOTTOM(w,cp) + XfeMax(_XfeHeight(cp->title),_XfeHeight(cp->arrow)) + 2 * cp->title_shadow_thickness; *width = CB_OFFSET_LEFT(w,cp) + CB_OFFSET_RIGHT(w,cp) + _XfeWidth(cp->title) + cp->spacing + _XfeWidth(cp->arrow) + 2 * cp->title_shadow_thickness; }
/*----------------------------------------------------------------------*/ static void LayoutTitle(Widget w) { XfeComboBoxPart * cp = _XfeComboBoxPart(w); _XfeConfigureWidget(cp->title, CB_OFFSET_LEFT(w,cp) + cp->title_shadow_thickness, (_XfeHeight(w) - _XfeHeight(cp->title)) / 2, CB_RECT_WIDTH(w,cp) - cp->spacing - _XfeWidth(cp->arrow) - 2 * cp->title_shadow_thickness, CB_RECT_HEIGHT(w,cp) - 2 * cp->title_shadow_thickness); }
/*----------------------------------------------------------------------*/ static void IconLayout(Widget w) { XfeFancyBoxPart * fp = _XfeFancyBoxPart(w); XfeComboBoxPart * cp = _XfeComboBoxPart(w); if (!_XfeIsAlive(fp->icon)) { return; } _XfeConfigureWidget(fp->icon, CB_OFFSET_LEFT(w,cp) + cp->title_shadow_thickness + cp->spacing, (_XfeHeight(w) - _XfeHeight(fp->icon)) / 2, _XfeWidth(fp->icon), _XfeHeight(fp->icon)); }