MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / MacroPop

Function MacroPop

source/src/func.cpp:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59 QString FoldText(QString str, int len, bool back)
60 {
61 int size = str.size();
62 str.remove('\r').replace('\n', ' ').replace('\t', ' ');
63 if (back)
64 {
65 str = str.size() - len < 0 ? str.mid(0, len) : str.mid(str.size() - len, len);
66 if (size > len) str = QString("...") + str;
67 }
68 else
69 {
70 str = str.mid(0, len);
71 if (size > len) str = str + QString("...");
72 }
73 return str;
74 }
75
76 // Pop text
77 QString ParseCustom(QString text, QString name, QString number) { text.replace("@", name); return text.replace("$", number); }
78 QString ParseState(QString text) { return text.replace("@", Qi::folder); }
79 QString ParseWindow(QString text, QString window) { return text.replace("@", window); }
80 QString ParseQuickClick(QString text, short key) { return text.replace("@", QKeyEdit::keyName(key)); }

Callers 1

TriggerFunction · 0.85

Calls 2

ParseMacroFunction · 0.85
PopupMethod · 0.80

Tested by

no test coverage detected