Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text alignment in lists #46

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading