Show bot callback data in a tooltip
This commit is contained in:
parent
b1277c3d59
commit
b6be1f4d9f
2 changed files with 12 additions and 1 deletions
|
|
@ -460,6 +460,14 @@ QString ReplyMarkupClickHandler::buttonText() const {
|
|||
return QString();
|
||||
}
|
||||
|
||||
// Returns the full text of the corresponding button.
|
||||
QString ReplyMarkupClickHandler::buttonDataString() const {
|
||||
if (const auto button = getButton()) {
|
||||
return QString(button->data);
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
ReplyKeyboard::Button::Button() = default;
|
||||
ReplyKeyboard::Button::Button(Button &&other) = default;
|
||||
ReplyKeyboard::Button &ReplyKeyboard::Button::operator=(
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ public:
|
|||
FullMsgId context);
|
||||
|
||||
QString tooltip() const override {
|
||||
return _fullDisplayed ? QString() : buttonText();
|
||||
return _fullDisplayed ? buttonDataString() : buttonText() + "\n" + buttonDataString();
|
||||
}
|
||||
|
||||
void setFullDisplayed(bool full) {
|
||||
|
|
@ -288,6 +288,9 @@ private:
|
|||
// Returns the full text of the corresponding button.
|
||||
QString buttonText() const;
|
||||
|
||||
// Returns the data of the corresponding button as a string.
|
||||
QString buttonDataString() const;
|
||||
|
||||
};
|
||||
|
||||
class ReplyKeyboard {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue