Skip to content

Commit

Permalink
Fix text alignment in lists
Browse files Browse the repository at this point in the history
  • Loading branch information
dospuntos committed Apr 23, 2024
1 parent 83482f6 commit 564a82b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/ScheduleAddWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ScheduleAddWindow::ScheduleAddWindow(const BRect& frame, const TransactionData&

BString temp;
gCurrentLocale.CurrencyToString(data.Amount().AbsoluteValue(), temp);
label.SetToFormat(B_TRANSLATE("Amount: %s"), temp);
label.SetToFormat(B_TRANSLATE("Amount: %s"), temp.String());

BStringView* amountlabel = new BStringView("amountlabel", label.String());

Expand Down
16 changes: 8 additions & 8 deletions src/TransactionItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ TransactionItem::DrawItem(BView* owner, BRect frame, bool complete)
clip = cliprect;
owner->ConstrainClippingRegion(&clip);
locale.DateToString(fDate, string);
owner->DrawString(string.String(), BPoint(xpos, ypos - 3));
owner->DrawString(string.String(), BPoint(xpos, ypos - 6));
owner->ConstrainClippingRegion(NULL);

xpos += TDateWidth();
Expand All @@ -110,7 +110,7 @@ TransactionItem::DrawItem(BView* owner, BRect frame, bool complete)

// Type
owner->SetHighColor(0, 0, 0);
owner->DrawString(fType.String(), BPoint(xpos + 5, ypos - 3));
owner->DrawString(fType.String(), BPoint(xpos + 5, ypos - 6));

// Line between Type and Payee
xpos += TNumWidth();
Expand All @@ -134,7 +134,7 @@ TransactionItem::DrawItem(BView* owner, BRect frame, bool complete)
if (balance.AsFixed() < 0)
owner->SetHighColor(150, 0, 0);
locale.CurrencyToString(balance, string);
owner->DrawString(string.String(), BPoint(xpos + 5, ypos - 3));
owner->DrawString(string.String(), BPoint(xpos + 5, ypos - 6));

// Line between Balance and Amount
owner->SetHighColor(linecolor);
Expand All @@ -149,7 +149,7 @@ TransactionItem::DrawItem(BView* owner, BRect frame, bool complete)
fAccount->GetLocale().CurrencyToString(fAmount.AbsoluteValue(), string);

owner->ConstrainClippingRegion(&clip);
owner->DrawString(string.String(), BPoint(xpos + 5, ypos - 3));
owner->DrawString(string.String(), BPoint(xpos + 5, ypos - 6));
owner->ConstrainClippingRegion(NULL);

// Line between Amount and Payee
Expand All @@ -165,7 +165,7 @@ TransactionItem::DrawItem(BView* owner, BRect frame, bool complete)
owner->SetHighColor(0, 0, 0);
clip = payee_rect;
owner->ConstrainClippingRegion(&clip);
owner->DrawString(fPayee.String(), BPoint(xpos + 5, ypos - 3));
owner->DrawString(fPayee.String(), BPoint(xpos + 5, ypos - 6));
owner->ConstrainClippingRegion(NULL);

owner->SetHighColor(linecolor);
Expand All @@ -181,7 +181,7 @@ TransactionItem::DrawItem(BView* owner, BRect frame, bool complete)
cliprect.bottom += TRowHeight();
clip = cliprect;
owner->ConstrainClippingRegion(&clip);
owner->DrawString(fCategory.String(), BPoint(xpos, ypos - 3));
owner->DrawString(fCategory.String(), BPoint(xpos, ypos - 6));
owner->ConstrainClippingRegion(NULL);

xpos = r.right / 2;
Expand All @@ -197,10 +197,10 @@ TransactionItem::DrawItem(BView* owner, BRect frame, bool complete)
owner->ConstrainClippingRegion(&clip);
if (fMemo.CountChars() > 0) {
owner->SetHighColor(0, 0, 0);
owner->DrawString(fMemo.String(), BPoint(xpos + 5, ypos - 3));
owner->DrawString(fMemo.String(), BPoint(xpos + 5, ypos - 6));
} else {
owner->SetHighColor(linecolor);
owner->DrawString(B_TRANSLATE("No Memo"), BPoint(xpos + 5, ypos - 3));
owner->DrawString(B_TRANSLATE("No Memo"), BPoint(xpos + 5, ypos - 6));
}
owner->ConstrainClippingRegion(NULL);
}
Expand Down

0 comments on commit 564a82b

Please sign in to comment.