mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Fixed color select display issue and build issue
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "color_cell.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace Shared {
|
||||
|
||||
@@ -30,10 +29,12 @@ void MessageTableCellWithColor::setColor(int i) {
|
||||
return label->setMessage(k_textForIndex[5]); // FIXME
|
||||
case 6:
|
||||
return label->setMessage(k_textForIndex[6]); // FIXME
|
||||
case 7:
|
||||
return label->setMessage(k_textForIndex[7]); // FIXME
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
//return label->setMessage(k_textForIndex[i]); // FIXME
|
||||
// return label->setMessage(k_textForIndex[i]); // FIXME
|
||||
}
|
||||
|
||||
MessageTableCellWithColor::ColorView::ColorView() :
|
||||
|
||||
@@ -11,11 +11,13 @@ public:
|
||||
MessageTableCellWithColor();
|
||||
View * accessoryView() const override;
|
||||
void setColor(int i);
|
||||
int color() { return m_accessoryView.color(); }
|
||||
private:
|
||||
class ColorView : public TransparentView {
|
||||
public:
|
||||
ColorView();
|
||||
void setColor(int i) { m_index = i; }
|
||||
int color() { return m_index; }
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
KDSize minimalSizeForOptimalDisplay() const override;
|
||||
constexpr static KDCoordinate k_chevronHeight = 10;
|
||||
|
||||
@@ -11,11 +11,7 @@ ColorParameterController::ColorParameterController(Responder * parentResponder,
|
||||
m_selectableTableView(this),
|
||||
m_record(),
|
||||
m_title(title)
|
||||
{
|
||||
for(int i = 0; i < Palette::numberOfDataColors(); i++){
|
||||
m_cells[i].setColor(i);
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
||||
void ColorParameterController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
@@ -50,6 +46,12 @@ HighlightCell * ColorParameterController::reusableCell(int index) {
|
||||
return &m_cells[index];
|
||||
}
|
||||
|
||||
void ColorParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
MessageTableCellWithColor * myCell = (MessageTableCellWithColor *)cell;
|
||||
myCell->setColor(index);
|
||||
cell->reloadCell();
|
||||
}
|
||||
|
||||
bool ColorParameterController::handleEnterOnRow(int rowIndex) {
|
||||
function()->setColor(Palette::DataColor[rowIndex]);
|
||||
return true;
|
||||
|
||||
@@ -28,6 +28,7 @@ public:
|
||||
KDCoordinate cellHeight() override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() const override { return Palette::numberOfDataColors(); } // FIXME Display issue
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index);
|
||||
private:
|
||||
bool handleEnterOnRow(int rowIndex);
|
||||
FunctionStore * functionStore();
|
||||
|
||||
Reference in New Issue
Block a user