Qt hitpointbar tweak

When the hitpointbar is showing thick blue + thin dark blue (75%
or better health but less than 100%) and partial healing occurs,
the dark blue portion was momentarily visible pushed off the
right edge of the bar, resulting in slight flicker as the right
half of the bar got redrawn.  I haven't noticed anything similar
for the paler injured-side colors, nor any temporary gap between
the two sides when losing health.

Also, remove a workaround that was needed at one point but isn't
needed anymore.  (I don't remember the circumstances.)
This commit is contained in:
PatR
2020-11-15 08:34:19 -08:00
parent f965d187b8
commit 0f6b3fb6eb

View File

@@ -521,8 +521,10 @@ void NetHackQtStatusWindow::HitpointBar()
w = geoH.right() - geoH.left() + 1; // might yield 0 (ie, if dead)
styleH.sprintf(styleformat, barcolors[colorindx][0], w, w);
hpbar_health.setStyleSheet(styleH);
// style sheet should be doing this but width was sticking at full
hpbar_health.setMaximumWidth(w);
// when healing, having the old injury-side shown while the new
// health-side expands pushes the injury farther right and it's
// momentarily visible there before it gets recalculated+redrawn
hpbar_injury.hide(); // will re-show below
hpbar_health.show(); // don't need to hide() if/when width is 0
int oldleft = geoI.left();
@@ -550,7 +552,6 @@ void NetHackQtStatusWindow::HitpointBar()
w = geoH.right() - geoH.left() + 1;
styleH.sprintf(styleformat, barcolors[colorindx][0], w, w);
hpbar_health.setStyleSheet(styleH);
hpbar_health.setMaximumWidth(w); // (see above)
hpbar_health.show();
alreadyfullhp = true;