feat: add option to change the top-most status of a window (#5135)

* feat: add option to pin a popup

* chore: add changelog entry

* chore: change changelog entry
This commit is contained in:
nerix
2024-02-04 13:33:37 +01:00
committed by GitHub
parent 8e9aa87a08
commit af8eba0323
5 changed files with 85 additions and 24 deletions
+11
View File
@@ -68,10 +68,20 @@ public:
float scale() const override;
float qtFontScale() const;
/// @returns true if the window is the top-most window.
/// Either #setTopMost was called or the `TopMost` flag is set which overrides this
bool isTopMost() const;
/// Updates the window's top-most status
/// If the `TopMost` flag is set, this is a no-op
void setTopMost(bool topMost);
pajlada::Signals::NoArgSignal closing;
static bool supportsCustomWindowFrame();
signals:
void topMostChanged(bool topMost);
protected:
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
bool nativeEvent(const QByteArray &eventType, void *message,
@@ -131,6 +141,7 @@ private:
FlagsEnum<Flags> flags_;
float nativeScale_ = 1;
bool isResizeFixing_ = false;
bool isTopMost_ = false;
struct {
QLayout *windowLayout = nullptr;