lib_ui/ui/layers/layer_manager.h
2019-09-20 10:35:47 +03:00

41 lines
932 B
C++

// This file is part of Desktop App Toolkit,
// a set of libraries for developing nice desktop applications.
//
// For license and copyright information please follow this link:
// https://github.com/desktop-app/legal/blob/master/LEGAL
//
#pragma once
#include "ui/layers/layer_widget.h"
#include <QtCore/QMargins>
namespace Ui {
class BoxContent;
class RpWidget;
class LayerManager final {
public:
explicit LayerManager(not_null<RpWidget*> widget);
void setHideByBackgroundClick(bool hide);
void showBox(
object_ptr<BoxContent> box,
LayerOptions options = LayerOption::KeepOther,
anim::type animated = anim::type::normal);
void hideAll(anim::type animated = anim::type::normal);
void raise();
bool setFocus();
private:
void ensureLayerCreated();
void destroyLayer();
const not_null<RpWidget*> _widget;
base::unique_qptr<LayerStackWidget> _layer;
bool _hideByBackgroundClick = false;
};
} // namespace Ui