[apps/code] Clean ScriptNodeCell

This commit is contained in:
Léa Saviot
2020-04-03 13:45:26 +02:00
committed by Émilie Feral
parent 0863abc4da
commit 69abd75460
2 changed files with 13 additions and 31 deletions

View File

@@ -10,9 +10,12 @@ namespace Code {
class ScriptNodeCell : public TableCell {
public:
ScriptNodeCell();
void setScriptNode(ScriptNode * node);
void setScriptStore(ScriptStore * scriptStore);
ScriptNodeCell() :
TableCell(),
m_scriptNodeView()
{}
void setScriptNode(ScriptNode * node) { m_scriptNode = scriptNode; }
void setScriptStore(ScriptStore * scriptStore) { m_scriptNodeView.setScriptStore(scriptStore); }
/* TableCell */
View * labelView() const override { return const_cast<View *>(static_cast<const View *>(&m_scriptNodeView)); }
@@ -29,9 +32,13 @@ public:
protected:
class ScriptNodeView : public HighlightCell {
public:
ScriptNodeView();
void setScriptNode(ScriptNode * scriptNode);
void setScriptStore(ScriptStore * scriptStore);
ScriptNodeView() :
HighlightCell(),
m_scriptNode(nullptr),
m_scriptStore(nullptr)
{}
void setScriptNode(ScriptNode * node) { m_scriptNode = scriptNode; }
void setScriptStore(ScriptStore * scriptStore) { m_scriptStore = scriptStore; }
void drawRect(KDContext * ctx, KDRect rect) const override;
virtual KDSize minimalSizeForOptimalDisplay() const override;
const char * text() const override {