Skip to content

Commit 156cd54

Browse files
committed
Update code style.
1 parent b316567 commit 156cd54

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

src/Dialogs/LabelBreakdown.cpp

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#include <Simfile/SegmentGroup.h>
1515

16-
#define Dlg DialogLabelBreakdown
17-
1816
namespace Vortex {
1917

2018
// ================================================================================================
@@ -25,7 +23,7 @@ enum DisplayType {
2523
ROW
2624
};
2725

28-
struct Dlg::LabelButton : public GuiWidget {
26+
struct DialogLabelBreakdown::LabelButton : public GuiWidget {
2927

3028
LabelButton(GuiContext* gui, TileRect2* bar, int row, String time, String text)
3129
: GuiWidget(gui)
@@ -68,7 +66,7 @@ void onTick() override
6866

6967
void onDraw() override
7068
{
71-
recti r = myRect;
69+
recti r = rect_;
7270

7371
TextStyle textStyle;
7472
textStyle.textFlags = Text::ELLIPSES;
@@ -78,9 +76,9 @@ void onDraw() override
7876
button.base.draw(r, 0);
7977

8078
// Draw the button text.
81-
recti left = { myRect.x, myRect.y, 74, 20 };
79+
recti left = { rect_.x, rect_.y, 74, 20 };
8280

83-
color32 color = COLOR32(139, 148, 148, 255);
81+
color32 color = RGBAtoColor32(139, 148, 148, 255);
8482
myBar->draw(left, 0, color);
8583

8684
Text::arrange(Text::MR, myDisplayTime.str());
@@ -109,7 +107,7 @@ TileRect2* myBar;
109107
// ================================================================================================
110108
// LabelList
111109

112-
struct Dlg::LabelList : public WgScrollRegion {
110+
struct DialogLabelBreakdown::LabelList : public WgScrollRegion {
113111

114112
Vector<LabelButton*> myButtons;
115113
TileRect2 myButtonTex;
@@ -145,42 +143,42 @@ LabelList(GuiContext* gui)
145143

146144
void onUpdateSize() override
147145
{
148-
myScrollH = max(24, myButtons.size() * 21);
149-
myClampScrollValues();
146+
scroll_height_ = max(24, myButtons.size() * 21);
147+
ClampScrollPositions();
150148
}
151149

152150
void onTick() override
153151
{
154-
myPreTick();
152+
PreTick();
155153

156-
int viewW = getViewWidth() - 2 * myScrollbarActiveV;
154+
int viewW = getViewWidth() - 2 * is_vertical_scrollbar_active_;
157155

158156
// Update the properties of each button.
159-
int y = myRect.y - myScrollY;
157+
int y = rect_.y - scroll_position_y_;
160158
for(int i = 0; i < myButtons.size(); ++i)
161159
{
162160
auto button = myButtons[i];
163-
button->arrange({myRect.x, y, viewW, 20});
161+
button->arrange({rect_.x, y, viewW, 20});
164162
button->tick();
165163
y += 21;
166164
}
167165

168-
myPostTick();
166+
PostTick();
169167
}
170168

171169
void onDraw() override
172170
{
173171
if (gSimfile->isClosed()) return;
174172

175173
TextStyle textStyle;
176-
int w = getViewWidth() - 2 * myScrollbarActiveV;
174+
int w = getViewWidth() - 2 * is_vertical_scrollbar_active_;
177175
int h = getViewHeight();
178-
int x = myRect.x;
179-
int y = myRect.y - myScrollY;
176+
int x = rect_.x;
177+
int y = rect_.y - scroll_position_y_;
180178
const Style* style = nullptr;
181179
int chartIndex = 0;
182180

183-
Renderer::pushScissorRect({myRect.x, myRect.y, w, h});
181+
Renderer::pushScissorRect({rect_.x, rect_.y, w, h});
184182
if(myButtons.empty())
185183
{
186184
Text::arrange(Text::MC, textStyle, "- no labels -");
@@ -262,11 +260,11 @@ void copyLabels()
262260
// ================================================================================================
263261
// DialogLabelList
264262

265-
Dlg::~Dlg()
263+
DialogLabelBreakdown::~DialogLabelBreakdown()
266264
{
267265
}
268266

269-
Dlg::Dlg()
267+
DialogLabelBreakdown::DialogLabelBreakdown()
270268
{
271269
setTitle("LABELS");
272270

@@ -283,19 +281,19 @@ Dlg::Dlg()
283281
clear();
284282
}
285283

286-
void Dlg::clear()
284+
void DialogLabelBreakdown::clear()
287285
{
288286
myLabelText.clear();
289287
}
290288

291-
void Dlg::myCreateWidgets()
289+
void DialogLabelBreakdown::myCreateWidgets()
292290
{
293291
myLayout.row().col(44).col(234, true);
294292

295293
WgLineEdit* text = myLayout.add<WgLineEdit>("Label");
296294
text->text.bind(&myLabelText);
297295
text->setMaxLength(1000);
298-
text->onChange.bind(this, &Dlg::onChange);
296+
text->onChange.bind(this, &DialogLabelBreakdown::onChange);
299297
text->setTooltip("Label text");
300298

301299
myLayout.row().col(284, true);
@@ -307,16 +305,16 @@ void Dlg::myCreateWidgets()
307305
myDisplayTypeList->addItem("Beat");
308306
myDisplayTypeList->addItem("Row");
309307
myDisplayTypeList->value.bind(&myDisplayType);
310-
myDisplayTypeList->onChange.bind(this, &Dlg::mySetDisplayType);
308+
myDisplayTypeList->onChange.bind(this, &DialogLabelBreakdown::mySetDisplayType);
311309
myDisplayTypeList->setTooltip("Change the unit used for timestamps.");
312310

313311
WgButton* copy = myLayout.add<WgButton>();
314312
copy->text.set("{g:copy}");
315313
copy->setTooltip("Copy labels to clipboard");
316-
copy->onPress.bind(this, &Dlg::myCopyLabels);
314+
copy->onPress.bind(this, &DialogLabelBreakdown::myCopyLabels);
317315
}
318316

319-
void Dlg::onChanges(int changes)
317+
void DialogLabelBreakdown::onChanges(int changes)
320318
{
321319
if (changes & VCM_FILE_CHANGED)
322320
{
@@ -336,12 +334,12 @@ void Dlg::onChanges(int changes)
336334
}
337335
}
338336

339-
void Dlg::onUpdateSize()
337+
void DialogLabelBreakdown::onUpdateSize()
340338
{
341339
myLayout.onUpdateSize();
342340
}
343341

344-
void Dlg::onTick()
342+
void DialogLabelBreakdown::onTick()
345343
{
346344
recti bounds = getInnerRect();
347345
myList->setHeight(bounds.h - 58);
@@ -357,7 +355,7 @@ void Dlg::onTick()
357355
EditorDialog::onTick();
358356
}
359357

360-
void Dlg::onChange()
358+
void DialogLabelBreakdown::onChange()
361359
{
362360
if (gSimfile->isClosed()) return;
363361

@@ -371,13 +369,13 @@ void Dlg::onChange()
371369
gTempo->addSegment(Label(row, myLabelText));
372370
}
373371

374-
void Dlg::mySetDisplayType()
372+
void DialogLabelBreakdown::mySetDisplayType()
375373
{
376374
myList->setDisplayType(myDisplayType);
377375
}
378376

379377

380-
void Dlg::myCopyLabels()
378+
void DialogLabelBreakdown::myCopyLabels()
381379
{
382380
myList->copyLabels();
383381
}

0 commit comments

Comments
 (0)