Skip to content

Commit

Permalink
Merge branch 'wangwenx190:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SineStriker authored Aug 23, 2023
2 parents e3c370a + a130fef commit a9aac9e
Show file tree
Hide file tree
Showing 11 changed files with 512 additions and 458 deletions.
7 changes: 1 addition & 6 deletions include/FramelessHelper/Core/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ FRAMELESSHELPER_CORE_API void moveWindowToDesktopCenter(
[[nodiscard]] FRAMELESSHELPER_CORE_API quint32 defaultScreenDpi();
[[nodiscard]] FRAMELESSHELPER_CORE_API bool isWindowAccelerated(const QWindow *window);
[[nodiscard]] FRAMELESSHELPER_CORE_API bool isWindowTransparent(const QWindow *window);
[[nodiscard]] FRAMELESSHELPER_CORE_API Qt::MouseButtons queryMouseButtons();
FRAMELESSHELPER_CORE_API void emulateQtMouseEvent(
const QObject *target, const QWindow *window, const Global::ButtonState buttonState,
const QPoint &globalPos, const QPoint &scenePos, const QPoint &localPos,
const bool underMouse, const bool hoverEnabled);

#ifdef Q_OS_WINDOWS
[[nodiscard]] FRAMELESSHELPER_CORE_API bool isWindowsVersionOrGreater(const Global::WindowsVersion version);
Expand Down Expand Up @@ -151,7 +146,7 @@ FRAMELESSHELPER_CORE_API void emulateQtMouseEvent(
[[nodiscard]] FRAMELESSHELPER_CORE_API QPoint getWindowPlacementOffset(const WId windowId);
[[nodiscard]] FRAMELESSHELPER_CORE_API QRect getWindowRestoreGeometry(const WId windowId);
[[nodiscard]] FRAMELESSHELPER_CORE_API bool removeMicaWindow(const WId windowId);
[[nodiscard]] FRAMELESSHELPER_CORE_API quint64 getMouseButtonsAndModifiers(const bool async);
[[nodiscard]] FRAMELESSHELPER_CORE_API quint64 getKeyState();
[[nodiscard]] FRAMELESSHELPER_CORE_API bool isValidWindow(const WId windowId, const bool checkVisible, const bool checkTopLevel);
[[nodiscard]] FRAMELESSHELPER_CORE_API bool updateFramebufferTransparency(const WId windowId);
[[nodiscard]] FRAMELESSHELPER_CORE_API QMargins getWindowSystemFrameMargins(const WId windowId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class FRAMELESSHELPER_WIDGETS_API StandardSystemButtonPrivate : public QObject
Q_NODISCARD QColor getActiveForegroundColor() const;
Q_NODISCARD QColor getInactiveForegroundColor() const;
Q_NODISCARD bool isActive() const;
Q_NODISCARD int iconSize2() const;
Q_NODISCARD int glyphSize() const;

void setHoverColor(const QColor &value);
void setPressColor(const QColor &value);
void setNormalColor(const QColor &value);
void setActiveForegroundColor(const QColor &value);
void setInactiveForegroundColor(const QColor &value);
void setActive(const bool value);
void setIconSize2(const int value);
void setGlyphSize(const int value);

void paintEventHandler(QPaintEvent *event);

Expand All @@ -88,7 +88,7 @@ class FRAMELESSHELPER_WIDGETS_API StandardSystemButtonPrivate : public QObject
QColor m_activeForegroundColor = {};
QColor m_inactiveForegroundColor = {};
bool m_active = false;
std::optional<int> m_iconSize2 = std::nullopt;
std::optional<int> m_glyphSize = std::nullopt;
};

FRAMELESSHELPER_END_NAMESPACE
8 changes: 4 additions & 4 deletions include/FramelessHelper/Widgets/standardsystembutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FRAMELESSHELPER_WIDGETS_API StandardSystemButton : public QPushButton
Q_PROPERTY(QColor activeForegroundColor READ activeForegroundColor WRITE setActiveForegroundColor NOTIFY activeForegroundColorChanged FINAL)
Q_PROPERTY(QColor inactiveForegroundColor READ inactiveForegroundColor WRITE setInactiveForegroundColor NOTIFY inactiveForegroundColorChanged FINAL)
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged FINAL)
Q_PROPERTY(int iconSize2 READ iconSize2 WRITE setIconSize2 NOTIFY iconSize2Changed FINAL)
Q_PROPERTY(int glyphSize READ glyphSize WRITE setGlyphSize NOTIFY glyphSizeChanged FINAL)

public:
explicit StandardSystemButton(QWidget *parent = nullptr);
Expand All @@ -60,7 +60,7 @@ class FRAMELESSHELPER_WIDGETS_API StandardSystemButton : public QPushButton
Q_NODISCARD QColor activeForegroundColor() const;
Q_NODISCARD QColor inactiveForegroundColor() const;
Q_NODISCARD bool isActive() const;
Q_NODISCARD int iconSize2() const;
Q_NODISCARD int glyphSize() const;

public Q_SLOTS:
void setButtonType(const Global::SystemButtonType value);
Expand All @@ -71,7 +71,7 @@ public Q_SLOTS:
void setActiveForegroundColor(const QColor &value);
void setInactiveForegroundColor(const QColor &value);
void setActive(const bool value);
void setIconSize2(const int value);
void setGlyphSize(const int value);

protected:
void paintEvent(QPaintEvent *event) override;
Expand All @@ -85,7 +85,7 @@ public Q_SLOTS:
void activeForegroundColorChanged();
void inactiveForegroundColorChanged();
void activeChanged();
void iconSize2Changed();
void glyphSizeChanged();

private:
QScopedPointer<StandardSystemButtonPrivate> d_ptr;
Expand Down
Loading

0 comments on commit a9aac9e

Please sign in to comment.