2017-07-21 18:21:34 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_SUB_WINDOW_H
|
|
|
|
#define QSK_SUB_WINDOW_H 1
|
|
|
|
|
|
|
|
#include "QskPopup.h"
|
|
|
|
|
2018-10-29 20:11:48 +01:00
|
|
|
class QskGraphic;
|
|
|
|
class QskTextOptions;
|
|
|
|
class QUrl;
|
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
class QSK_EXPORT QskSubWindow : public QskPopup
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY( bool decorated READ isDecorated
|
|
|
|
WRITE setDecorated NOTIFY decoratedChanged )
|
|
|
|
|
2018-10-29 20:11:48 +01:00
|
|
|
Q_PROPERTY( QString windowTitle READ windowTitle
|
|
|
|
WRITE setWindowTitle NOTIFY windowTitleChanged )
|
|
|
|
|
|
|
|
Q_PROPERTY( QskTextOptions windowTitleTextOptions READ windowTitleTextOptions
|
|
|
|
WRITE setWindowTitleTextOptions NOTIFY windowTitleTextOptionsChanged )
|
|
|
|
|
|
|
|
Q_PROPERTY( QUrl windowIconSource READ windowIconSource
|
|
|
|
WRITE setWindowIconSource NOTIFY windowIconSourceChanged )
|
|
|
|
|
|
|
|
Q_PROPERTY( QskGraphic windowIcon READ windowIcon
|
|
|
|
WRITE setWindowIcon NOTIFY windowIconChanged FINAL )
|
2018-08-03 08:15:28 +02:00
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
Q_PROPERTY( WindowButtons windowButtons READ windowButtons
|
|
|
|
WRITE setWindowButtons NOTIFY windowButtonsChanged )
|
|
|
|
|
|
|
|
using Inherited = QskPopup;
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
public:
|
2017-07-21 18:21:34 +02:00
|
|
|
enum WindowButton
|
|
|
|
{
|
|
|
|
MinimizeButton = 0x1,
|
|
|
|
MaximizeButton = 0x2,
|
|
|
|
CloseButton = 0x4
|
|
|
|
};
|
|
|
|
|
|
|
|
Q_ENUM( WindowButton )
|
|
|
|
Q_DECLARE_FLAGS( WindowButtons, WindowButton )
|
|
|
|
|
2018-10-29 20:11:48 +01:00
|
|
|
QSK_SUBCONTROLS( Panel, TitleBar, TitleBarSymbol, TitleBarText )
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
QskSubWindow( QQuickItem* parent = nullptr );
|
2018-07-31 17:32:25 +02:00
|
|
|
~QskSubWindow() override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-10-29 20:11:48 +01:00
|
|
|
void setDecorated( bool );
|
|
|
|
bool isDecorated() const;
|
|
|
|
|
|
|
|
void setWindowTitleTextOptions( const QskTextOptions& );
|
|
|
|
QskTextOptions windowTitleTextOptions() const;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-10-29 20:11:48 +01:00
|
|
|
void setWindowTitle( const QString& );
|
|
|
|
QString windowTitle() const;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-11-05 13:50:41 +01:00
|
|
|
void setWindowIconSource( const QString& );
|
2018-10-29 20:11:48 +01:00
|
|
|
void setWindowIconSource( const QUrl& );
|
|
|
|
QUrl windowIconSource() const;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-10-29 20:11:48 +01:00
|
|
|
void setWindowIcon( const QskGraphic& );
|
|
|
|
QskGraphic windowIcon() const;
|
|
|
|
|
|
|
|
bool hasWindowIcon() const;
|
|
|
|
|
|
|
|
void setWindowButtons( WindowButtons );
|
|
|
|
WindowButtons windowButtons() const;
|
|
|
|
|
|
|
|
void setWindowButton( WindowButton, bool on = true );
|
|
|
|
bool testWindowButton( WindowButton ) const;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
QRectF titleBarRect() const;
|
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
QSizeF contentsSizeHint() const override;
|
2019-04-26 18:09:59 +02:00
|
|
|
QRectF layoutRectForSize( const QSizeF& ) const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
Q_SIGNALS:
|
2017-07-21 18:21:34 +02:00
|
|
|
void decoratedChanged();
|
2018-10-29 20:11:48 +01:00
|
|
|
void windowTitleChanged();
|
|
|
|
void windowTitleTextOptionsChanged();
|
|
|
|
void windowIconChanged();
|
|
|
|
void windowIconSourceChanged();
|
2017-07-21 18:21:34 +02:00
|
|
|
void windowButtonsChanged();
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
protected:
|
2018-07-31 17:32:25 +02:00
|
|
|
bool event( QEvent* ) override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-10-29 20:11:48 +01:00
|
|
|
void updateLayout() override;
|
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
void itemChange( QQuickItem::ItemChange,
|
2017-07-21 18:21:34 +02:00
|
|
|
const QQuickItem::ItemChangeData& ) override;
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
private:
|
2017-07-21 18:21:34 +02:00
|
|
|
class PrivateData;
|
|
|
|
std::unique_ptr< PrivateData > m_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|