Use fixed chase font for amount values
This commit is contained in:
parent
2e89948c1f
commit
fb65e585b3
|
@ -241,6 +241,7 @@ QString AccountPanel::GetToolTip()
|
|||
void AccountPanel::InitStatsGrid(User* user)
|
||||
{
|
||||
DEFAULT_FONT(font);
|
||||
DEFAULT_FONT_VALUES(font_values);
|
||||
|
||||
if (!_statsGrid->rowCount())
|
||||
{
|
||||
|
@ -275,6 +276,12 @@ void AccountPanel::InitStatsGrid(User* user)
|
|||
_statsGrid->item(BALANCE, 0)->setFont(font);
|
||||
_statsGrid->item(BALANCE, 1)->setFont(font);
|
||||
|
||||
_statsGrid->item(CUR_CREDIT, 1)->setFont(font_values);
|
||||
_statsGrid->item(CUR_DEBIT, 1)->setFont(font_values);
|
||||
_statsGrid->item(TOTAL_CREDIT, 1)->setFont(font_values);
|
||||
_statsGrid->item(TOTAL_DEBIT, 1)->setFont(font_values);
|
||||
_statsGrid->item(BALANCE, 1)->setFont(font_values);
|
||||
|
||||
_statsGrid->item(CUR_CREDIT, 1)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_statsGrid->item(CUR_DEBIT, 1)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_statsGrid->item(TOTAL_CREDIT, 1)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
|
@ -466,6 +473,7 @@ void AccountPanel::InitAccountsGrid(User* user, int month, int year)
|
|||
QTableWidgetItem* item;
|
||||
QString v;
|
||||
DEFAULT_FONT(font);
|
||||
DEFAULT_FONT_VALUES(font_values);
|
||||
|
||||
font.setBold(true);
|
||||
|
||||
|
@ -528,6 +536,9 @@ void AccountPanel::InitAccountsGrid(User* user, int month, int year)
|
|||
_accountsGrid->item(curLine, ACCOUNT_INIT)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_accountsGrid->item(curLine, ACCOUNT_CUR)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_accountsGrid->item(curLine, ACCOUNT_FINAL)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_accountsGrid->item(curLine, ACCOUNT_INIT)->setFont(font_values);
|
||||
_accountsGrid->item(curLine, ACCOUNT_CUR)->setFont(font_values);
|
||||
_accountsGrid->item(curLine, ACCOUNT_FINAL)->setFont(font_values);
|
||||
}
|
||||
|
||||
_accountsGrid->resizeColumnsToContents();
|
||||
|
|
|
@ -94,6 +94,7 @@ void CostRepartitionBanner::Reset()
|
|||
int i;
|
||||
User* user = _kiss->GetUser();
|
||||
int nb_categories = user->GetCategoriesNumber();
|
||||
DEFAULT_FONT_VALUES(font_values);
|
||||
|
||||
if (!_statsGrid->rowCount())
|
||||
{
|
||||
|
@ -109,6 +110,7 @@ void CostRepartitionBanner::Reset()
|
|||
_statsGrid->setItem(1, 0, new QTableWidgetItem(_("Non fix")));
|
||||
_statsGrid->setItem(1, 1, new QTableWidgetItem(""));
|
||||
_statsGrid->item(1, 1)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_statsGrid->item(1, 1)->setFont(font_values);
|
||||
|
||||
for(i=0; i<nb_categories; i++)
|
||||
{
|
||||
|
@ -117,12 +119,14 @@ void CostRepartitionBanner::Reset()
|
|||
_statsGrid->setItem(i, 0, new QTableWidgetItem(_categories[i]));
|
||||
_statsGrid->setItem(i, 1, new QTableWidgetItem(""));
|
||||
_statsGrid->item(i, 1)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_statsGrid->item(i, 1)->setFont(font_values);
|
||||
}
|
||||
else
|
||||
{
|
||||
_statsGrid->setItem(i+1, 0, new QTableWidgetItem(_categories[i]));
|
||||
_statsGrid->setItem(i+1, 1, new QTableWidgetItem(""));
|
||||
_statsGrid->item(i+1, 1)->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
_statsGrid->item(i+1, 1)->setFont(font_values);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,9 @@
|
|||
{ \
|
||||
if (!this->item(row, i)) setItem(row, i, new QTableWidgetItem("")); \
|
||||
this->item(row, i)->setFont(font); \
|
||||
}
|
||||
} \
|
||||
this->item(row, GridAccount::DEBIT)->setFont(font_values); \
|
||||
this->item(row, GridAccount::CREDIT)->setFont(font_values);
|
||||
|
||||
#define SET_READ_ONLY(item) item->setFlags(item->flags() & ~Qt::ItemIsEditable);
|
||||
|
||||
|
@ -400,6 +402,7 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
|
|||
QDate curDate = QDate::currentDate();
|
||||
QString description, v;
|
||||
DEFAULT_FONT(font);
|
||||
DEFAULT_FONT_VALUES(font_values);
|
||||
Category cat ;
|
||||
Tag tag;
|
||||
Operation op2;
|
||||
|
@ -975,7 +978,8 @@ void GridAccount::OnOperationModified(int row, int col)
|
|||
bool fix_cost;
|
||||
Operation NULLop = Operation();
|
||||
Account account;
|
||||
|
||||
DEFAULT_FONT_VALUES(font_values);
|
||||
|
||||
// Avoid recursives calls
|
||||
if (_inModification || _loadOperations) return;
|
||||
|
||||
|
|
|
@ -27,9 +27,11 @@ namespace view {
|
|||
const QColor OWN_YELLOW(0xFF, 0xFF, 0x99);
|
||||
const QColor OWN_GREEN(0x3D, 0xEB, 0x3D);
|
||||
const QString DEFAULT_FONT_NAME("Liberation Sans");
|
||||
const QString DEFAULT_FONT_NAME_VALUES("Liberation Serif");
|
||||
const int DEFAULT_FONT_SIZE = 12;
|
||||
|
||||
#define DEFAULT_FONT(font_name) QFont font_name;
|
||||
#define DEFAULT_FONT(font_name) QFont font_name(view::DEFAULT_FONT_NAME);
|
||||
#define DEFAULT_FONT_VALUES(font_name) QFont font_name(view::DEFAULT_FONT_NAME_VALUES, view::DEFAULT_FONT_SIZE);
|
||||
};
|
||||
|
||||
#define DELETE_ICON RESOURCES_ROOT "icons/delete.png"
|
||||
|
|
Loading…
Reference in New Issue
Block a user