2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

refactored layer methods

This commit is contained in:
John Preston
2015-12-07 21:09:05 +03:00
parent e312adb786
commit 6222876ac4
30 changed files with 248 additions and 249 deletions

View File

@@ -66,18 +66,6 @@ namespace App {
if (Window *win = wnd()) win->showSettings();
}
void showLayer(LayeredWidget *widget, bool forceFast) {
if (Window *w = wnd()) w->showLayer(widget, forceFast);
}
void replaceLayer(LayeredWidget *widget) {
if (Window *w = wnd()) w->replaceLayer(widget);
}
void showLayerLast(LayeredWidget *widget) {
if (Window *w = wnd()) w->showLayerLast(widget);
}
}
namespace Ui {
@@ -90,6 +78,19 @@ namespace Ui {
if (MainWidget *m = App::main()) m->ui_hideStickerPreview();
}
void showLayer(LayeredWidget *box, ShowLayerOptions options) {
if (Window *w = App::wnd()) w->ui_showLayer(box, options);
}
void hideLayer(bool fast) {
if (Window *w = App::wnd()) w->ui_showLayer(0, ShowLayerOptions(CloseOtherLayers) | (fast ? ForceFastShowLayer : AnimatedShowLayer));
}
bool isLayerShown() {
if (Window *w = App::wnd()) return w->ui_isLayerShown();
return false;
}
}
namespace Notify {