Skip to content

Commit

Permalink
razorqt first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dobo90 committed Dec 1, 2013
1 parent f219a95 commit 009d56a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 16 deletions.
Binary file added .lxqtguiplatformplugin.cpp.swp
Binary file not shown.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ project(lxqt-qtplugin)
find_package(Qt4 4.6 REQUIRED QtCore QtGui)
include(${QT_USE_FILE})

find_package(LxQt REQUIRED)
include(${LXQT_USE_FILE})
#find_package(LxQt REQUIRED)
#include(${LXQT_USE_FILE})

if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -Wl,-no-undefined -Wall")
Expand All @@ -21,7 +21,7 @@ set(CMAKE_AUTOMOC TRUE)

include_directories(
${QT_INCLUDES}
${LXQT_INCLUDE_DIRS}
#${LXQT_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
Expand All @@ -32,12 +32,12 @@ set(qtlxqt_SRCS
qguiplatformplugin_p.h
)

add_library(qtlxqt SHARED ${qtlxqt_SRCS})
add_library(qtrazorqt SHARED ${qtlxqt_SRCS})

target_link_libraries(qtlxqt
target_link_libraries(qtrazorqt
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${LXQT_LIBRARIES}
#${LXQT_LIBRARIES}
)

install (TARGETS qtlxqt LIBRARY DESTINATION ${QT_PLUGINS_DIR}/gui_platform)
install (TARGETS qtrazorqt LIBRARY DESTINATION ${QT_PLUGINS_DIR}/gui_platform)
18 changes: 18 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
razorqt-qtplugin - a fork of lxqt-qtplugin which allows you to
change icon theme in Qt4 applications in RazorQt environtment

To compile it, invoke:
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
(in distributions <like Arch Linux> defaulting Qt5 instead of Qt4 add moreover
-DQT_QMAKE_EXECUTABLE=qmake-qt4)
make install

Bear in mind it's a minimalistic workaround. To get it working do
following steps:
1) echo "your-theme-name" >> ~/.razorqt_icontheme
"your-theme-name" could be for example " Faience-Azur
2) Add following environtment variable in RazorQt session settings:
QT_PLATFORM_PLUGIN=razorqt


Original lxqt-qtplugin readme:
libqtlxqt - LXDE-Qt system integration plugin for Qt.

With this plugin, all Qt-based programs can adopt settings of
Expand Down
27 changes: 20 additions & 7 deletions lxqtguiplatformplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,43 @@
#include <QFileInfo>
#include <QApplication>
#include <QWidget>
#include <QFile>
#include <QDir>

Q_EXPORT_PLUGIN2(LxQtGuiPlatformPlugin, LxQtGuiPlatformPlugin)

LxQtGuiPlatformPlugin::LxQtGuiPlatformPlugin() {
qDebug() << "LxQtGuiPlatformPlugin constructed";
/*qDebug() << "LxQtGuiPlatformPlugin constructed";
connect(LxQt::Settings::globalSettings(), SIGNAL(iconThemeChanged()), SLOT(onIconThemeChanged()));
connect(LxQt::Settings::globalSettings(), SIGNAL(settingsChanged()), SLOT(onSettingsChanged()));
connect(LxQt::Settings::globalSettings(), SIGNAL(settingsChanged()), SLOT(onSettingsChanged()));*/
QFile file(QDir::homePath() + "/.razorqt_icontheme");

if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "Couldn't open file ~/.razorqt_icontheme. Using default icon theme!";
iconThemeName = "";
}

QByteArray line = file.readLine();
iconThemeName = line.simplified();
}

LxQtGuiPlatformPlugin::~LxQtGuiPlatformPlugin() {
}

QString LxQtGuiPlatformPlugin::styleName() {
qDebug() << "LxQtGuiPlatformPlugin::styleName() is called";
return "fusion";
/*qDebug() << "LxQtGuiPlatformPlugin::styleName() is called";
return "fusion";*/
return QGuiPlatformPlugin::styleName();
}

QPalette LxQtGuiPlatformPlugin::palette() {
return QGuiPlatformPlugin::palette();
}

QString LxQtGuiPlatformPlugin::systemIconThemeName() {
qDebug() << "LxQtGuiPlatformPlugin::systemIconThemeName() is called";
return LxQt::Settings::globalSettings()->value("icon_theme").toString();
/*qDebug() << "LxQtGuiPlatformPlugin::systemIconThemeName() is called";
return LxQt::Settings::globalSettings()->value("icon_theme").toString();*/
return iconThemeName;
}

/*
Expand All @@ -68,7 +81,7 @@ QStringList LxQtGuiPlatformPlugin::iconThemeSearchPaths() {
*/

int LxQtGuiPlatformPlugin::platformHint(QGuiPlatformPlugin::PlatformHint hint) {
qDebug() << "LxQtGuiPlatformPlugin::platformHint() is called";
//qDebug() << "LxQtGuiPlatformPlugin::platformHint() is called";
int ret = 0;
switch(hint) {
case PH_ToolButtonStyle:
Expand Down
7 changes: 5 additions & 2 deletions lxqtguiplatformplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@

#include "qguiplatformplugin_p.h"
#include <QtGlobal>
#include <lxqt/LxQtSettings>
//#include <lxqt/LxQtSettings>

class LxQtGuiPlatformPlugin : public QGuiPlatformPlugin {
Q_OBJECT
private:
QString iconThemeName;

public:
explicit LxQtGuiPlatformPlugin();
virtual ~LxQtGuiPlatformPlugin();

virtual QStringList keys() const { return QStringList() << QLatin1String("lxqt"); }
virtual QStringList keys() const { return QStringList() << QLatin1String("razorqt"); }
virtual QString styleName();
virtual QPalette palette();
virtual QString systemIconThemeName();
Expand Down

0 comments on commit 009d56a

Please sign in to comment.