163 строки
5.8 KiB
Diff
163 строки
5.8 KiB
Diff
diff -up libXaw3d-1.6.1/src/Label.c.3Dlabel libXaw3d-1.6.1/src/Label.c
|
|
--- libXaw3d-1.6.1/src/Label.c.3Dlabel 2011-09-19 15:42:36.000000000 -0600
|
|
+++ libXaw3d-1.6.1/src/Label.c 2012-02-25 14:44:33.766774776 -0700
|
|
@@ -416,9 +416,16 @@ GetgrayGC(LabelWidget lw)
|
|
static void
|
|
compute_bitmap_offsets (LabelWidget lw)
|
|
{
|
|
- if (lw->label.lbm_height != 0)
|
|
- lw->label.lbm_y = (lw->core.height - lw->label.lbm_height) / 2;
|
|
- else
|
|
+ /*
|
|
+ * bitmap will be eventually be displayed at
|
|
+ * (internal_width, internal_height + lbm_y)
|
|
+ */
|
|
+ if (lw->label.lbm_height != 0) {
|
|
+ lw->label.lbm_y = (lw->core.height -
|
|
+ (lw->threeD.shadow_width * 2 +
|
|
+ lw->label.internal_height * 2 +
|
|
+ lw->label.lbm_height)) / 2;
|
|
+ } else
|
|
lw->label.lbm_y = 0;
|
|
}
|
|
|
|
@@ -444,9 +451,11 @@ Initialize(Widget request, Widget new, A
|
|
{
|
|
LabelWidget lw = (LabelWidget) new;
|
|
|
|
+#if 0
|
|
/* disable shadows if we're not a subclass of Command */
|
|
if (!XtIsSubclass(new, commandWidgetClass))
|
|
lw->threeD.shadow_width = 0;
|
|
+#endif
|
|
|
|
if (lw->label.label == NULL)
|
|
lw->label.label = XtNewString(lw->core.name);
|
|
@@ -460,18 +469,20 @@ Initialize(Widget request, Widget new, A
|
|
|
|
if (lw->core.height == 0)
|
|
lw->core.height = lw->label.label_height +
|
|
- 2 * lw->label.internal_height;
|
|
+ 2 * lw->label.internal_height +
|
|
+ 2 * lw->threeD.shadow_width;
|
|
|
|
set_bitmap_info(lw); /* req's core.height, sets label.lbm_* */
|
|
|
|
if (lw->label.lbm_height > lw->label.label_height)
|
|
lw->core.height = lw->label.lbm_height +
|
|
- 2 * lw->label.internal_height;
|
|
+ 2 * lw->label.internal_height;
|
|
|
|
if (lw->core.width == 0)
|
|
lw->core.width = lw->label.label_width +
|
|
- 2 * lw->label.internal_width +
|
|
- LEFT_OFFSET(lw); /* req's label.lbm_width */
|
|
+ 2 * lw->label.internal_width +
|
|
+ 2 * lw->threeD.shadow_width +
|
|
+ LEFT_OFFSET(lw); /* req's label.lbm_width */
|
|
|
|
lw->label.label_x = lw->label.label_y = 0;
|
|
(*XtClass(new)->core_class.resize) ((Widget)lw);
|
|
@@ -549,14 +560,16 @@ Redisplay(Widget gw, XEvent *event, Regi
|
|
if (w->label.depth == 1)
|
|
XCopyPlane(XtDisplay(gw), pm, XtWindow(gw), gc, 0, 0,
|
|
w->label.lbm_width, w->label.lbm_height,
|
|
- (int) w->label.internal_width,
|
|
- (int) w->label.lbm_y,
|
|
+ (int) w->label.internal_width + w->threeD.shadow_width,
|
|
+ (int) w->label.internal_height + w->threeD.shadow_width
|
|
+ + w->label.lbm_y,
|
|
(unsigned long) 1L);
|
|
else
|
|
XCopyArea(XtDisplay(gw), pm, XtWindow(gw), gc, 0, 0,
|
|
w->label.lbm_width, w->label.lbm_height,
|
|
- (int) w->label.internal_width,
|
|
- (int) w->label.lbm_y);
|
|
+ (int) w->label.internal_width + w->threeD.shadow_width,
|
|
+ (int) w->label.internal_height + w->threeD.shadow_width
|
|
+ + w->label.lbm_y);
|
|
}
|
|
|
|
#ifdef XAW_INTERNATIONALIZATION
|
|
@@ -646,14 +659,17 @@ _Reposition(LabelWidget lw, Dimension wi
|
|
Position *dx, Position *dy)
|
|
{
|
|
Position newPos;
|
|
- Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw);
|
|
+ Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw) +
|
|
+ lw->threeD.shadow_width;
|
|
+
|
|
|
|
switch (lw->label.justify) {
|
|
case XtJustifyLeft:
|
|
newPos = leftedge;
|
|
break;
|
|
case XtJustifyRight:
|
|
- newPos = width - lw->label.label_width - lw->label.internal_width;
|
|
+ newPos = width - (lw->label.label_width + lw->label.internal_width +
|
|
+ lw->threeD.shadow_width);
|
|
break;
|
|
case XtJustifyCenter:
|
|
default:
|
|
@@ -745,17 +761,20 @@ SetValues(Widget current, Widget request
|
|
if (newlw->label.resize && was_resized) {
|
|
if (curlw->core.height == reqlw->core.height && !checks[HEIGHT])
|
|
newlw->core.height = newlw->label.label_height +
|
|
- 2 * newlw->label.internal_height;
|
|
+ 2 * newlw->label.internal_height +
|
|
+ 2 * newlw->threeD.shadow_width;
|
|
|
|
set_bitmap_info (newlw); /* req's core.height, sets label.lbm_* */
|
|
|
|
if (newlw->label.lbm_height > newlw->label.label_height)
|
|
newlw->core.height = newlw->label.lbm_height +
|
|
- 2 * newlw->label.internal_height;
|
|
+ 2 * newlw->label.internal_height +
|
|
+ 2 * newlw->threeD.shadow_width;
|
|
|
|
if (curlw->core.width == reqlw->core.width && !checks[WIDTH])
|
|
newlw->core.width = newlw->label.label_width +
|
|
2 * newlw->label.internal_width +
|
|
+ 2 * newlw->threeD.shadow_width +
|
|
LEFT_OFFSET(newlw); /* req's label.lbm_width */
|
|
}
|
|
|
|
@@ -764,15 +783,20 @@ SetValues(Widget current, Widget request
|
|
if (checks[HEIGHT]) {
|
|
if (newlw->label.label_height > newlw->label.lbm_height)
|
|
i = newlw->label.label_height +
|
|
- 2 * newlw->label.internal_height;
|
|
+ 2 * newlw->label.internal_height +
|
|
+ 2 * newlw->threeD.shadow_width;
|
|
else
|
|
- i = newlw->label.lbm_height + 2 * newlw->label.internal_height;
|
|
+ i = newlw->label.lbm_height +
|
|
+ 2 * newlw->label.internal_height +
|
|
+ 2 * newlw->threeD.shadow_width;
|
|
if (i > newlw->core.height)
|
|
newlw->core.height = i;
|
|
}
|
|
if (checks[WIDTH]) {
|
|
- i = newlw->label.label_width + 2 * newlw->label.internal_width +
|
|
- LEFT_OFFSET(newlw); /* req's label.lbm_width */
|
|
+ i = newlw->label.label_width +
|
|
+ 2 * newlw->label.internal_width +
|
|
+ 2 * newlw->threeD.shadow_width +
|
|
+ LEFT_OFFSET(newlw); /* req's label.lbm_width */
|
|
if (i > newlw->core.width)
|
|
newlw->core.width = i;
|
|
}
|
|
@@ -843,9 +867,11 @@ QueryGeometry(Widget w, XtWidgetGeometry
|
|
preferred->request_mode = CWWidth | CWHeight;
|
|
preferred->width = (lw->label.label_width +
|
|
2 * lw->label.internal_width +
|
|
+ 2 * lw->threeD.shadow_width +
|
|
LEFT_OFFSET(lw));
|
|
preferred->height = lw->label.label_height +
|
|
- 2 * lw->label.internal_height;
|
|
+ 2 * lw->label.internal_height +
|
|
+ 2 * lw->threeD.shadow_width;
|
|
if ( ((intended->request_mode & (CWWidth | CWHeight))
|
|
== (CWWidth | CWHeight)) &&
|
|
intended->width == preferred->width &&
|