mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 06:40:37 +01:00
[apps/code] Add a setting for syntax highlighting (#85)
This commit is contained in:
@@ -12,6 +12,7 @@ CodeOptionsController::CodeOptionsController(Responder * parentResponder) :
|
||||
{
|
||||
m_chevronCell.setMessageFont(KDFont::LargeFont);
|
||||
m_switchCell.setMessageFont(KDFont::LargeFont);
|
||||
m_switchCell_syntax_highlighting.setMessageFont(KDFont::LargeFont);
|
||||
}
|
||||
|
||||
bool CodeOptionsController::handleEvent(Ion::Events::Event event) {
|
||||
@@ -20,6 +21,10 @@ bool CodeOptionsController::handleEvent(Ion::Events::Event event) {
|
||||
case 1:
|
||||
GlobalPreferences::sharedGlobalPreferences()->setAutocomplete(!GlobalPreferences::sharedGlobalPreferences()->autocomplete());
|
||||
m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow());
|
||||
break;
|
||||
case 2:
|
||||
GlobalPreferences::sharedGlobalPreferences()->setSyntaxhighlighting(!GlobalPreferences::sharedGlobalPreferences()->syntaxhighlighting());
|
||||
m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow());
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -43,7 +48,10 @@ HighlightCell * CodeOptionsController::reusableCell(int index, int type) {
|
||||
if (index == 0) {
|
||||
return &m_chevronCell;
|
||||
}
|
||||
return &m_switchCell;
|
||||
else if (index == 1) {
|
||||
return &m_switchCell;
|
||||
}
|
||||
return &m_switchCell_syntax_highlighting;
|
||||
}
|
||||
|
||||
int CodeOptionsController::reusableCellCount(int type) {
|
||||
@@ -68,6 +76,11 @@ void CodeOptionsController::willDisplayCellForIndex(HighlightCell * cell, int in
|
||||
SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView();
|
||||
mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->autocomplete());
|
||||
}
|
||||
else if (thisLabel == I18n::Message::SyntaxHighlighting) {
|
||||
MessageTableCellWithSwitch * mySwitchCell = (MessageTableCellWithSwitch *)cell;
|
||||
SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView();
|
||||
mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->syntaxhighlighting());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user