mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Delete messages box labels fix and confirm by Enter key.
Also context menu fixed in case of non-transparent windows. Also pausing GIFs when the window is not active.
This commit is contained in:
@@ -159,30 +159,25 @@ void FlatLabel::init() {
|
||||
connect(&_touchSelectTimer, SIGNAL(timeout()), this, SLOT(onTouchSelect()));
|
||||
}
|
||||
|
||||
template <typename SetCallback>
|
||||
void FlatLabel::setTextByCallback(SetCallback callback) {
|
||||
callback();
|
||||
void FlatLabel::textUpdated() {
|
||||
refreshSize();
|
||||
setMouseTracking(_selectable || _text.hasLinks());
|
||||
update();
|
||||
}
|
||||
|
||||
void FlatLabel::setText(const QString &text) {
|
||||
setTextByCallback([this, &text]() {
|
||||
_text.setText(_st.style, text, _labelOptions);
|
||||
});
|
||||
_text.setText(_st.style, text, _labelOptions);
|
||||
textUpdated();
|
||||
}
|
||||
|
||||
void FlatLabel::setRichText(const QString &text) {
|
||||
setTextByCallback([this, &text]() {
|
||||
_text.setRichText(_st.style, text, _labelOptions);
|
||||
});
|
||||
_text.setRichText(_st.style, text, _labelOptions);
|
||||
textUpdated();
|
||||
}
|
||||
|
||||
void FlatLabel::setMarkedText(const TextWithEntities &textWithEntities) {
|
||||
setTextByCallback([this, &textWithEntities]() {
|
||||
_text.setMarkedText(_st.style, textWithEntities, _labelMarkedOptions);
|
||||
});
|
||||
_text.setMarkedText(_st.style, textWithEntities, _labelMarkedOptions);
|
||||
textUpdated();
|
||||
}
|
||||
|
||||
void FlatLabel::setSelectable(bool selectable) {
|
||||
|
@@ -143,9 +143,7 @@ private slots:
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
template <typename SetCallback>
|
||||
void setTextByCallback(SetCallback callback);
|
||||
void textUpdated();
|
||||
|
||||
Text::StateResult dragActionUpdate();
|
||||
Text::StateResult dragActionStart(const QPoint &p, Qt::MouseButton button);
|
||||
|
@@ -151,8 +151,8 @@ void PopupMenu::handleActivated(QAction *action, int actionTop, TriggeredSource
|
||||
|
||||
void PopupMenu::handleTriggered(QAction *action, int actionTop, TriggeredSource source) {
|
||||
if (!popupSubmenuFromAction(action, actionTop, source)) {
|
||||
hideMenu();
|
||||
_triggering = true;
|
||||
hideMenu();
|
||||
emit action->trigger();
|
||||
_triggering = false;
|
||||
if (_deleteLater) {
|
||||
|
Reference in New Issue
Block a user