Last active
February 18, 2023 18:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QApplication> | |
#include <QMainWindow> | |
#include <QPushButton> | |
#include <LayerShellQt/shell.h> | |
#include <LayerShellQt/window.h> | |
int main(int argc, char **argv) { | |
QApplication app(argc, argv); | |
LayerShellQt::Shell::useLayerShell(); | |
QMainWindow main_window; | |
QPushButton button; | |
button.setText("foobar"); | |
main_window.setCentralWidget(&button); | |
/* Ensure platform window is created */ | |
main_window.winId(); | |
QWindow *window = main_window.windowHandle(); | |
LayerShellQt::Window *layershell = LayerShellQt::Window::get(window); | |
layershell->setAnchors({ | |
LayerShellQt::Window::Anchor::AnchorTop, | |
LayerShellQt::Window::Anchor::AnchorLeft, | |
LayerShellQt::Window::Anchor::AnchorRight | |
}); | |
layershell->setLayer(LayerShellQt::Window::Layer::LayerBottom); | |
layershell->setExclusiveZone(30); | |
main_window.resize(0, 30); | |
main_window.show(); | |
return app.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CMakeLists.txt
additions: