mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] Do not select subtitles in the variable box
This commit is contained in:
@@ -136,6 +136,20 @@ void VariableBoxController::willDisplayCellForIndex(HighlightCell * cell, int in
|
||||
static_cast<MessageTableCell *>(cell)->setMessage(subtitleMessages[(int)cellOrigin]);
|
||||
}
|
||||
|
||||
void VariableBoxController::tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY, bool withinTemporarySelection) {
|
||||
if (withinTemporarySelection) {
|
||||
return;
|
||||
}
|
||||
const int currentSelectedRow = selectedRow();
|
||||
if (typeAtLocation(0, currentSelectedRow) == k_subtitleCellType) {
|
||||
if (currentSelectedRow == 0) {
|
||||
t->selectCellAtLocation(0, 1);
|
||||
} else {
|
||||
t->selectCellAtLocation(0, selectedRow() + (previousSelectedCellY < currentSelectedRow ? 1 : -1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int VariableBoxController::typeAtLocation(int i, int j) {
|
||||
assert(i == 0);
|
||||
return typeAndOriginAtLocation(j);
|
||||
|
||||
@@ -24,6 +24,8 @@ public:
|
||||
int typeAtLocation(int i, int j) override;
|
||||
/* ListViewDataSource */
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
/* SelectableTableViewDelegate */
|
||||
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY, bool withinTemporarySelection = false) override;
|
||||
|
||||
/* VariableBoxController */
|
||||
void loadFunctionsAndVariables(int scriptIndex, const char * textToAutocomplete, int textToAutocompleteLength);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <escher/selectable_table_view.h>
|
||||
#include <escher/stack_view_controller.h>
|
||||
|
||||
class NestedMenuController : public StackViewController, public ListViewDataSource, public SelectableTableViewDataSource {
|
||||
class NestedMenuController : public StackViewController, public ListViewDataSource, public SelectableTableViewDataSource, public SelectableTableViewDelegate {
|
||||
public:
|
||||
NestedMenuController(Responder * parentResponder, I18n::Message title = (I18n::Message)0);
|
||||
void setSender(InputEventHandler * sender) { m_sender = sender; }
|
||||
|
||||
@@ -90,7 +90,7 @@ void NestedMenuController::ListController::setFirstSelectedRow(int firstSelected
|
||||
|
||||
NestedMenuController::NestedMenuController(Responder * parentResponder, I18n::Message title) :
|
||||
StackViewController(parentResponder, &m_listController, KDColorWhite, Palette::PurpleBright, Palette::PurpleDark),
|
||||
m_selectableTableView(&m_listController, this, this),
|
||||
m_selectableTableView(&m_listController, this, this, this),
|
||||
m_listController(this, &m_selectableTableView, title),
|
||||
m_sender(nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user