2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Update Telegram button added to DialogsWidget/Intro. Three dot menu.

This commit is contained in:
John Preston
2016-11-05 11:36:24 +03:00
parent e693a98bd4
commit d12177befd
50 changed files with 624 additions and 462 deletions

View File

@@ -44,7 +44,7 @@ DropdownMenu::DropdownMenu(QWidget *parent, const style::DropdownMenu &st) : Inn
//}
void DropdownMenu::init() {
connect(this, SIGNAL(beforeHidden()), this, SLOT(onHidden()));
InnerDropdown::setHiddenCallback([this] { hideFinish(); });
setOwnedWidget(_menu);
@@ -216,6 +216,9 @@ void DropdownMenu::childHiding(DropdownMenu *child) {
void DropdownMenu::hideFinish() {
_menu->clearSelection();
if (_hiddenCallback) {
_hiddenCallback();
}
}
// Not ready with submenus yet.

View File

@@ -35,6 +35,10 @@ public:
QAction *addSeparator();
void clearActions();
void setHiddenCallback(base::lambda_unique<void()> callback) {
_hiddenCallback = std_::move(callback);
}
using Actions = Ui::Menu::Actions;
Actions &actions();
@@ -91,6 +95,7 @@ private:
void showMenu(const QPoint &p, DropdownMenu *parent, TriggeredSource source);
const style::DropdownMenu &_st;
base::lambda_unique<void()> _hiddenCallback;
ChildWidget<Ui::Menu> _menu;

View File

@@ -188,7 +188,9 @@ void InnerDropdown::hideFinished() {
_cache = QPixmap();
_ignoreShowEvents = false;
if (!isHidden()) {
emit beforeHidden();
if (_hiddenCallback) {
_hiddenCallback();
}
hide();
}
}

View File

@@ -49,6 +49,10 @@ public:
void showFast();
void hideFast();
void setHiddenCallback(base::lambda_unique<void()> callback) {
_hiddenCallback = std_::move(callback);
}
bool isHiding() const {
return _hiding && _a_appearance.animating();
}
@@ -60,9 +64,6 @@ public:
};
void hideAnimated(HideOption option = HideOption::Default);
signals:
void beforeHidden();
protected:
void resizeEvent(QResizeEvent *e) override;
void paintEvent(QPaintEvent *e) override;
@@ -102,6 +103,7 @@ private:
QTimer _hideTimer;
bool _ignoreShowEvents = false;
base::lambda_unique<void()> _hiddenCallback;
RectShadow _shadow;
ChildWidget<ScrollArea> _scroll;