Skip to content

Commit

Permalink
Use status window pad settings to calculate width
Browse files Browse the repository at this point in the history
Reported in pekwm#171
  • Loading branch information
pclouds committed Aug 16, 2024
1 parent 8f3e4fe commit 9bc0475
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/StatusWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ StatusWindow::draw(const std::string &text, bool do_center, Geometry *gm)
Theme::TextDialogData *sd = _theme->getStatusData();
PFont *font = sd->getFont();

width = font->getWidth(text) + 10;
width = font->getWidth(text)
+ sd->getPad(PAD_LEFT)
+ sd->getPad(PAD_RIGHT);
width = width - (width % 10);
height = font->getHeight()
+ sd->getPad(PAD_UP)
Expand All @@ -99,7 +101,7 @@ StatusWindow::draw(const std::string &text, bool do_center, Geometry *gm)
font->setColor(sd->getColor());
X11::clearWindow(_status_wo->getWindow());
font->draw(_status_wo,
(width - font->getWidth(text)) / 2,
sd->getPad(PAD_LEFT),
sd->getPad(PAD_UP),
text.c_str());
}
Expand Down

0 comments on commit 9bc0475

Please sign in to comment.