[code] Add parentheses after function names in Var.

Change-Id: I7e3e993d07139c40c6bd59fd5879b3ee091f5127
This commit is contained in:
Léa Saviot
2017-11-30 16:57:47 +01:00
parent 9805f7570e
commit 62fe441b7a
10 changed files with 169 additions and 121 deletions

View File

@@ -0,0 +1,44 @@
#ifndef CODE_SCRIPT_NODE_CELL_H
#define CODE_SCRIPT_NODE_CELL_H
#include "script_node.h"
#include "script_store.h"
#include <escher/table_cell.h>
#include <kandinsky/coordinate.h>
namespace Code {
class ScriptNodeCell : public TableCell {
public:
ScriptNodeCell();
void setScriptNode(ScriptNode * node);
void setScriptStore(ScriptStore * scriptStore);
/* TableCell */
View * labelView() const override { return const_cast<View *>(static_cast<const View *>(&m_scriptNodeView)); }
/* HighlightCell */
void setHighlighted(bool highlight) override;
void reloadCell() override;
constexpr static char k_parentheses[] = "()";
protected:
class ScriptNodeView : public HighlightCell {
public:
ScriptNodeView();
void setScriptNode(ScriptNode * scriptNode);
void setScriptStore(ScriptStore * scriptStore);
void drawRect(KDContext * ctx, KDRect rect) const override;
virtual KDSize minimalSizeForOptimalDisplay() const override;
private:
constexpr static KDText::FontSize k_fontSize = KDText::FontSize::Small;
constexpr static KDCoordinate k_verticalMargin = 7;
ScriptNode * m_scriptNode;
ScriptStore * m_scriptStore;
};
ScriptNodeView m_scriptNodeView;
};
}
#endif