@@ -75,14 +75,14 @@ Element DefaultRenderState(const WindowRenderState& state,
75
75
// / https://github.com/ArthurSonzogni/FTXUI/blob/main/src/ftxui/component/window.cpp
76
76
class CommitComponentImpl : public ComponentBase , public WindowOptions {
77
77
public:
78
- explicit CommitComponentImpl (int position, std::string commit, OSTreeTUI& ostreetui)
79
- : commitPosition(position),
78
+ explicit CommitComponentImpl (size_t position, std::string commit, OSTreeTUI& ostreetui)
79
+ : drag_initial_x(1 ),
80
+ drag_initial_y(static_cast <int >(position) * COMMIT_WINDOW_HEIGHT),
81
+ commitPosition(position),
80
82
hash(std::move(commit)),
81
83
ostreetui(ostreetui),
82
84
commit(ostreetui.GetOstreeRepo().GetCommitList().at(hash)),
83
- newVersion(this ->commit.version),
84
- drag_initial_y(position * COMMIT_WINDOW_HEIGHT),
85
- drag_initial_x(1 ) {
85
+ newVersion(this ->commit.version) {
86
86
inner = Renderer ([&] {
87
87
return vbox ({
88
88
text (ostreetui.GetOstreeRepo ().GetCommitList ().at (hash).subject ),
@@ -183,12 +183,10 @@ class CommitComponentImpl : public ComponentBase, public WindowOptions {
183
183
}
184
184
} else if (ostreetui.GetViewMode () == ViewMode::COMMIT_DROP &&
185
185
ostreetui.GetModeHash () == hash) {
186
- const auto & commitList = ostreetui.GetOstreeRepo ().GetCommitList ();
187
- auto commit = commitList.at (hash);
188
186
startDeletionWindow (ostreetui.GetOstreeRepo ().IsMostRecentCommitOnBranch (hash));
189
187
}
190
188
191
- auto element = ComponentBase::Render ();
189
+ ftxui::Element element = ComponentBase::Render ();
192
190
193
191
const WindowRenderState state = {element, title (), Active (), drag_};
194
192
@@ -371,7 +369,7 @@ class CommitComponentImpl : public ComponentBase, public WindowOptions {
371
369
bool drag_ = false ;
372
370
373
371
// ostree-tui specific members
374
- int commitPosition;
372
+ size_t commitPosition;
375
373
std::string hash;
376
374
OSTreeTUI& ostreetui;
377
375
@@ -445,7 +443,7 @@ class CommitComponentImpl : public ComponentBase, public WindowOptions {
445
443
446
444
} // namespace
447
445
448
- ftxui::Component CommitComponent (int position, const std::string& commit, OSTreeTUI& ostreetui) {
446
+ ftxui::Component CommitComponent (size_t position, const std::string& commit, OSTreeTUI& ostreetui) {
449
447
return ftxui::Make<CommitComponentImpl>(position, commit, ostreetui);
450
448
}
451
449
0 commit comments