mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 06:10:31 +01:00
[apps/code] Do not display varbox source name if it does not fit
This commit is contained in:
@@ -10,11 +10,18 @@ namespace Code {
|
||||
|
||||
class ScriptNodeCell : public TableCell {
|
||||
public:
|
||||
static_assert('\x11' == UCodePointEmpty, "Unicode error");
|
||||
constexpr static char k_parentheses[] = "()";
|
||||
constexpr static char k_parenthesesWithEmpty[] = "(\x11)";
|
||||
constexpr static KDCoordinate k_simpleItemHeight = 27;
|
||||
constexpr static KDCoordinate k_complexItemHeight = 42;
|
||||
|
||||
ScriptNodeCell() :
|
||||
TableCell(),
|
||||
m_scriptNodeView()
|
||||
{}
|
||||
void setScriptNode(ScriptNode * node);
|
||||
static bool CanDisplayNameAndSource(int nameLength, const char * source);
|
||||
|
||||
/* TableCell */
|
||||
View * labelView() const override { return const_cast<View *>(static_cast<const View *>(&m_scriptNodeView)); }
|
||||
@@ -24,14 +31,11 @@ public:
|
||||
void reloadCell() override;
|
||||
const char * text() const override { return m_scriptNodeView.text(); }
|
||||
|
||||
static_assert('\x11' == UCodePointEmpty, "Unicode error");
|
||||
constexpr static char k_parentheses[] = "()";
|
||||
constexpr static char k_parenthesesWithEmpty[] = "(\x11)";
|
||||
constexpr static KDCoordinate k_simpleItemHeight = 27;
|
||||
constexpr static KDCoordinate k_complexItemHeight = 42;
|
||||
protected:
|
||||
class ScriptNodeView : public HighlightCell {
|
||||
public:
|
||||
constexpr static const KDFont * k_font = KDFont::SmallFont;
|
||||
constexpr static KDCoordinate k_optimalWidth = Ion::Display::Width - Metric::PopUpLeftMargin - Metric::PopUpRightMargin;
|
||||
ScriptNodeView() :
|
||||
HighlightCell(),
|
||||
m_scriptNode(nullptr)
|
||||
@@ -43,7 +47,6 @@ protected:
|
||||
return m_scriptNode->description();
|
||||
}
|
||||
private:
|
||||
constexpr static const KDFont * k_font = KDFont::SmallFont;
|
||||
constexpr static KDCoordinate k_bottomMargin = 5;
|
||||
constexpr static KDCoordinate k_topMargin = k_bottomMargin + k_separatorThickness;
|
||||
ScriptNode * m_scriptNode;
|
||||
|
||||
Reference in New Issue
Block a user