qtquick: The user can now choose another titlebar file
This commit is contained in:
@@ -212,6 +212,11 @@ SideBar *DefaultWidgetFactory::createSideBar(SideBarLocation loc, MainWindowBase
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QUrl DefaultWidgetFactory::titleBarFilename() const
|
||||
{
|
||||
return QUrl(QStringLiteral("qrc:/kddockwidgets/private/quick/qml/TitleBar.qml"));
|
||||
}
|
||||
|
||||
#endif // QtQuick
|
||||
|
||||
// iconForButtonType impl is the same for QtQuick and QtWidgets
|
||||
|
||||
@@ -61,7 +61,12 @@ class TabBar;
|
||||
*
|
||||
* @sa Config::setFrameworkWidgetFactory()
|
||||
*/
|
||||
class DOCKS_EXPORT FrameworkWidgetFactory {
|
||||
class DOCKS_EXPORT FrameworkWidgetFactory : public QObject
|
||||
{
|
||||
#ifdef KDDOCKWIDGETS_QTQUICK
|
||||
Q_PROPERTY(QUrl titleBarFilename READ titleBarFilename CONSTANT)
|
||||
#endif
|
||||
Q_OBJECT
|
||||
public:
|
||||
FrameworkWidgetFactory() = default;
|
||||
|
||||
@@ -137,7 +142,7 @@ public:
|
||||
///@p parent the button's parent
|
||||
virtual QAbstractButton* createTitleBarButton(QWidget *parent, TitleBarButtonType) const = 0;
|
||||
#else
|
||||
// QtQuick will have some other base class for buttons
|
||||
virtual QUrl titleBarFilename() const = 0;
|
||||
#endif
|
||||
|
||||
/// @brief Returns the icon to be used with the specified @p type
|
||||
@@ -168,6 +173,8 @@ public:
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
QAbstractButton* createTitleBarButton(QWidget *parent, TitleBarButtonType) const override;
|
||||
#else
|
||||
QUrl titleBarFilename() const override;
|
||||
#endif
|
||||
|
||||
QIcon iconForButtonType(TitleBarButtonType type, qreal dpr) const override;
|
||||
|
||||
@@ -31,7 +31,7 @@ Rectangle {
|
||||
Loader {
|
||||
id: titleBar
|
||||
readonly property QtObject titleBarCpp: root.titleBarCpp
|
||||
source: "TitleBar.qml"
|
||||
source: _kddw_widgetFactory.titleBarFilename
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
|
||||
Reference in New Issue
Block a user