Do bounds-checking on more windows (#4797)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2023-12-02 12:56:03 +01:00
committed by GitHub
parent e327ed4166
commit c4c94473ae
17 changed files with 120 additions and 38 deletions
+15 -8
View File
@@ -27,14 +27,15 @@ class BaseWindow : public BaseWidget
public:
enum Flags {
None = 0,
EnableCustomFrame = 1,
Frameless = 2,
TopMost = 4,
DisableCustomScaling = 8,
FramelessDraggable = 16,
DontFocus = 32,
Dialog = 64,
DisableLayoutSave = 128,
EnableCustomFrame = 1 << 0,
Frameless = 1 << 1,
TopMost = 1 << 2,
DisableCustomScaling = 1 << 3,
FramelessDraggable = 1 << 4,
DontFocus = 1 << 5,
Dialog = 1 << 6,
DisableLayoutSave = 1 << 7,
BoundsCheckOnShow = 1 << 8,
};
enum ActionOnFocusLoss { Nothing, Delete, Close, Hide };
@@ -57,6 +58,12 @@ public:
void moveTo(QPoint point, widgets::BoundsChecking mode);
/**
* Moves the window to the given point and does bounds checking according to `mode`
* Depending on the platform, either the move or the show will take place first
**/
void showAndMoveTo(QPoint point, widgets::BoundsChecking mode);
float scale() const override;
float qtFontScale() const;