Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lafenghu
xaw3d
Xaw3d-1.5E-hsbar.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Xaw3d-1.5E-hsbar.patch of Package xaw3d
--- Viewport.c +++ Viewport.c 2004-08-26 16:23:27.312736448 +0200 @@ -239,7 +239,7 @@ XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); if (sw) { - pad = 2; + pad = 2 * sw; arg_cnt = 0; XtSetArg(threeD_args[arg_cnt], XtNborderWidth, 0); arg_cnt++; @@ -257,8 +257,8 @@ XtSetArg(clip_args[arg_cnt], XtNright, XtChainRight); arg_cnt++; XtSetArg(clip_args[arg_cnt], XtNtop, XtChainTop); arg_cnt++; XtSetArg(clip_args[arg_cnt], XtNbottom, XtChainBottom); arg_cnt++; - XtSetArg(clip_args[arg_cnt], XtNwidth, w->core.width - 2 * sw); arg_cnt++; - XtSetArg(clip_args[arg_cnt], XtNheight, w->core.height - 2 * sw); arg_cnt++; + XtSetArg(clip_args[arg_cnt], XtNwidth, w->core.width - pad); arg_cnt++; + XtSetArg(clip_args[arg_cnt], XtNheight, w->core.height - pad); arg_cnt++; w->viewport.clip = XtCreateManagedWidget("clip", widgetClass, new, clip_args, arg_cnt); @@ -278,8 +278,8 @@ * Set the clip widget to the correct height. */ - clip_width = w->core.width - 2 * sw; - clip_height = w->core.height - 2 * sw; + clip_width = w->core.width - pad; + clip_height = w->core.height - pad; if ( (h_bar != NULL) && ((int)w->core.width > @@ -498,7 +498,6 @@ RedrawThumbs(w); } - static void ComputeLayout(widget, query, destroy_scrollbars) Widget widget; /* Viewport */ Boolean query; /* query child's preferred geom? */ @@ -516,23 +515,13 @@ XtWidgetGeometry intended; Dimension pad = 0, sw = 0; - /* - * I've made two optimizations here. The first does away with the - * loop, and the second defers setting the child dimensions to the - * clip if smaller until after adjusting for possible scrollbars. - * If you find that these go too far, define the identifiers here - * as required. -- djhjr - */ -#define NEED_LAYOUT_LOOP -#undef PREP_CHILD_TO_CLIP - if (child == (Widget) NULL) return; XtVaGetValues(threeD, XtNshadowWidth, &sw, NULL); - if (sw) pad = 2; + if (sw) pad = 2 * sw; - clip_width = w->core.width - 2 * sw; - clip_height = w->core.height - 2 * sw; + clip_width = w->core.width - pad; + clip_height = w->core.height - pad; intended.request_mode = CWBorderWidth; intended.border_width = 0; @@ -543,10 +532,8 @@ &clip_width, &clip_height); } else { -#ifdef NEED_LAYOUT_LOOP Dimension prev_width, prev_height; XtGeometryMask prev_mode; -#endif XtWidgetGeometry preferred; needshoriz = needsvert = False; @@ -560,31 +547,25 @@ if (!w->viewport.allowhoriz) intended.request_mode |= CWWidth; -#ifdef PREP_CHILD_TO_CLIP - if ((int)child->core.width < clip_width) - intended.width = clip_width; + if ((int)child->core.width < clip_width + pad) + intended.width = clip_width + pad; else -#endif intended.width = child->core.width; - if (!w->viewport.allowvert) - intended.request_mode |= CWHeight; - -#ifdef PREP_CHILD_TO_CLIP - if ((int)child->core.height < clip_height) - intended.height = clip_height; + if ((int)child->core.height < clip_height + pad) + intended.height = clip_height + pad; else -#endif intended.height = child->core.height; + if (!w->viewport.allowvert) + intended.request_mode |= CWHeight; + if (!query) { preferred.width = child->core.width; preferred.height = child->core.height; } -#ifdef NEED_LAYOUT_LOOP do { /* while intended != prev */ -#endif if (query) { (void) XtQueryGeometry( child, &intended, &preferred ); if ( !(preferred.request_mode & CWWidth) ) @@ -592,12 +573,9 @@ if ( !(preferred.request_mode & CWHeight) ) preferred.height = intended.height; } - -#ifdef NEED_LAYOUT_LOOP prev_width = intended.width; prev_height = intended.height; prev_mode = intended.request_mode; -#endif /* * Note that having once decided to turn on either bar @@ -607,7 +585,7 @@ #define CheckHoriz() \ if (w->viewport.allowhoriz && \ - (int)preferred.width > clip_width + 2 * sw) { \ + (int)preferred.width > clip_width + pad) { \ if (!needshoriz) { \ Widget bar = w->viewport.horiz_bar; \ needshoriz = True; \ @@ -622,7 +600,7 @@ /* enddef */ CheckHoriz(); if (w->viewport.allowvert && - (int)preferred.height > clip_height + 2 * sw) { + (int)preferred.height > clip_height + pad) { if (!needsvert) { Widget bar = w->viewport.vert_bar; needsvert = True; @@ -636,38 +614,22 @@ intended.height = preferred.height; } -#ifdef PREP_CHILD_TO_CLIP if (!w->viewport.allowhoriz || - (int)preferred.width < clip_width) { - intended.width = clip_width; + (int)preferred.width < clip_width + pad) { + intended.width = clip_width + pad; intended.request_mode |= CWWidth; } if (!w->viewport.allowvert || - (int)preferred.height < clip_height) { - intended.height = clip_height; + (int)preferred.height < clip_height + pad) { + intended.height = clip_height + pad; intended.request_mode |= CWHeight; } -#endif -#ifdef NEED_LAYOUT_LOOP + } while ( intended.request_mode != prev_mode || (intended.request_mode & CWWidth && intended.width != prev_width) || (intended.request_mode & CWHeight && intended.height != prev_height) ); -#endif - -#ifndef PREP_CHILD_TO_CLIP - if (!w->viewport.allowhoriz || - (int)preferred.width < clip_width) { - intended.width = clip_width; - intended.request_mode |= CWWidth; - } - if (!w->viewport.allowvert || - (int)preferred.height < clip_height) { - intended.height = clip_height; - intended.request_mode |= CWHeight; - } -#endif } bar_width = bar_height = 0; @@ -712,7 +674,7 @@ else { int bw = bar->core.border_width; XtResizeWidget( bar, - (Dimension)(clip_width + 2 * sw), bar->core.height, + (Dimension)(clip_width + pad), bar->core.height, (Dimension)bw ); XtMoveWidget( bar, (Position)((needsvert && !w->viewport.useright) @@ -737,7 +699,7 @@ else { int bw = bar->core.border_width; XtResizeWidget( bar, - bar->core.width, (Dimension)(clip_height + 2 * sw), + bar->core.width, (Dimension)(clip_height + pad), (Dimension)bw ); XtMoveWidget( bar, (Position)(w->viewport.useright @@ -790,7 +752,7 @@ */ XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); - if (sw) pad = 2; + if (sw) pad = 2 * sw; if (w->viewport.allowvert) { if (w->viewport.vert_bar == NULL) @@ -942,7 +906,7 @@ Dimension pad = 0, sw = 0; XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); - if (sw) pad = 2; + if (sw) pad = 2 * sw; plusScrollbars = *request; if ((bar = w->viewport.horiz_bar) == (Widget)NULL) @@ -1015,7 +979,7 @@ return XtGeometryNo; XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); - if (sw) pad = 2; + if (sw) pad = 2 * sw; allowed = *request; --- Text.c +++ Text.c 2004-08-26 16:18:45.507577344 +0200 @@ -475,8 +478,10 @@ (XtPointer) NULL); /**/ - ctx->text.r_margin.bottom += hbar->core.height + hbar->core.border_width; - ctx->text.margin.bottom = ctx->text.r_margin.bottom; + if (ctx->text.scroll_vert == XawtextScrollAlways) { + ctx->text.r_margin.bottom += hbar->core.height + hbar->core.border_width; + ctx->text.margin.bottom = ctx->text.r_margin.bottom; + } /**/ PositionHScrollBar(ctx); if (XtIsRealized((Widget)ctx)) { @@ -500,8 +505,10 @@ if (hbar == NULL) return; /**/ - ctx->text.r_margin.bottom -= hbar->core.height + hbar->core.border_width; - ctx->text.margin.bottom = ctx->text.r_margin.bottom; + if (ctx->text.scroll_vert == XawtextScrollAlways) { + ctx->text.r_margin.bottom -= hbar->core.height + hbar->core.border_width; + ctx->text.margin.bottom = ctx->text.r_margin.bottom; + } /**/ if (ctx->text.vbar == NULL) XtRemoveCallback((Widget) ctx, XtNunrealizeCallback, UnrealizeScrollbars,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor