forked from linuxdeepin/dtkwidget
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 显示自定义工具栏; 2. 工具栏上调整控件位置; 3. 工具栏上添加和移除控件; 4. 恢复默认工具栏控件; 5. 工具栏生效。 Log: 添加自定义工具栏功能 Influence: none Change-Id: Icb1d12d4c8881ace309e9b5cd5508bbca965c5fc
- Loading branch information
Showing
22 changed files
with
2,928 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
examples/dwidget-examples/collections/resources/data/titlebar-settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"spacingSize": 40, | ||
"alignment": "left", | ||
"tools": [ | ||
{ | ||
"key": "builtin/edit-cut" | ||
}, | ||
{ | ||
"key": "builtin/spacer", | ||
"fixed": true, | ||
"count": 2 | ||
}, | ||
{ | ||
"key": "builtin/edit-delete", | ||
"fixed": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <dtkwidget_global.h> | ||
#include <DObject> | ||
|
||
DWIDGET_BEGIN_NAMESPACE | ||
|
||
class LIBDTKWIDGETSHARED_EXPORT DTitlebarToolBaseInterface : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit DTitlebarToolBaseInterface(QObject *parent = nullptr) : QObject(parent) {} | ||
virtual ~DTitlebarToolBaseInterface(){} | ||
|
||
virtual QString id() const = 0; | ||
virtual QString description() = 0; | ||
virtual QString iconName() = 0; | ||
}; | ||
|
||
class LIBDTKWIDGETSHARED_EXPORT DTitleBarToolInterface : public DTitlebarToolBaseInterface { | ||
Q_OBJECT | ||
public: | ||
explicit DTitleBarToolInterface(QObject *parent = nullptr) : DTitlebarToolBaseInterface(parent) {} | ||
virtual ~DTitleBarToolInterface(){} | ||
|
||
virtual QWidget *createView() = 0; | ||
Q_SIGNALS: | ||
void triggered(); | ||
}; | ||
|
||
class LIBDTKWIDGETSHARED_EXPORT DTitleBarSpacerInterface : public DTitlebarToolBaseInterface { | ||
Q_OBJECT | ||
public: | ||
explicit DTitleBarSpacerInterface(QObject *parent = nullptr) : DTitlebarToolBaseInterface(parent) {} | ||
virtual ~DTitleBarSpacerInterface(){} | ||
|
||
virtual QWidget *createPlaceholderView() = 0; | ||
virtual int size() const = 0; | ||
}; | ||
|
||
class DTitlebarSettingsPrivate; | ||
class DTitlebarSettingsImpl; | ||
class DTitlebar; | ||
class LIBDTKWIDGETSHARED_EXPORT DTitlebarSettings : public DCORE_NAMESPACE::DObject | ||
{ | ||
public: | ||
explicit DTitlebarSettings(DTitlebar *titlebar); | ||
bool initilize(QList<DTitlebarToolBaseInterface *> &tools, const QString &path); | ||
|
||
QWidget *toolsEditPanel() const; | ||
|
||
private: | ||
D_DECLARE_PRIVATE(DTitlebarSettings) | ||
DTitlebarSettingsImpl *impl(); | ||
friend class DTitlebar; | ||
}; | ||
|
||
DWIDGET_END_NAMESPACE |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.