Skip to content

Commit

Permalink
[Feature] Backlight settings (#137)
Browse files Browse the repository at this point in the history
* Added backlight settings

* Changed location of the brightness setting

* Fix row size of brightness settings

* [apps/settings/brightness] Update translations

* Fix dimmer

* Update translations

* [apps/settings] Add dimmer duration setting

* [apps/settings] Ensure of the brightness level is greater than the dimmed brightness level

* Make transition smooth

* Removed transition time setting
I personally think that this setting is completely useless except if you absolutely want a transition that is not smooth, which is weird.

* Moved everything related to brightness in one submenu

* Some refactoring

* Update defaults

* Removed unnecessary translation

* [apps/settings] Fix Shift + Minus/Plus in settings

* Apply suggestions from code review

* [apps/shared] Remove a think that I don't know what it is

* Apply review suggestions

Co-authored-by: Joachim LF <[email protected]>
Co-authored-by: lolocomotive <[email protected]>
  • Loading branch information
3 people authored Mar 22, 2022
1 parent 865bacf commit 8ac969d
Show file tree
Hide file tree
Showing 26 changed files with 288 additions and 80 deletions.
5 changes: 4 additions & 1 deletion apps/apps_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ bool AppsContainer::processEvent(Ion::Events::Event event) {
}
if (event == Ion::Events::BrightnessPlus || event == Ion::Events::BrightnessMinus) {
int delta = Ion::Backlight::MaxBrightness/GlobalPreferences::NumberOfBrightnessStates;
int direction = (event == Ion::Events::BrightnessPlus) ? Ion::Backlight::NumberOfStepsPerShortcut*delta : -delta*Ion::Backlight::NumberOfStepsPerShortcut;
int NumberOfStepsPerShortcut = GlobalPreferences::sharedGlobalPreferences()->brightnessShortcut();
int direction = (event == Ion::Events::BrightnessPlus) ? NumberOfStepsPerShortcut*delta : -delta*NumberOfStepsPerShortcut;
GlobalPreferences::sharedGlobalPreferences()->setBrightnessLevel(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel()+direction);
}
return false;
Expand Down Expand Up @@ -353,6 +354,8 @@ bool AppsContainer::updateBatteryState() {
}

void AppsContainer::refreshPreferences() {
m_suspendTimer.reset(GlobalPreferences::sharedGlobalPreferences()->idleBeforeSuspendSeconds()*1000/Timer::TickDuration);
m_backlightDimmingTimer.reset(GlobalPreferences::sharedGlobalPreferences()->idleBeforeDimmingSeconds()*1000/Timer::TickDuration);
m_window.refreshPreferences();
}

Expand Down
43 changes: 15 additions & 28 deletions apps/backlight_dimming_timer.cpp
Original file line number Diff line number Diff line change
@@ -1,39 +1,26 @@
#include "backlight_dimming_timer.h"
#include "global_preferences.h"
#include <ion/backlight.h>
#include <ion/events.h>
#include <apps/apps_container.h>

BacklightDimmingTimer::BacklightDimmingTimer() :
Timer(k_idleBeforeDimmingDuration/Timer::TickDuration)
Timer(GlobalPreferences::sharedGlobalPreferences()->idleBeforeDimmingSeconds()*1000/Timer::TickDuration)
{
}

bool BacklightDimmingTimer::fire() {
if (m_dimerExecutions == 0) {
m_brightnessLevel = GlobalPreferences::sharedGlobalPreferences()->brightnessLevel();
m_dimerSteps = m_brightnessLevel / decreaseBy;
m_timeToSleep = decreasetime / m_dimerSteps;
m_period = m_timeToSleep / Timer::TickDuration;
if (m_period == 0) {
m_period = 1;
bool BacklightDimmingTimer::fire(){
int i = Ion::Backlight::brightness();
while (i > 0){
int t = 20;
Ion::Events::Event e = Ion::Events::getEvent(&t);
AppsContainer::sharedAppsContainer()->dispatchEvent(e);
if (e.isKeyboardEvent()){
return false;
}
resetTimer();
}
if (m_dimerExecutions < m_dimerSteps) {
m_nextbrightness = (m_brightnessLevel-k_dimBacklightBrightness)/m_dimerSteps * (m_dimerSteps-m_dimerExecutions);
Ion::Backlight::setBrightness(m_nextbrightness);
resetTimer();
} else if (m_dimerExecutions == m_dimerSteps) {
Ion::Backlight::setBrightness(k_dimBacklightBrightness);

Ion::Backlight::setBrightness(i);
i -= 15;
}
m_dimerExecutions++;
return false;
}

void BacklightDimmingTimer::reset() {
m_dimerExecutions = 0;
m_period = k_idleBeforeDimmingDuration / Timer::TickDuration;
resetTimer();
}

void BacklightDimmingTimer::resetTimer() {
BacklightDimmingTimer::m_numberOfTicksBeforeFire = BacklightDimmingTimer::m_period;
}
11 changes: 0 additions & 11 deletions apps/backlight_dimming_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,8 @@
class BacklightDimmingTimer : public Timer {
public:
BacklightDimmingTimer();
void reset();
private:
constexpr static int k_idleBeforeDimmingDuration = 30*1000; // In miliseconds
constexpr static int k_dimBacklightBrightness = 0;
constexpr static int decreaseBy = 15;
constexpr static int decreasetime = 1*1000; // In miliseconds
int m_dimerExecutions = 0;
int m_brightnessLevel;
int m_dimerSteps;
int m_nextbrightness;
float m_timeToSleep; // In miliseconds
bool fire() override;
void resetTimer();
};

#endif
Expand Down
21 changes: 20 additions & 1 deletion apps/global_preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@ void GlobalPreferences::setBrightnessLevel(int brightnessLevel) {
brightnessLevel = brightnessLevel < 0 ? 0 : brightnessLevel;
brightnessLevel = brightnessLevel > Ion::Backlight::MaxBrightness ? Ion::Backlight::MaxBrightness : brightnessLevel;
m_brightnessLevel = brightnessLevel;
Ion::Backlight::setBrightness(m_brightnessLevel);
}
}

void GlobalPreferences::setIdleBeforeSuspendSeconds(int idleBeforeSuspendSeconds) {
if (m_idleBeforeSuspendSeconds != idleBeforeSuspendSeconds) {
idleBeforeSuspendSeconds = idleBeforeSuspendSeconds < 5 ? 5 : idleBeforeSuspendSeconds;
idleBeforeSuspendSeconds = idleBeforeSuspendSeconds > 7200 ? 7200 : idleBeforeSuspendSeconds;
m_idleBeforeSuspendSeconds = idleBeforeSuspendSeconds;
}
}

void GlobalPreferences::setIdleBeforeDimmingSeconds(int idleBeforeDimmingSeconds) {
if (m_idleBeforeDimmingSeconds != idleBeforeDimmingSeconds) {
idleBeforeDimmingSeconds = idleBeforeDimmingSeconds < 3 ? 3 : idleBeforeDimmingSeconds;
idleBeforeDimmingSeconds = idleBeforeDimmingSeconds > 1200 ? 1200 : idleBeforeDimmingSeconds;
m_idleBeforeDimmingSeconds = idleBeforeDimmingSeconds;
}
}

void GlobalPreferences::setBrightnessShortcut(int brightnessShortcut){
m_brightnessShortcut = brightnessShortcut;
}
12 changes: 12 additions & 0 deletions apps/global_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ class GlobalPreferences {
const KDFont * font() const { return m_font; }
void setFont(const KDFont * font) { m_font = font; }
constexpr static int NumberOfBrightnessStates = 15;
int idleBeforeSuspendSeconds() const { return m_idleBeforeSuspendSeconds; }
void setIdleBeforeSuspendSeconds(int m_idleBeforeSuspendSeconds);
int idleBeforeDimmingSeconds() const { return m_idleBeforeDimmingSeconds; }
void setIdleBeforeDimmingSeconds(int m_idleBeforeDimmingSeconds);
int brightnessShortcut() const { return m_brightnessShortcut; }
void setBrightnessShortcut(int m_BrightnessShortcut);
private:
static_assert(I18n::NumberOfLanguages > 0, "I18n::NumberOfLanguages is not superior to 0"); // There should already have been an error when processing an empty EPSILON_I18N flag
static_assert(I18n::NumberOfCountries > 0, "I18n::NumberOfCountries is not superior to 0"); // There should already have been an error when processing an empty EPSILON_COUNTRIES flag
Expand All @@ -60,6 +66,9 @@ class GlobalPreferences {
m_syntaxhighlighting(true),
m_cursorSaving(true),
m_brightnessLevel(Ion::Backlight::MaxBrightness),
m_idleBeforeSuspendSeconds(55),
m_idleBeforeDimmingSeconds(45),
m_brightnessShortcut(4),
m_font(KDFont::LargeFont) {}
I18n::Language m_language;
I18n::Country m_country;
Expand All @@ -74,6 +83,9 @@ class GlobalPreferences {
bool m_syntaxhighlighting;
bool m_cursorSaving;
int m_brightnessLevel;
int m_idleBeforeSuspendSeconds;
int m_idleBeforeDimmingSeconds;
int m_brightnessShortcut;
const KDFont * m_font;
};

Expand Down
1 change: 1 addition & 0 deletions apps/settings/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ app_settings_src = $(addprefix apps/settings/,\
sub_menu/math_options_controller.cpp \
sub_menu/selectable_view_with_messages.cpp \
sub_menu/usb_protection_controller.cpp \
sub_menu/brightness_controller.cpp\
)

SFLAGS += -DOMEGA_STATE="$(OMEGA_STATE)"
Expand Down
5 changes: 5 additions & 0 deletions apps/settings/base.de.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Reell "
Cartesian = "Kartesisch "
Polar = "Polar "
Brightness = "Helligkeit"
BrightnessSettings = "Helligkeitseinstellungen"
SoftwareVersion = "Epsilon version"
UpsilonVersion = "Upsilon version"
OmegaVersion = "Omega version"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Akzeptierte Updates"
USBDefaultLevel = "Basierend auf Upsilon"
USBLowLevel = "Basierend auf Omega"
USBParanoidLevel = "Nichts"
Normal = "Normal"
IdleTimeBeforeDimming = "Abdunkeln nach (s)"
IdleTimeBeforeSuspend = "Anhalten nach (s)"
BrightnessShortcut = "Tastenkombinationsschritte"
5 changes: 5 additions & 0 deletions apps/settings/base.en.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Real "
Cartesian = "Cartesian "
Polar = "Polar "
Brightness = "Brightness"
BrightnessSettings = "Brightness settings"
SoftwareVersion = "Epsilon version"
UpsilonVersion = "Upsilon version"
OmegaVersion = "Omega version"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Updates accepted"
USBDefaultLevel = "Based on Upsilon"
USBLowLevel = "Based on Omega"
USBParanoidLevel = "None"
Normal = "Normal"
IdleTimeBeforeDimming = "Dim after (s)"
IdleTimeBeforeSuspend = "Suspend after (s)"
BrightnessShortcut = "Shortcut steps"
5 changes: 5 additions & 0 deletions apps/settings/base.es.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Real "
Cartesian = "Binómica "
Polar = "Polar "
Brightness = "Brillo"
BrightnessSettings = "Configuración de brillo"
SoftwareVersion = "Versión de Epsilon"
UpsilonVersion = "Versión de Upsilon"
OmegaVersion = "Versión de Omega"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Actualizaciones aceptadas"
USBDefaultLevel = "Basado en Upsilon"
USBLowLevel = "Basado en Omega"
USBParanoidLevel = "Ninguno"
Normal = "Normal"
IdleTimeBeforeDimming = "Oscurecer después de (s)"
IdleTimeBeforeSuspend = "Suspender después de (s)"
BrightnessShortcut = "Pasos de acceso directo"
5 changes: 5 additions & 0 deletions apps/settings/base.fr.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Réel "
Cartesian = "Algébrique "
Polar = "Exponentielle "
Brightness = "Luminosité"
BrightnessSettings = "Paramètres de luminosité"
SoftwareVersion = "Version d'Epsilon"
UpsilonVersion = "Version d'Upsilon"
OmegaVersion = "Version d'Omega"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Mise à jour acceptées"
USBDefaultLevel = "Basées sur Upsilon"
USBLowLevel = "Basées sur Omega"
USBParanoidLevel = "Aucune"
Normal = "Normale"
IdleTimeBeforeDimming = "Assombrir après (s)"
IdleTimeBeforeSuspend = "Éteindre après (s)"
BrightnessShortcut = "Étapes du raccourci"
5 changes: 5 additions & 0 deletions apps/settings/base.hu.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Valódi "
Cartesian = "Kartéziánus "
Polar = "Poláris "
Brightness = "Fényerö"
BrightnessSettings = "Fényerő beállításai"
SoftwareVersion = "Epsilon verzió"
UpsilonVersion = "Upsilon verzió"
OmegaVersion = "Omega verzió"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Elfogadott frissítések"
USBDefaultLevel = "Upsilon alapján"
USBLowLevel = "Omega alapján"
USBParanoidLevel = "Egyik sem"
Normal = "Normale"
IdleTimeBeforeDimming = "Assombrir après (s)"
IdleTimeBeforeSuspend = "Éteindre après (s)"
BrightnessShortcut = "Parancsikon lépések"
5 changes: 5 additions & 0 deletions apps/settings/base.it.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Reale "
Cartesian = "Algebrico "
Polar = "Esponenziale "
Brightness = "Luminosità"
BrightnessSettings = "Impostazioni di luminosità"
SoftwareVersion = "Epsilon version"
UpsilonVersion = "Upsilon version"
OmegaVersion = "Omega version"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Aggiornamenti accettati"
USBDefaultLevel = "Basato su Upsilon"
USBLowLevel = "A base di Omega"
USBParanoidLevel = "Nessuno"
Normal = "Normale"
IdleTimeBeforeDimming = "Scurisci dopo (s)"
IdleTimeBeforeSuspend = "Sospendi dopo (s)"
BrightnessShortcut = "Passaggi di scelta rapida"
5 changes: 5 additions & 0 deletions apps/settings/base.nl.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Reëel "
Cartesian = "Cartesisch "
Polar = "Polair "
Brightness = "Helderheid"
BrightnessSettings = "Helderheidsinstellingen"
SoftwareVersion = "Epsilon version"
UpsilonVersion = "Upsilon version"
OmegaVersion = "Omega version"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Updates geaccepteerd"
USBDefaultLevel = "Gebaseerd op Upsilon"
USBLowLevel = "Op basis van Omega"
USBParanoidLevel = "Geen"
Normal = "Normaal"
IdleTimeBeforeDimming = "Donkerder maken na (s)"
IdleTimeBeforeSuspend = "Suspend after (s)"
BrightnessShortcut = "Snelkoppelingsstappen"
5 changes: 5 additions & 0 deletions apps/settings/base.pt.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Real = "Real "
Cartesian = "Cartesiana "
Polar = "Polar "
Brightness = "Brilho"
BrightnessSettings = "Configurações de brilho"
SoftwareVersion = "Versão do Epsilon"
UpsilonVersion = "Versão do Upsilon"
OmegaVersion = "Versão do Omega"
Expand Down Expand Up @@ -79,3 +80,7 @@ USBProtectionLevel = "Atualizações aceitas"
USBDefaultLevel = "Baseado em Upsilon"
USBLowLevel = "Baseado em Ômega"
USBParanoidLevel = "Nenhum"
Normal = "Normal"
IdleTimeBeforeDimming = "Diminuir depois (s)"
IdleTimeBeforeSuspend = "Suspender depois (s)"
BrightnessShortcut = "Passos de atalho"
35 changes: 7 additions & 28 deletions apps/settings/main_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ constexpr SettingsMessageTree s_usbProtectionChildren[2] = {SettingsMessageTree(
constexpr SettingsMessageTree s_usbProtectionLevelChildren[3] = {SettingsMessageTree(I18n::Message::USBDefaultLevel), SettingsMessageTree(I18n::Message::USBLowLevel), SettingsMessageTree(I18n::Message::USBParanoidLevel)};
constexpr SettingsMessageTree s_symbolFunctionChildren[3] = {SettingsMessageTree(I18n::Message::SymbolDefaultFunction), SettingsMessageTree(I18n::Message::SymbolArgDefaultFunction), SettingsMessageTree(I18n::Message::SymbolArgFunction)};
constexpr SettingsMessageTree s_modelMathOptionsChildren[6] = {SettingsMessageTree(I18n::Message::AngleUnit, s_modelAngleChildren), SettingsMessageTree(I18n::Message::DisplayMode, s_modelFloatDisplayModeChildren), SettingsMessageTree(I18n::Message::EditionMode, s_modelEditionModeChildren), SettingsMessageTree(I18n::Message::SymbolFunction, s_symbolFunctionChildren), SettingsMessageTree(I18n::Message::ComplexFormat, s_modelComplexFormatChildren), SettingsMessageTree(I18n::Message::SymbolMultiplication, s_symbolChildren)};
constexpr SettingsMessageTree s_brightnessChildren[4] = {SettingsMessageTree(I18n::Message::Brightness), SettingsMessageTree(I18n::Message::IdleTimeBeforeDimming), SettingsMessageTree(I18n::Message::IdleTimeBeforeSuspend), SettingsMessageTree(I18n::Message::BrightnessShortcut)};
constexpr SettingsMessageTree s_accessibilityChildren[6] = {SettingsMessageTree(I18n::Message::AccessibilityInvertColors), SettingsMessageTree(I18n::Message::AccessibilityMagnify),SettingsMessageTree(I18n::Message::AccessibilityGamma),SettingsMessageTree(I18n::Message::AccessibilityGammaRed),SettingsMessageTree(I18n::Message::AccessibilityGammaGreen),SettingsMessageTree(I18n::Message::AccessibilityGammaBlue)};
constexpr SettingsMessageTree s_contributorsChildren[18] = {SettingsMessageTree(I18n::Message::LaurianFournier), SettingsMessageTree(I18n::Message::YannCouturier), SettingsMessageTree(I18n::Message::DavidLuca), SettingsMessageTree(I18n::Message::LoicE), SettingsMessageTree(I18n::Message::VictorKretz), SettingsMessageTree(I18n::Message::QuentinGuidee), SettingsMessageTree(I18n::Message::JoachimLeFournis), SettingsMessageTree(I18n::Message::MaximeFriess), SettingsMessageTree(I18n::Message::JeanBaptisteBoric), SettingsMessageTree(I18n::Message::SandraSimmons), SettingsMessageTree(I18n::Message::David), SettingsMessageTree(I18n::Message::DamienNicolet), SettingsMessageTree(I18n::Message::EvannDreumont), SettingsMessageTree(I18n::Message::SzaboLevente), SettingsMessageTree(I18n::Message::VenceslasDuet), SettingsMessageTree(I18n::Message::CharlotteThomas), SettingsMessageTree(I18n::Message::AntoninLoubiere), SettingsMessageTree(I18n::Message::CyprienMejat)};

Expand All @@ -32,10 +33,10 @@ constexpr SettingsMessageTree s_modelAboutChildren[10] = {SettingsMessageTree(I1

MainController::MainController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate) :
ViewController(parentResponder),
m_brightnessCell(I18n::Message::Default, KDFont::LargeFont),
m_popUpCell(I18n::Message::Default, KDFont::LargeFont),
m_selectableTableView(this),
m_mathOptionsController(this, inputEventHandlerDelegate),
m_brightnessController(this, inputEventHandlerDelegate),
m_localizationController(this, Metric::CommonTopMargin, LocalizationController::Mode::Language),
m_accessibilityController(this),
m_dateTimeController(this),
Expand Down Expand Up @@ -63,13 +64,6 @@ void MainController::didBecomeFirstResponder() {

bool MainController::handleEvent(Ion::Events::Event event) {
GlobalPreferences * globalPreferences = GlobalPreferences::sharedGlobalPreferences();
if (event == Ion::Events::BrightnessPlus || event == Ion::Events::BrightnessMinus){
int delta = Ion::Backlight::MaxBrightness/GlobalPreferences::NumberOfBrightnessStates;
int direction = (event == Ion::Events::BrightnessPlus) ? Ion::Backlight::NumberOfStepsPerShortcut*delta : -delta*Ion::Backlight::NumberOfStepsPerShortcut;
GlobalPreferences::sharedGlobalPreferences()->setBrightnessLevel(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel()+direction);
m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), 1);
return true;
}
if (model()->childAtIndex(selectedRow())->numberOfChildren() == 0) {
if (model()->childAtIndex(selectedRow())->label() == promptMessage()) {
if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) {
Expand All @@ -79,16 +73,6 @@ bool MainController::handleEvent(Ion::Events::Event event) {
}
return false;
}
if (model()->childAtIndex(selectedRow())->label() == I18n::Message::Brightness) {
if (event == Ion::Events::Right || event == Ion::Events::Left || event == Ion::Events::Plus || event == Ion::Events::Minus) {
int delta = Ion::Backlight::MaxBrightness/GlobalPreferences::NumberOfBrightnessStates;
int direction = (event == Ion::Events::Right || event == Ion::Events::Plus) ? delta : -delta;
globalPreferences->setBrightnessLevel(globalPreferences->brightnessLevel()+direction);
m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow());
return true;
}
return false;
}
if (model()->childAtIndex(selectedRow())->label() == I18n::Message::Language || model()->childAtIndex(selectedRow())->label() == I18n::Message::Country) {
if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) {
m_localizationController.setMode(model()->childAtIndex(selectedRow())->label() == I18n::Message::Language ? LocalizationController::Mode::Language : LocalizationController::Mode::Country);
Expand All @@ -107,6 +91,8 @@ bool MainController::handleEvent(Ion::Events::Event event) {
subController = &m_examModeController;
} else if (title == I18n::Message::About) {
subController = &m_aboutController;
} else if (title == I18n::Message::BrightnessSettings) {
subController = &m_brightnessController;
} else if (title == I18n::Message::Accessibility) {
subController = &m_accessibilityController;
} else if (title == I18n::Message::DateTime) {
Expand Down Expand Up @@ -140,11 +126,7 @@ KDCoordinate MainController::rowHeight(int j) {
}

KDCoordinate MainController::cumulatedHeightFromIndex(int j) {
KDCoordinate height = j * rowHeight(0);
if (j > k_indexOfBrightnessCell) {
height += CellWithSeparator::k_margin;
}
return height;
return j * rowHeight(0);
}

int MainController::indexFromCumulatedHeight(KDCoordinate offsetY) {
Expand All @@ -161,11 +143,8 @@ HighlightCell * MainController::reusableCell(int index, int type) {
return &m_cells[index];
}
assert(index == 0);
if (type == 2) {
return &m_popUpCell;
}
assert(type == 1);
return &m_brightnessCell;
assert(type == 2);
return &m_popUpCell;
}

int MainController::reusableCellCount(int type) {
Expand Down
Loading

0 comments on commit 8ac969d

Please sign in to comment.