Skip to content

Commit

Permalink
Apply clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
humdingerb authored and github-actions[bot] committed May 26, 2024
1 parent 8caa45a commit 355cd6f
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 156 deletions.
23 changes: 12 additions & 11 deletions src/AccountSettingsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,29 @@ AccountSettingsWindow::AccountSettingsWindow(Account* account)
if (strlen(fAccountName->Text()) < 1)
fOK->SetEnabled(false);

BButton* cancel = new BButton("cancelbutton", B_TRANSLATE("Cancel"), new BMessage(B_QUIT_REQUESTED));
BButton* cancel =
new BButton("cancelbutton", B_TRANSLATE("Cancel"), new BMessage(B_QUIT_REQUESTED));

SetDefaultButton(fOK);

if (!fAccount || fAccount->IsUsingDefaultLocale()) {
fPrefView->Hide();
}
// clang off
// clang off

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

@humdingerb the comment isn't correct: clang-format off

This comment has been minimized.

Copy link
@humdingerb

humdingerb May 27, 2024

Author Member

Damn! I apparently misremembered what you said to use to prevent clang to 'fix' the layout code style...
I'll fix that everywhere tomorrow...
Thanks for keeping a watchful eye. :)

BLayoutBuilder::Group<>(this, B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_DEFAULT_SPACING)
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
.Add(fAccountName)
.Add(fUseDefault)
.Add(fPrefView)
.End()
.Add(fAccountName)
.Add(fUseDefault)
.Add(fPrefView)
.End()
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.AddGlue()
.Add(cancel)
.Add(fOK)
.End()
.AddGlue()
.Add(cancel)
.Add(fOK)
.End()
.End();
// clang on
// clang on

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

here too


CenterIn(Frame());
fAccountName->MakeFocus(true);
Expand Down
28 changes: 16 additions & 12 deletions src/BudgetWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BudgetWindow::BudgetWindow(const BRect& frame)
BuildStatsAndEditor();
BuildCategoryList();

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(fCatBox, B_VERTICAL, 0.0f)
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_BIG_SPACING,
B_USE_DEFAULT_SPACING, B_USE_SMALL_SPACING)
Expand All @@ -68,7 +68,7 @@ BudgetWindow::BudgetWindow(const BRect& frame)
.Add(fAnnually, 1, 1)
.End()
.End();
// clang-format on
// clang-format on
fAmountBox->SetText("");
fAmountBox->GetFilter()->SetMessenger(new BMessenger(this));

Expand All @@ -80,7 +80,7 @@ BudgetWindow::BudgetWindow(const BRect& frame)
RefreshBudgetSummary();
fCategoryList->MakeFocus(true);

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(this, B_VERTICAL, 0.0f)
.SetInsets(0)
.AddGrid(0.f, 0.f)
Expand All @@ -101,7 +101,7 @@ BudgetWindow::BudgetWindow(const BRect& frame)
.Add(fBudgetSummary)
.End()
.End();
// clang-format on
// clang-format on
CenterIn(frame);
}

Expand Down Expand Up @@ -688,8 +688,8 @@ BudgetWindow::BuildStatsAndEditor(void)
float statwidth = be_plain_font->StringWidth(B_TRANSLATE("12 month statistics")) + 20;
float amountwidth = be_plain_font->StringWidth("000,000.00") + 20;

fCatStat = new BColumnListView("categorystats", B_WILL_DRAW | B_NAVIGABLE, B_FANCY_BORDER,
false);
fCatStat =
new BColumnListView("categorystats", B_WILL_DRAW | B_NAVIGABLE, B_FANCY_BORDER, false);

font_height fh;
fCatStat->GetFontHeight(&fh);
Expand Down Expand Up @@ -796,14 +796,18 @@ BudgetWindow::BuildCategoryList(void)
new BColumnListView("categorylist", B_WILL_DRAW | B_NAVIGABLE, B_FANCY_BORDER, true);
fCategoryList->SetSortingEnabled(false);
fCategoryList->SetSelectionMessage(new BMessage(M_SELECT_CATEGORY));
fCategoryList->AddColumn(new BStringColumn(B_TRANSLATE("Category"),
fCategoryList->StringWidth(B_TRANSLATE("Category")) + 20, 40, 300, B_TRUNCATE_END), 0);
fCategoryList->AddColumn(
new BStringColumn(B_TRANSLATE("Category"),
fCategoryList->StringWidth(B_TRANSLATE("Category")) + 20, 40, 300, B_TRUNCATE_END),
0);
fCategoryList->AddColumn(new BStringColumn(B_TRANSLATE("Amount"),
fCategoryList->StringWidth(B_TRANSLATE("Amount")) + 20, 40, 300, B_TRUNCATE_END,
B_ALIGN_RIGHT), 1);
fCategoryList->StringWidth(B_TRANSLATE("Amount")) + 20, 40, 300,
B_TRUNCATE_END, B_ALIGN_RIGHT),
1);
fCategoryList->AddColumn(new BStringColumn(B_TRANSLATE("Frequency"),
fCategoryList->StringWidth(B_TRANSLATE("Frequency")) + 20, 40, 300, B_TRUNCATE_END,
B_ALIGN_RIGHT), 2);
fCategoryList->StringWidth(B_TRANSLATE("Frequency")) + 20, 40, 300,
B_TRUNCATE_END, B_ALIGN_RIGHT),
2);
fCategoryList->SetColumnFlags(B_ALLOW_COLUMN_RESIZE);

fIncomeRow = new BRow();
Expand Down
31 changes: 15 additions & 16 deletions src/CategoryWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ CategoryView::CategoryView(const char* name, const int32& flags)

fEditButton->SetEnabled(false);
fRemoveButton->SetEnabled(false);

// the category list
fListView = new BOutlineListView("categorylist", B_SINGLE_SELECTION_LIST,
B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE | B_FULL_UPDATE_ON_RESIZE);
Expand All @@ -125,7 +125,7 @@ CategoryView::CategoryView(const char* name, const int32& flags)

RefreshCategoryList();

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(this, B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_DEFAULT_SPACING)
.Add(scrollView)
Expand All @@ -137,7 +137,7 @@ CategoryView::CategoryView(const char* name, const int32& flags)
.AddGlue()
.End()
.End();
// clang-format on
// clang-format on
}


Expand Down Expand Up @@ -371,10 +371,8 @@ CategoryInputWindow::CategoryInputWindow(BView* target)
new AutoTextControl("namebox", B_TRANSLATE("Name:"), "", new BMessage(M_NAME_CHANGED));
fNameBox->SetCharacterLimit(32);

fSpending =
new BRadioButton("spendingoption", B_TRANSLATE("Spending category"), NULL);
fIncome =
new BRadioButton("incomeoption", B_TRANSLATE("Income category"), NULL);
fSpending = new BRadioButton("spendingoption", B_TRANSLATE("Spending category"), NULL);
fIncome = new BRadioButton("incomeoption", B_TRANSLATE("Income category"), NULL);

fSpending->SetValue(B_CONTROL_ON);

Expand All @@ -385,7 +383,7 @@ CategoryInputWindow::CategoryInputWindow(BView* target)
BButton* cancelButton =
new BButton("cancelbutton", B_TRANSLATE("Cancel"), new BMessage(B_QUIT_REQUESTED));

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.SetInsets(B_USE_DEFAULT_SPACING)
.AddGrid(0.f, 0.f)
Expand All @@ -401,7 +399,7 @@ CategoryInputWindow::CategoryInputWindow(BView* target)
.Add(fOKButton)
.End()
.End();
// clang-format on
// clang-format on

fNameBox->MakeFocus(true);
}
Expand Down Expand Up @@ -511,7 +509,7 @@ CategoryRemoveWindow::CategoryRemoveWindow(const char* from, BView* target)
query.nextRow();
}

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(this, B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_DEFAULT_SPACING)
.Add(directions, 0)
Expand All @@ -523,7 +521,7 @@ CategoryRemoveWindow::CategoryRemoveWindow(const char* from, BView* target)
.Add(fOKButton)
.End()
.End();
// clang-format on
// clang-format on
}


Expand Down Expand Up @@ -575,7 +573,8 @@ CategoryRemoveWindow::FrameResized(float w, float h)


CategoryEditWindow::CategoryEditWindow(const char* oldname, BView* target)
: BWindow(BRect(), B_TRANSLATE("Edit category"), B_FLOATING_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
: BWindow(BRect(), B_TRANSLATE("Edit category"), B_FLOATING_WINDOW_LOOK,
B_MODAL_APP_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE |
B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE),
fOldName(oldname),
Expand All @@ -586,8 +585,8 @@ CategoryEditWindow::CategoryEditWindow(const char* oldname, BView* target)

BStringView* oldLabel = new BStringView("oldlabel", B_TRANSLATE("Name:"));
BStringView* oldName = new BStringView("oldname", fOldName.String());
oldName->SetExplicitMinSize(BSize(be_plain_font->StringWidth("aQuiteLongCategoryName"),
B_SIZE_UNSET));
oldName->SetExplicitMinSize(
BSize(be_plain_font->StringWidth("aQuiteLongCategoryName"), B_SIZE_UNSET));

fNameBox =
new AutoTextControl("namebox", B_TRANSLATE("New name:"), "", new BMessage(M_NAME_CHANGED));
Expand All @@ -603,7 +602,7 @@ CategoryEditWindow::CategoryEditWindow(const char* oldname, BView* target)
fOKButton->SetEnabled(false);
fNameBox->MakeFocus(true);

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING)
.AddGrid(1.0f, B_USE_SMALL_SPACING)
Expand All @@ -618,7 +617,7 @@ CategoryEditWindow::CategoryEditWindow(const char* oldname, BView* target)
.Add(fOKButton)
.End()
.End();
// clang-format on
// clang-format on

fNameBox->MakeFocus(true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CheckView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ CheckView::CheckView(const char* name, int32 flags)
// #endif

gDatabase.AddObserver(this);
// clang-format off
// clang-format off
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.SetInsets(0)
.AddGrid(1.0f, 0.0f)
Expand Down
8 changes: 4 additions & 4 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ MainWindow::MainWindow(BRect frame)
menu->AddItem(new BMenuItem(B_TRANSLATE("Budget"), new BMessage(M_SHOW_BUDGET_WINDOW)));
menu->AddItem(new BMenuItem(B_TRANSLATE("Reports"), new BMessage(M_SHOW_REPORTS_WINDOW)));
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(B_TRANSLATE("Scheduled transactions"),
new BMessage(M_SHOW_SCHEDULED_WINDOW)));
menu->AddItem(new BMenuItem(
B_TRANSLATE("Scheduled transactions"), new BMessage(M_SHOW_SCHEDULED_WINDOW)));
// We load the financial data before we create any of the views because the
// notifications are not sent and startup time is *significantly* reduced
LoadData();
Expand All @@ -159,7 +159,7 @@ MainWindow::MainWindow(BRect frame)

HelpButton* helpButton = new HelpButton(B_TRANSLATE("Help: Main window"), "Main Window.txt");

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(this, B_VERTICAL, 0.0f)
.SetInsets(0)
.AddGrid(0.f, 0.f)
Expand All @@ -169,7 +169,7 @@ MainWindow::MainWindow(BRect frame)
.End()
.Add(fRegisterView)
.End();
// clang-format on
// clang-format on

HandleScheduledTransactions();
}
Expand Down
71 changes: 34 additions & 37 deletions src/PrefWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@ PrefWindow::PrefWindow(const BRect& frame)
fOK = new BButton("okbutton", B_TRANSLATE("Cancel"), new BMessage(M_EDIT_OPTIONS));
fOK->SetLabel(B_TRANSLATE("OK"));

BButton* cancel = new BButton("cancelbutton", B_TRANSLATE("Cancel"),
new BMessage(B_QUIT_REQUESTED));
BButton* cancel =
new BButton("cancelbutton", B_TRANSLATE("Cancel"), new BMessage(B_QUIT_REQUESTED));

SetDefaultButton(fOK);

// clang off
// clang off

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

@humdingerb clang-format instead of clang

BLayoutBuilder::Group<>(this, B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_DEFAULT_SPACING)
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.AddGlue()
.Add(fLabel)
.AddGlue()
.End()
.AddGlue()
.Add(fLabel)
.AddGlue()
.End()
.Add(fDatePrefView)
.Add(fCurrencyPrefView)
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.AddGlue()
.Add(cancel)
.Add(fOK)
.End()
.AddGlue()
.Add(cancel)
.Add(fOK)
.End()
.End();
// clang on
// clang on

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

here too


CenterIn(Frame());
}
Expand Down Expand Up @@ -138,22 +138,20 @@ DatePrefView::DatePrefView(const char* name, Locale* locale, const int32& flags)
fDateSeparatorBox->SetDivider(StringWidth(temp.String()) + 5);
fDateSeparatorBox->SetCharacterLimit(2);

// clang off
// clang off

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

here too

BLayoutBuilder::Group<>(fDateBox, B_VERTICAL, 0.0f)
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_BIG_SPACING, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING)
.SetInsets(
B_USE_DEFAULT_SPACING, B_USE_BIG_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
.Add(fDateMDY)
.Add(fDateDMY)
.AddGroup(B_HORIZONTAL)
.Add(fDateSeparatorBox)
.AddGlue()
.End()
.Add(fDateSeparatorBox)
.AddGlue()
.End()
.End();

BLayoutBuilder::Group<>(this, B_VERTICAL)
.Add(fDateBox)
.End();
// clang on
BLayoutBuilder::Group<>(this, B_VERTICAL).Add(fDateBox).End();
// clang on

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

here too

}

void
Expand Down Expand Up @@ -248,25 +246,24 @@ CurrencyPrefView::CurrencyPrefView(const char* name, Locale* locale, const int32
fLocale.CurrencyDecimal(), new BMessage(M_NEW_CURRENCY_DECIMAL));
fCurrencyDecimalBox->SetCharacterLimit(2);

// clang off
// clang off

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

here too

BLayoutBuilder::Group<>(fCurrencyBox, B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_BIG_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
.SetInsets(
B_USE_DEFAULT_SPACING, B_USE_BIG_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
.AddGrid(B_USE_SMALL_SPACING, B_USE_SMALL_SPACING)
.Add(fCurrencySymbolBox->CreateLabelLayoutItem(), 0, 0)
.Add(fCurrencySymbolBox->CreateTextViewLayoutItem(), 1, 0)
.Add(fCurrencySymbolPrefix, 2, 0, 3, 1)
.Add(fCurrencySeparatorBox->CreateLabelLayoutItem(), 0, 1)
.Add(fCurrencySeparatorBox->CreateTextViewLayoutItem(), 1, 1)
.Add(fCurrencyDecimalBox->CreateLabelLayoutItem(), 2, 1)
.Add(fCurrencyDecimalBox->CreateTextViewLayoutItem(), 3, 1)
.AddGlue(4, 1)
.End()
.Add(fCurrencySymbolBox->CreateLabelLayoutItem(), 0, 0)
.Add(fCurrencySymbolBox->CreateTextViewLayoutItem(), 1, 0)
.Add(fCurrencySymbolPrefix, 2, 0, 3, 1)
.Add(fCurrencySeparatorBox->CreateLabelLayoutItem(), 0, 1)
.Add(fCurrencySeparatorBox->CreateTextViewLayoutItem(), 1, 1)
.Add(fCurrencyDecimalBox->CreateLabelLayoutItem(), 2, 1)
.Add(fCurrencyDecimalBox->CreateTextViewLayoutItem(), 3, 1)
.AddGlue(4, 1)
.End()
.End();

BLayoutBuilder::Group<>(this, B_VERTICAL)
.Add(fCurrencyBox)
.End();
// clang on
BLayoutBuilder::Group<>(this, B_VERTICAL).Add(fCurrencyBox).End();
// clang on

This comment has been minimized.

Copy link
@korli

korli May 27, 2024

Contributor

here too

}

void
Expand Down
2 changes: 1 addition & 1 deletion src/PrefWindow.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef PREFWIN_H
#define PREFWIN_H

#include <Button.h>
#include <Box.h>
#include <Button.h>
#include <CheckBox.h>
#include <MenuField.h>
#include <Message.h>
Expand Down
2 changes: 1 addition & 1 deletion src/RegisterView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RegisterView::RegisterView(const char* name, int32 flags)
QTNetWorthItem* item;
item = new QTNetWorthItem("networth");

// clang-format off
// clang-format off
BLayoutBuilder::Group<>(fTrackBox, B_VERTICAL, 0)
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_BIG_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
Expand Down
Loading

0 comments on commit 355cd6f

Please sign in to comment.