Skip to content

Commit

Permalink
implementing lightweight variant of tables (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuspen committed Dec 18, 2022
1 parent f0acd16 commit 2f287c9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/ct/ct_table_light.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,16 @@ void CtTableLight::column_move_left(const size_t colIdx)
if (0 == colIdx) {
return;
}
const size_t colIdxLeft = colIdx - 1;
#if 0
std::swap(_colWidths[colIdxLeft], _colWidths[colIdx]);
_grid.remove_column(colIdxLeft);
_grid.insert_column(colIdx);
for (size_t rowIdx = 0; rowIdx < _tableMatrix.size(); ++rowIdx) {
std::swap(_tableMatrix[rowIdx][colIdxLeft], _tableMatrix[rowIdx][colIdx]);
CtTextView& textView = static_cast<CtTextCell*>(_tableMatrix.at(rowIdx).at(colIdx))->get_text_view();
_grid.attach(textView, colIdx, rowIdx, 1/*# cell horiz*/, 1/*# cell vert*/);
}
#endif
const size_t colIdxLeft{colIdx - 1u};
const CtTableLightColumns& cols = get_columns();
auto f_action = [&](const Gtk::TreeIter& treeIter)->bool{
Gtk::TreeRow treeRow = *treeIter;
const Glib::ustring tmpCell = treeRow[cols.columnsText.at(colIdx)];
treeRow[cols.columnsText.at(colIdx)] = treeRow.get_value(cols.columnsText.at(colIdxLeft));
treeRow[cols.columnsText.at(colIdxLeft)] = tmpCell;
return false; /* to continue */
};
_pListStore->foreach_iter(f_action);
_currentColumn = colIdxLeft;
}

Expand Down

0 comments on commit 2f287c9

Please sign in to comment.