-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiling deepin file dialog theme without dtk depends
- Loading branch information
Showing
85 changed files
with
219 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
add_subdirectory(deepintheme) | ||
add_subdirectory(deepinfiledialogtheme) |
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,41 @@ | ||
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS DBus Widgets) | ||
set(QT_LIBS Qt${QT_VERSION_MAJOR}::DBus Qt${QT_VERSION_MAJOR}::Widgets) | ||
if(QT_VERSION_MAJOR EQUAL 5) | ||
find_package(Qt5X11Extras REQUIRED) | ||
list(APPEND QT_LIBS Qt5::X11Extras) | ||
if(QT_VERSION_MINOR GREATER_EQUAL 8) # Qt5.8 | ||
find_package(Qt5ThemeSupport REQUIRED) | ||
list(APPEND QT_LIBS Qt5::ThemeSupportPrivate) | ||
else() | ||
list(APPEND QT_LIBS Qt5::PlatformSupportPrivate) | ||
endif() | ||
else() | ||
list(APPEND QT_LIBS Qt6::GuiPrivate) | ||
endif() | ||
|
||
include(../filedialog/filedialog.cmake) | ||
|
||
dtk_add_plugin( | ||
NAME | ||
qdeepinfiledialog | ||
OUTPUT_DIR | ||
${PLUGIN_OUTPUT_BASE_DIR}/platformthemes | ||
INCLUDE_DIRS | ||
${CMAKE_CURRENT_LIST_DIR}/../filedialog | ||
SOURCES | ||
${DFM_DLG_SOURCES} | ||
qdeepintheme.cpp | ||
main.cpp | ||
${DBUS_INTERFACES} | ||
HEADERS | ||
${DFM_DLG_HEADERS} | ||
qdeepintheme.h | ||
DEPENDENCIES | ||
${QT_LIBS} | ||
DEFINITIONS | ||
${DEFS} | ||
) |
3 changes: 3 additions & 0 deletions
3
platformthemeplugins/deepinfiledialogtheme/deepinfiledialog.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,3 @@ | ||
{ | ||
"Keys" : [ "deepinfiledialog", "deepin", "DDE" ] | ||
} |
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,30 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
#include <qpa/qplatformthemeplugin.h> | ||
#include "qdeepintheme.h" | ||
|
||
QT_BEGIN_NAMESPACE | ||
class QDeepinFileDialogThemePlugin : public QPlatformThemePlugin | ||
{ | ||
Q_OBJECT | ||
Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "deepinfiledialog.json") | ||
|
||
public: | ||
QPlatformTheme *create(const QString &key, const QStringList ¶ms) Q_DECL_OVERRIDE; | ||
}; | ||
|
||
QPlatformTheme *QDeepinFileDialogThemePlugin::create(const QString &key, const QStringList ¶ms) | ||
{ | ||
Q_UNUSED(params); | ||
const QStringList &keys = {"deepinfiledialog", QLatin1String(QDeepinTheme::name), QLatin1String("DDE")}; | ||
if (keys.contains(key, Qt::CaseInsensitive)) | ||
return new QDeepinTheme; | ||
|
||
return nullptr; | ||
} | ||
|
||
QT_END_NAMESPACE | ||
|
||
#include "main.moc" |
69 changes: 69 additions & 0 deletions
69
platformthemeplugins/deepinfiledialogtheme/qdeepintheme.cpp
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,69 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
#include "qdeepintheme.h" | ||
#include "qdeepinfiledialoghelper.h" | ||
#include "filedialogmanager_interface.h" | ||
|
||
#include <QGuiApplication> | ||
#include <QIconEnginePlugin> | ||
|
||
#include <private/qguiapplication_p.h> | ||
#include <qpa/qwindowsysteminterface_p.h> | ||
#include <qpa/qplatformscreen.h> | ||
#include <qpa/qplatformcursor.h> | ||
|
||
#undef signals | ||
#include <X11/Xlib.h> | ||
|
||
|
||
QT_BEGIN_NAMESPACE | ||
|
||
const char *QDeepinTheme::name = "deepin"; | ||
bool QDeepinTheme::m_usePlatformNativeDialog = true; | ||
|
||
QDeepinTheme::QDeepinTheme() | ||
{ | ||
} | ||
|
||
QDeepinTheme::~QDeepinTheme() | ||
{ | ||
if (QDeepinFileDialogHelper::manager) { | ||
QDeepinFileDialogHelper::manager->deleteLater(); | ||
QDeepinFileDialogHelper::manager = Q_NULLPTR; | ||
} | ||
} | ||
|
||
bool QDeepinTheme::usePlatformNativeDialog(DialogType type) const | ||
{ | ||
if (type == FileDialog) { | ||
if (qgetenv("_d_disableDBusFileDialog") == "true") | ||
return false; | ||
|
||
static bool dbusDialogManagerInitialized = false; | ||
|
||
if (!dbusDialogManagerInitialized) { | ||
dbusDialogManagerInitialized = true; | ||
QDeepinFileDialogHelper::initDBusFileDialogManager(); | ||
} | ||
|
||
return m_usePlatformNativeDialog | ||
&& QDeepinFileDialogHelper::manager | ||
&& QDeepinFileDialogHelper::manager->isUseFileChooserDialog(); | ||
} | ||
|
||
return QGenericUnixTheme::usePlatformNativeDialog(type); | ||
} | ||
|
||
QPlatformDialogHelper *QDeepinTheme::createPlatformDialogHelper(DialogType type) const | ||
{ | ||
if (type == FileDialog && usePlatformNativeDialog(type)) | ||
return new QDeepinFileDialogHelper(); | ||
|
||
return QGenericUnixTheme::createPlatformDialogHelper(type); | ||
} | ||
|
||
QT_END_NAMESPACE | ||
|
||
#include "qdeepintheme.moc" |
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,32 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2017-2023 UnionTech Software Technology Co., Ltd. | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
#ifndef QDEEPINTHEME_H | ||
#define QDEEPINTHEME_H | ||
|
||
#include <QMimeDatabase> | ||
|
||
#include <private/qgenericunixthemes_p.h> | ||
#include <qpa/qplatformwindow.h> | ||
#include <qpa/qplatformnativeinterface.h> | ||
|
||
class DThemeSettings; | ||
class QDeepinTheme : public QGenericUnixTheme | ||
{ | ||
public: | ||
QDeepinTheme(); | ||
~QDeepinTheme(); | ||
|
||
bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE; | ||
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE; | ||
|
||
static const char *name; | ||
|
||
private: | ||
static bool m_usePlatformNativeDialog; | ||
|
||
friend class QDeepinFileDialogHelper; | ||
}; | ||
|
||
#endif // QDEEPINTHEME_H |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
if(QT_VERSION_MAJOR EQUAL 5) | ||
qt5_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialog.xml filedialog_interface) | ||
qt5_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialogmanager.xml filedialogmanager_interface) | ||
else() | ||
qt6_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialog.xml filedialog_interface) | ||
qt6_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialogmanager.xml filedialogmanager_interface) | ||
endif() | ||
|
||
set(DFM_DLG_HEADERS ${CMAKE_CURRENT_LIST_DIR}/qdeepinfiledialoghelper.h) | ||
set(DFM_DLG_SOURCES ${CMAKE_CURRENT_LIST_DIR}/qdeepinfiledialoghelper.cpp) |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.