cherry-picking upstream version 0.9.0+20151024.

ubuntu/bionic
Alf Gaida 9 years ago
parent e1cbc09a41
commit 5e62c03710

@ -25,6 +25,8 @@ MACRO (BUILD_LXQT_PLUGIN NAME)
SOURCES SOURCES
${${PROJECT_NAME}_DESKTOP_FILES_IN} ${${PROJECT_NAME}_DESKTOP_FILES_IN}
) )
lxqt_plugin_translation_loader(QM_LOADER ${NAME} "lxqt-panel")
#************************************************ #************************************************
file (GLOB CONFIG_FILES resources/*.conf) file (GLOB CONFIG_FILES resources/*.conf)
@ -42,7 +44,7 @@ MACRO (BUILD_LXQT_PLUGIN NAME)
endif() endif()
list(FIND STATIC_PLUGINS ${NAME} IS_STATIC) list(FIND STATIC_PLUGINS ${NAME} IS_STATIC)
set(SRC ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES}) set(SRC ${HEADERS} ${SOURCES} ${QM_LOADER} ${MOC_SOURCES} ${${PROJECT_NAME}_QM_FILES} ${RESOURCES} ${UIS} ${DESKTOP_FILES})
if (${IS_STATIC} EQUAL -1) # not static if (${IS_STATIC} EQUAL -1) # not static
add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules
install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) # install the *.so file install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}) # install the *.so file

6
debian/changelog vendored

@ -1,7 +1,7 @@
lxqt-panel (0.9.0+20150925-1) experimental; urgency=medium lxqt-panel (0.9.0+20151024-1) experimental; urgency=medium
[ Alf Gaida ] [ Alf Gaida ]
* Cherry-picked upstream version 0.9.0+20150925. * Cherry-picked upstream version 0.9.0+20151024.
* Cleaned up debian/.gitignore * Cleaned up debian/.gitignore
* Switched to experimental because of LXQt namespace change * Switched to experimental because of LXQt namespace change
* Added minimum version for liblxqt0-dev (>= 0.9.0+20150911) * Added minimum version for liblxqt0-dev (>= 0.9.0+20150911)
@ -21,4 +21,4 @@ lxqt-panel (0.9.0+20150925-1) experimental; urgency=medium
* Sorting build-depends. * Sorting build-depends.
* Removing whitespaces at EOL and EOF. * Removing whitespaces at EOL and EOF.
-- Alf Gaida <agaida@siduction.org> Sat, 26 Sep 2015 03:39:36 +0200 -- Alf Gaida <agaida@siduction.org> Sun, 25 Oct 2015 02:27:12 +0200

@ -97,10 +97,11 @@ void AddPluginDialog::filter()
{ {
const LXQt::PluginInfo &plugin = mPlugins.at(i); const LXQt::PluginInfo &plugin = mPlugins.at(i);
QString s = QStringLiteral("%1 %2 %3 %4").arg(plugin.name(), QString s = QStringLiteral("%1 %2 %3 %4 %5").arg(plugin.name(),
plugin.comment(), plugin.comment(),
plugin.value("Name").toString(), plugin.value("Name").toString(),
plugin.value("Comment").toString()); plugin.value("Comment").toString(),
plugin.id());
if (!s.contains(ui->searchEdit->text(), Qt::CaseInsensitive)) if (!s.contains(ui->searchEdit->text(), Qt::CaseInsensitive))
continue; continue;
@ -110,10 +111,10 @@ void AddPluginDialog::filter()
{ {
item->setFlags(item->flags() & ~Qt::ItemIsEnabled); item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
item->setBackground(palette().brush(QPalette::Disabled, QPalette::Text)); item->setBackground(palette().brush(QPalette::Disabled, QPalette::Text));
item->setText(QStringLiteral("<b>%1</b><br>%2<br><small>%3</small>") item->setText(QStringLiteral("<b>%1</b> (%2)<br>%3<br><small>%4</small>")
.arg(plugin.name(), plugin.comment(), tr("(only one instance can run at a time)"))); .arg(plugin.name(), plugin.id(), plugin.comment(), tr("(only one instance can run at a time)")));
} else } else
item->setText(QStringLiteral("<b>%1</b><br>%2").arg(plugin.name(), plugin.comment())); item->setText(QStringLiteral("<b>%1</b> (%2)<br>%3").arg(plugin.name(), plugin.id(), plugin.comment()));
item->setIcon(plugin.icon(fallIco)); item->setIcon(plugin.icon(fallIco));
item->setData(INDEX_ROLE, i); item->setData(INDEX_ROLE, i);
} }

@ -35,7 +35,6 @@
#include "popupmenu.h" #include "popupmenu.h"
#include "plugin.h" #include "plugin.h"
#include "panelpluginsmodel.h" #include "panelpluginsmodel.h"
#include <LXQt/Settings>
#include <LXQt/PluginInfo> #include <LXQt/PluginInfo>
#include <QScreen> #include <QScreen>
@ -112,8 +111,9 @@ QString LXQtPanel::positionToStr(ILXQtPanel::Position position)
/************************************************ /************************************************
************************************************/ ************************************************/
LXQtPanel::LXQtPanel(const QString &configGroup, QWidget *parent) : LXQtPanel::LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidget *parent) :
QFrame(parent), QFrame(parent),
mSettings(settings),
mConfigGroup(configGroup), mConfigGroup(configGroup),
mPlugins{nullptr}, mPlugins{nullptr},
mPanelSize(0), mPanelSize(0),
@ -123,6 +123,7 @@ LXQtPanel::LXQtPanel(const QString &configGroup, QWidget *parent) :
mAlignment(AlignmentLeft), mAlignment(AlignmentLeft),
mPosition(ILXQtPanel::PositionBottom), mPosition(ILXQtPanel::PositionBottom),
mScreenNum(0), //whatever (avoid conditional on uninitialized value) mScreenNum(0), //whatever (avoid conditional on uninitialized value)
mActualScreenNum(0),
mHidable(false), mHidable(false),
mHidden(false) mHidden(false)
{ {
@ -174,8 +175,6 @@ LXQtPanel::LXQtPanel(const QString &configGroup, QWidget *parent) :
connect(LXQt::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update())); connect(LXQt::Settings::globalSettings(), SIGNAL(settingsChanged()), this, SLOT(update()));
connect(lxqtApp, SIGNAL(themeChanged()), this, SLOT(realign())); connect(lxqtApp, SIGNAL(themeChanged()), this, SLOT(realign()));
LXQtPanelApplication *app = reinterpret_cast<LXQtPanelApplication*>(qApp);
mSettings = app->settings();
readSettings(); readSettings();
// the old position might be on a visible screen // the old position might be on a visible screen
ensureVisible(); ensureVisible();
@ -213,7 +212,8 @@ void LXQtPanel::readSettings()
mSettings->value(CFG_KEY_PERCENT, true).toBool(), mSettings->value(CFG_KEY_PERCENT, true).toBool(),
false); false);
setPosition(mSettings->value(CFG_KEY_SCREENNUM, QApplication::desktop()->primaryScreen()).toInt(), mScreenNum = mSettings->value(CFG_KEY_SCREENNUM, QApplication::desktop()->primaryScreen()).toInt();
setPosition(mScreenNum,
strToPosition(mSettings->value(CFG_KEY_POSITION).toString(), PositionBottom), strToPosition(mSettings->value(CFG_KEY_POSITION).toString(), PositionBottom),
false); false);
@ -283,6 +283,8 @@ void LXQtPanel::ensureVisible()
{ {
if (!canPlacedOn(mScreenNum, mPosition)) if (!canPlacedOn(mScreenNum, mPosition))
setPosition(findAvailableScreen(mPosition), mPosition, true); setPosition(findAvailableScreen(mPosition), mPosition, true);
else
mActualScreenNum = mScreenNum;
// the screen size might be changed, let's update the reserved screen space. // the screen size might be changed, let's update the reserved screen space.
updateWmStrut(); updateWmStrut();
@ -352,7 +354,7 @@ int LXQtPanel::getReserveDimension()
void LXQtPanel::setPanelGeometry() void LXQtPanel::setPanelGeometry()
{ {
const QRect currentScreen = QApplication::desktop()->screenGeometry(mScreenNum); const QRect currentScreen = QApplication::desktop()->screenGeometry(mActualScreenNum);
QRect rect; QRect rect;
if (isHorizontal()) if (isHorizontal())
@ -731,7 +733,7 @@ void LXQtPanel::setPosition(int screen, ILXQtPanel::Position position, bool save
mPosition == position) mPosition == position)
return; return;
mScreenNum = screen; mActualScreenNum = screen;
mPosition = position; mPosition = position;
mLayout->setPosition(mPosition); mLayout->setPosition(mPosition);

@ -33,6 +33,7 @@
#include <QString> #include <QString>
#include <QTimer> #include <QTimer>
#include <QPointer> #include <QPointer>
#include <LXQt/Settings>
#include "ilxqtpanel.h" #include "ilxqtpanel.h"
#include "lxqtpanelglobals.h" #include "lxqtpanelglobals.h"
@ -59,6 +60,8 @@ class LXQT_PANEL_API LXQtPanel : public QFrame, public ILXQtPanel
// for configuration dialog // for configuration dialog
friend class ConfigPanelWidget; friend class ConfigPanelWidget;
friend class ConfigPluginsWidget; friend class ConfigPluginsWidget;
friend class ConfigPanelDialog;
friend class PanelPluginsModel;
public: public:
enum Alignment { enum Alignment {
@ -67,7 +70,7 @@ public:
AlignmentRight = 1 AlignmentRight = 1
}; };
LXQtPanel(const QString &configGroup, QWidget *parent = 0); LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidget *parent = 0);
virtual ~LXQtPanel(); virtual ~LXQtPanel();
QString name() { return mConfigGroup; } QString name() { return mConfigGroup; }
@ -104,8 +107,6 @@ public:
int opacity() const { return mOpacity; }; int opacity() const { return mOpacity; };
bool hidable() const { return mHidable; } bool hidable() const { return mHidable; }
LXQt::Settings *settings() const { return mSettings; }
bool isPluginSingletonAndRunnig(QString const & pluginId) const; bool isPluginSingletonAndRunnig(QString const & pluginId) const;
public slots: public slots:
@ -142,6 +143,7 @@ protected:
public slots: public slots:
void showConfigDialog(); void showConfigDialog();
private slots: private slots:
void showAddPluginDialog(); void showAddPluginDialog();
void realign(); void realign();
@ -173,7 +175,8 @@ private:
Alignment mAlignment; Alignment mAlignment;
ILXQtPanel::Position mPosition; ILXQtPanel::Position mPosition;
int mScreenNum; int mScreenNum; //!< configured screen (user preference)
int mActualScreenNum; //!< panel currently shown at (if the configured screen is not available)
QTimer mDelaySave; QTimer mDelaySave;
bool mHidable; bool mHidable;
bool mHidden; bool mHidden;
@ -187,6 +190,9 @@ private:
QPointer<ConfigPanelDialog> mConfigDialog; QPointer<ConfigPanelDialog> mConfigDialog;
void updateStyleSheet(); void updateStyleSheet();
// settings should be kept private for security
LXQt::Settings *settings() const { return mSettings; }
}; };

@ -107,11 +107,11 @@ void LXQtPanelApplication::addNewPanel()
LXQtPanel* LXQtPanelApplication::addPanel(const QString& name) LXQtPanel* LXQtPanelApplication::addPanel(const QString& name)
{ {
LXQtPanel *panel = new LXQtPanel(name); LXQtPanel *panel = new LXQtPanel(name, mSettings);
mPanels << panel; mPanels << panel;
connect(panel, SIGNAL(deletedByUser(LXQtPanel*)),
this, SLOT(removePanel(LXQtPanel*)));
// reemit signals // reemit signals
connect(panel, &LXQtPanel::deletedByUser, this, &LXQtPanelApplication::removePanel);
connect(panel, &LXQtPanel::pluginAdded, this, &LXQtPanelApplication::pluginAdded); connect(panel, &LXQtPanel::pluginAdded, this, &LXQtPanelApplication::pluginAdded);
connect(panel, &LXQtPanel::pluginRemoved, this, &LXQtPanelApplication::pluginRemoved); connect(panel, &LXQtPanel::pluginRemoved, this, &LXQtPanelApplication::pluginRemoved);

@ -47,7 +47,6 @@ public:
~LXQtPanelApplication(); ~LXQtPanelApplication();
int count() { return mPanels.count(); } int count() { return mPanels.count(); }
LXQt::Settings *settings() { return mSettings; }
bool isPluginSingletonAndRunnig(QString const & pluginId) const; bool isPluginSingletonAndRunnig(QString const & pluginId) const;
public slots: public slots:

@ -96,7 +96,7 @@ QStringList PanelPluginsModel::pluginNames() const
QStringList names; QStringList names;
for (auto const & p : mPlugins) for (auto const & p : mPlugins)
names.append(p.first); names.append(p.first);
return std::move(names); return names;
} }
QList<Plugin *> PanelPluginsModel::plugins() const QList<Plugin *> PanelPluginsModel::plugins() const
@ -105,7 +105,7 @@ QList<Plugin *> PanelPluginsModel::plugins() const
for (auto const & p : mPlugins) for (auto const & p : mPlugins)
if (!p.second.isNull()) if (!p.second.isNull())
plugins.append(p.second.data()); plugins.append(p.second.data());
return std::move(plugins); return plugins;
} }
Plugin* PanelPluginsModel::pluginByName(QString name) const Plugin* PanelPluginsModel::pluginByName(QString name) const
@ -246,9 +246,19 @@ QString PanelPluginsModel::findNewPluginSettingsGroup(const QString &pluginType)
groups.sort(); groups.sort();
// Generate new section name // Generate new section name
QString pluginName = QStringLiteral("%1").arg(pluginType);
if (!groups.contains(pluginName))
return pluginName;
else
{
for (int i = 2; true; ++i) for (int i = 2; true; ++i)
if (!groups.contains(QStringLiteral("%1%2").arg(pluginType).arg(i))) {
return QStringLiteral("%1%2").arg(pluginType).arg(i); pluginName = QStringLiteral("%1%2").arg(pluginType).arg(i);
if (!groups.contains(pluginName))
return pluginName;
}
}
} }
void PanelPluginsModel::onActivatedIndex(QModelIndex const & index) void PanelPluginsModel::onActivatedIndex(QModelIndex const & index)

@ -50,15 +50,25 @@
// statically linked built-in plugins // statically linked built-in plugins
#include "../plugin-clock/lxqtclock.h" // clock #include "../plugin-clock/lxqtclock.h" // clock
extern void * loadPluginTranslation_clock_helper;
#include "../plugin-desktopswitch/desktopswitch.h" // desktopswitch #include "../plugin-desktopswitch/desktopswitch.h" // desktopswitch
extern void * loadPluginTranslation_desktopswitch_helper;
#include "../plugin-mainmenu/lxqtmainmenu.h" // mainmenu #include "../plugin-mainmenu/lxqtmainmenu.h" // mainmenu
extern void * loadPluginTranslation_mainmenu_helper;
#include "../plugin-quicklaunch/lxqtquicklaunchplugin.h" // quicklaunch #include "../plugin-quicklaunch/lxqtquicklaunchplugin.h" // quicklaunch
extern void * loadPluginTranslation_quicklaunch_helper;
#include "../plugin-showdesktop/showdesktop.h" // showdesktop #include "../plugin-showdesktop/showdesktop.h" // showdesktop
extern void * loadPluginTranslation_showdesktop_helper;
#include "../plugin-spacer/spacer.h" // spacer #include "../plugin-spacer/spacer.h" // spacer
extern void * loadPluginTranslation_spacer_helper;
#include "../plugin-statusnotifier/statusnotifier.h" // statusnotifier #include "../plugin-statusnotifier/statusnotifier.h" // statusnotifier
extern void * loadPluginTranslation_statusnotifier_helper;
#include "../plugin-taskbar/lxqttaskbarplugin.h" // taskbar #include "../plugin-taskbar/lxqttaskbarplugin.h" // taskbar
extern void * loadPluginTranslation_taskbar_helper;
#include "../plugin-tray/lxqttrayplugin.h" // tray #include "../plugin-tray/lxqttrayplugin.h" // tray
extern void * loadPluginTranslation_tray_helper;
#include "../plugin-worldclock/lxqtworldclock.h" // worldclock #include "../plugin-worldclock/lxqtworldclock.h" // worldclock
extern void * loadPluginTranslation_worldclock_helper;
QColor Plugin::mMoveMarkerColor= QColor(255, 0, 0, 255); QColor Plugin::mMoveMarkerColor= QColor(255, 0, 0, 255);
@ -119,9 +129,6 @@ Plugin::Plugin(const LXQt::PluginInfo &desktopFile, const QString &settingsFile,
return; return;
} }
// Load plugin translations
LXQt::Translator::translatePlugin(desktopFile.id(), QLatin1String("lxqt-panel"));
setObjectName(mPlugin->themeId() + "Plugin"); setObjectName(mPlugin->themeId() + "Plugin");
// plugin handle for easy context menu // plugin handle for easy context menu
@ -185,50 +192,52 @@ namespace
{ {
//helper types for static plugins storage & binary search //helper types for static plugins storage & binary search
typedef std::unique_ptr<ILXQtPanelPluginLibrary> plugin_ptr_t; typedef std::unique_ptr<ILXQtPanelPluginLibrary> plugin_ptr_t;
typedef std::pair<QString, plugin_ptr_t > plugin_pair_t; typedef std::tuple<QString, plugin_ptr_t, void *> plugin_tuple_t;
//NOTE: Please keep the plugins sorted by name while adding new plugins. //NOTE: Please keep the plugins sorted by name while adding new plugins.
static plugin_pair_t const static_plugins[] = { //NOTE2: we need to reference some (dummy) symbol from (autogenerated) LXQtPluginTranslationLoader.cpp
// to be not stripped (as unused/unreferenced) in static linking time
static plugin_tuple_t const static_plugins[] = {
#if defined(WITH_CLOCK_PLUGIN) #if defined(WITH_CLOCK_PLUGIN)
{ QStringLiteral("clock"), plugin_ptr_t{new LXQtClockPluginLibrary} },// clock std::make_tuple(QStringLiteral("clock"), plugin_ptr_t{new LXQtClockPluginLibrary}, loadPluginTranslation_clock_helper),// clock
#endif #endif
#if defined(WITH_DESKTOPSWITCH_PLUGIN) #if defined(WITH_DESKTOPSWITCH_PLUGIN)
{ QStringLiteral("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary} },// desktopswitch std::make_tuple(QStringLiteral("desktopswitch"), plugin_ptr_t{new DesktopSwitchPluginLibrary}, loadPluginTranslation_desktopswitch_helper),// desktopswitch
#endif #endif
#if defined(WITH_MAINMENU_PLUGIN) #if defined(WITH_MAINMENU_PLUGIN)
{ QStringLiteral("mainmenu"), plugin_ptr_t{new LXQtMainMenuPluginLibrary} },// mainmenu std::make_tuple(QStringLiteral("mainmenu"), plugin_ptr_t{new LXQtMainMenuPluginLibrary}, loadPluginTranslation_mainmenu_helper),// mainmenu
#endif #endif
#if defined(WITH_QUICKLAUNCH_PLUGIN) #if defined(WITH_QUICKLAUNCH_PLUGIN)
{ QStringLiteral("quicklaunch"), plugin_ptr_t{new LXQtQuickLaunchPluginLibrary} },// quicklaunch std::make_tuple(QStringLiteral("quicklaunch"), plugin_ptr_t{new LXQtQuickLaunchPluginLibrary}, loadPluginTranslation_quicklaunch_helper),// quicklaunch
#endif #endif
#if defined(WITH_SHOWDESKTOP_PLUGIN) #if defined(WITH_SHOWDESKTOP_PLUGIN)
{ QStringLiteral("showdesktop"), plugin_ptr_t{new ShowDesktopLibrary} },// showdesktop std::make_tuple(QStringLiteral("showdesktop"), plugin_ptr_t{new ShowDesktopLibrary}, loadPluginTranslation_showdesktop_helper),// showdesktop
#endif #endif
#if defined(WITH_SPACER_PLUGIN) #if defined(WITH_SPACER_PLUGIN)
{ QStringLiteral("spacer"), plugin_ptr_t{new SpacerPluginLibrary} },// spacer std::make_tuple(QStringLiteral("spacer"), plugin_ptr_t{new SpacerPluginLibrary}, loadPluginTranslation_spacer_helper),// spacer
#endif #endif
#if defined(WITH_STATUSNOTIFIER_PLUGIN) #if defined(WITH_STATUSNOTIFIER_PLUGIN)
{ QStringLiteral("statusnotifier"), plugin_ptr_t{new StatusNotifierLibrary} },// statusnotifier std::make_tuple(QStringLiteral("statusnotifier"), plugin_ptr_t{new StatusNotifierLibrary}, loadPluginTranslation_statusnotifier_helper),// statusnotifier
#endif #endif
#if defined(WITH_TASKBAR_PLUGIN) #if defined(WITH_TASKBAR_PLUGIN)
{ QStringLiteral("taskbar"), plugin_ptr_t{new LXQtTaskBarPluginLibrary} },// taskbar std::make_tuple(QStringLiteral("taskbar"), plugin_ptr_t{new LXQtTaskBarPluginLibrary}, loadPluginTranslation_taskbar_helper),// taskbar
#endif #endif
#if defined(WITH_TRAY_PLUGIN) #if defined(WITH_TRAY_PLUGIN)
{ QStringLiteral("tray"), plugin_ptr_t{new LXQtTrayPluginLibrary} },// tray std::make_tuple(QStringLiteral("tray"), plugin_ptr_t{new LXQtTrayPluginLibrary}, loadPluginTranslation_tray_helper),// tray
#endif #endif
#if defined(WITH_WORLDCLOCK_PLUGIN) #if defined(WITH_WORLDCLOCK_PLUGIN)
{ QStringLiteral("worldclock"), plugin_ptr_t{new LXQtWorldClockLibrary} },// worldclock std::make_tuple(QStringLiteral("worldclock"), plugin_ptr_t{new LXQtWorldClockLibrary}, loadPluginTranslation_worldclock_helper),// worldclock
#endif #endif
}; };
static constexpr plugin_pair_t const * const plugins_begin = static_plugins; static constexpr plugin_tuple_t const * const plugins_begin = static_plugins;
static constexpr plugin_pair_t const * const plugins_end = static_plugins + sizeof (static_plugins) / sizeof (static_plugins[0]); static constexpr plugin_tuple_t const * const plugins_end = static_plugins + sizeof (static_plugins) / sizeof (static_plugins[0]);
struct assert_helper struct assert_helper
{ {
assert_helper() assert_helper()
{ {
Q_ASSERT(std::is_sorted(plugins_begin, plugins_end Q_ASSERT(std::is_sorted(plugins_begin, plugins_end
, [] (plugin_pair_t const & p1, plugin_pair_t const & p2) -> bool { return p1.first < p2.first; })); , [] (plugin_tuple_t const & p1, plugin_tuple_t const & p2) -> bool { return std::get<0>(p1) < std::get<0>(p2); }));
} }
}; };
static assert_helper h; static assert_helper h;
@ -237,10 +246,10 @@ namespace
ILXQtPanelPluginLibrary const * Plugin::findStaticPlugin(const QString &libraryName) ILXQtPanelPluginLibrary const * Plugin::findStaticPlugin(const QString &libraryName)
{ {
// find a static plugin library by name -> binary search // find a static plugin library by name -> binary search
plugin_pair_t const * plugin = std::lower_bound(plugins_begin, plugins_end, libraryName plugin_tuple_t const * plugin = std::lower_bound(plugins_begin, plugins_end, libraryName
, [] (plugin_pair_t const & plugin, QString const & name) -> bool { return plugin.first < name; }); , [] (plugin_tuple_t const & plugin, QString const & name) -> bool { return std::get<0>(plugin) < name; });
if (plugins_end != plugin && libraryName == plugin->first) if (plugins_end != plugin && libraryName == std::get<0>(*plugin))
return plugin->second.get(); return std::get<1>(*plugin).get();
return nullptr; return nullptr;
} }

@ -30,7 +30,7 @@
#include <QEvent> #include <QEvent>
CalendarPopup::CalendarPopup(QWidget *parent): CalendarPopup::CalendarPopup(QWidget *parent):
QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint)
{ {
setLayout(new QHBoxLayout(this)); setLayout(new QHBoxLayout(this));
layout()->setMargin(1); layout()->setMargin(1);
@ -51,14 +51,6 @@ void CalendarPopup::show()
QDialog::show(); QDialog::show();
} }
bool CalendarPopup::event(QEvent *event)
{
if (event->type() == QEvent::WindowDeactivate)
hide();
return QDialog::event(event);
}
void CalendarPopup::setFirstDayOfWeek(Qt::DayOfWeek wday) void CalendarPopup::setFirstDayOfWeek(Qt::DayOfWeek wday)
{ {
cal->setFirstDayOfWeek(wday); cal->setFirstDayOfWeek(wday);

@ -42,9 +42,6 @@ public:
void show(); void show();
protected:
virtual bool event(QEvent* );
private: private:
QCalendarWidget *cal; QCalendarWidget *cal;
}; };

@ -40,20 +40,23 @@ Content::Content(bool layoutEnabled):
box->setSpacing(0); box->setSpacing(0);
setLayout(box); setLayout(box);
m_capsLock = new QLabel("C"); m_capsLock = new QLabel(tr("C", "Label for CapsLock indicator"));
m_capsLock->setObjectName("CapsLockLabel"); m_capsLock->setObjectName("CapsLockLabel");
m_capsLock->setAlignment(Qt::AlignCenter); m_capsLock->setAlignment(Qt::AlignCenter);
m_capsLock->setToolTip(tr("CapsLock", "Tooltip for CapsLock indicator"));
m_capsLock->installEventFilter(this); m_capsLock->installEventFilter(this);
layout()->addWidget(m_capsLock); layout()->addWidget(m_capsLock);
m_numLock = new QLabel("N"); m_numLock = new QLabel(tr("N", "Label for NumLock indicator"));
m_numLock->setObjectName("NumLockLabel"); m_numLock->setObjectName("NumLockLabel");
m_numLock->setToolTip(tr("NumLock", "Tooltip for NumLock indicator"));
m_numLock->setAlignment(Qt::AlignCenter); m_numLock->setAlignment(Qt::AlignCenter);
m_numLock->installEventFilter(this); m_numLock->installEventFilter(this);
layout()->addWidget(m_numLock); layout()->addWidget(m_numLock);
m_scrollLock = new QLabel("S"); m_scrollLock = new QLabel(tr("S", "Label for ScrollLock indicator"));
m_scrollLock->setObjectName("ScrollLockLabel"); m_scrollLock->setObjectName("ScrollLockLabel");
m_scrollLock->setToolTip(tr("ScrollLock", "Tooltip for ScrollLock indicator"));
m_scrollLock->setAlignment(Qt::AlignCenter); m_scrollLock->setAlignment(Qt::AlignCenter);
m_scrollLock->installEventFilter(this); m_scrollLock->installEventFilter(this);
layout()->addWidget(m_scrollLock); layout()->addWidget(m_scrollLock);

@ -4,12 +4,48 @@
<context> <context>
<name>Content</name> <name>Content</name>
<message> <message>
<location filename="../src/content.cpp" line="60"/> <location filename="../src/content.cpp" line="17"/>
<source>C</source>
<comment>Label for CapsLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="20"/>
<source>CapsLock</source>
<comment>Tooltip for CapsLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="24"/>
<source>N</source>
<comment>Label for NumLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="26"/>
<source>NumLock</source>
<comment>Tooltip for NumLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="31"/>
<source>S</source>
<comment>Label for ScrollLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="33"/>
<source>ScrollLock</source>
<comment>Tooltip for ScrollLock indicator</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/content.cpp" line="63"/>
<source>Layout</source> <source>Layout</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/content.cpp" line="60"/> <location filename="../src/content.cpp" line="63"/>
<source>Variant</source> <source>Variant</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -18,12 +54,12 @@
<name>KbdStateConfig</name> <name>KbdStateConfig</name>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="14"/> <location filename="../src/kbdstateconfig.ui" line="14"/>
<source>Dialog</source> <source>Keyboard indicator settings</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="20"/> <location filename="../src/kbdstateconfig.ui" line="20"/>
<source>Leds</source> <source>LEDs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
@ -73,7 +109,7 @@
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="152"/> <location filename="../src/kbdstateconfig.ui" line="152"/>
<source>Configure layouts</source> <source>Configure layouts...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>

@ -4,12 +4,51 @@
<context> <context>
<name>Content</name> <name>Content</name>
<message> <message>
<location filename="../src/content.cpp" line="60"/> <location filename="../src/content.cpp" line="43"/>
<source>C</source>
<comment>Label for CapsLock indicator</comment>
<translatorcomment>This capital letter is printed on my keyboard.</translatorcomment>
<translation>A</translation>
</message>
<message>
<location filename="../src/content.cpp" line="46"/>
<source>CapsLock</source>
<comment>Tooltip for CapsLock indicator</comment>
<translation>Großbuchstaben</translation>
</message>
<message>
<location filename="../src/content.cpp" line="50"/>
<source>N</source>
<comment>Label for NumLock indicator</comment>
<translatorcomment>This digit is printed on my keyboard.</translatorcomment>
<translation>1</translation>
</message>
<message>
<location filename="../src/content.cpp" line="52"/>
<source>NumLock</source>
<comment>Tooltip for NumLock indicator</comment>
<translation>Ziffern</translation>
</message>
<message>
<location filename="../src/content.cpp" line="57"/>
<source>S</source>
<comment>Label for ScrollLock indicator</comment>
<translatorcomment>From the word &quot;Rollen&quot;.</translatorcomment>
<translation>R</translation>
</message>
<message>
<location filename="../src/content.cpp" line="59"/>
<source>ScrollLock</source>
<comment>Tooltip for ScrollLock indicator</comment>
<translation>Rollen</translation>
</message>
<message>
<location filename="../src/content.cpp" line="90"/>
<source>Layout</source> <source>Layout</source>
<translation>Layout</translation> <translation>Layout</translation>
</message> </message>
<message> <message>
<location filename="../src/content.cpp" line="60"/> <location filename="../src/content.cpp" line="90"/>
<source>Variant</source> <source>Variant</source>
<translation>Variante</translation> <translation>Variante</translation>
</message> </message>
@ -18,13 +57,13 @@
<name>KbdStateConfig</name> <name>KbdStateConfig</name>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="14"/> <location filename="../src/kbdstateconfig.ui" line="14"/>
<source>Dialog</source> <source>Keyboard state settings</source>
<translation>Tastatur</translation> <translation>Tastaturstatus - Einstellungen</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="20"/> <location filename="../src/kbdstateconfig.ui" line="20"/>
<source>Leds</source> <source>Lock Indicators</source>
<translation>LEDs</translation> <translation>Schalteranzeigen</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="26"/> <location filename="../src/kbdstateconfig.ui" line="26"/>
@ -42,39 +81,34 @@
<translation>Rollen-Taste anzeigen</translation> <translation>Rollen-Taste anzeigen</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="74"/> <location filename="../src/kbdstateconfig.ui" line="50"/>
<source>Show keyboard layout</source> <source>Keyboard Layout Indicator</source>
<translation>Tastatur-Layout anzeigen</translation> <translation>Tastatur-Layout anzeigen</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="99"/> <location filename="../src/kbdstateconfig.ui" line="62"/>
<source>Show flags instead labels</source> <source>Switching policy</source>
<translation>Flaggen statt Kennung anzeigen</translation> <translation>Umschaltrichtlinie</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="106"/> <location filename="../src/kbdstateconfig.ui" line="102"/>
<source>Layout mode:</source> <source>Configure layouts</source>
<translation>Layout-Modus:</translation> <translation>Layout konfigurieren</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="116"/> <location filename="../src/kbdstateconfig.ui" line="69"/>
<source>Global</source> <source>Global</source>
<translation>Global</translation> <translation>Global</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="129"/> <location filename="../src/kbdstateconfig.ui" line="79"/>
<source>Window</source> <source>Window</source>
<translation>Fenster</translation> <translation>Fenster</translation>
</message> </message>
<message> <message>
<location filename="../src/kbdstateconfig.ui" line="142"/> <location filename="../src/kbdstateconfig.ui" line="89"/>
<source>Application</source> <source>Application</source>
<translation>Anwendung</translation> <translation>Anwendung</translation>
</message> </message>
<message>
<location filename="../src/kbdstateconfig.ui" line="152"/>
<source>Configure layouts</source>
<translation>Layout konfigurieren...</translation>
</message>
</context> </context>
</TS> </TS>

@ -53,7 +53,7 @@ static bool hasRemovableParent(Solid::Device device)
} }
Popup::Popup(ILXQtPanelPlugin * plugin, QWidget* parent): Popup::Popup(ILXQtPanelPlugin * plugin, QWidget* parent):
QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint), QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint),
mPlugin(plugin), mPlugin(plugin),
mPlaceholder(nullptr), mPlaceholder(nullptr),
mDisplayCount(0) mDisplayCount(0)

@ -1,7 +1,7 @@
set(PLUGIN "statusnotifier") set(PLUGIN "statusnotifier")
find_package(dbusmenu-qt5 REQUIRED QUIET) find_package(dbusmenu-qt5 REQUIRED)
set(HEADERS set(HEADERS
statusnotifier.h statusnotifier.h
@ -30,7 +30,6 @@ qt5_add_dbus_adaptor(SOURCES
) )
set(LIBRARIES set(LIBRARIES
lxqt
dbusmenu-qt5 dbusmenu-qt5
) )

@ -53,6 +53,7 @@ namespace
{ {
const char * loc; const char * loc;
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu0");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu1"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu1");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu2"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu2");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu3"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu3");
@ -62,6 +63,7 @@ namespace
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu7"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu7");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu8"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu8");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu9"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu9");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu10");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu11"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu11");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu12"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu12");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu13"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu13");
@ -75,7 +77,6 @@ namespace
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu21"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu21");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu22"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu22");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu23"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu23");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "cpu24");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "memory"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "memory");
loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "swap"); loc = QT_TRANSLATE_NOOP("LXQtSysStatConfiguration", "swap");
static_cast<void>(t);//avoid unused variable warning static_cast<void>(t);//avoid unused variable warning

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1" language="en_US"> <TS version="2.1">
<context> <context>
<name>LXQtSysStatColours</name> <name>LXQtSysStatColours</name>
<message> <message>
@ -113,11 +113,41 @@
</context> </context>
<context> <context>
<name>LXQtSysStatConfiguration</name> <name>LXQtSysStatConfiguration</name>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="14"/>
<source>System Statistics Settings</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="22"/> <location filename="../lxqtsysstatconfiguration.ui" line="22"/>
<source>Graph</source> <source>Graph</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="34"/>
<source>&amp;Minimal size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="44"/>
<source>Update &amp;interval</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="54"/>
<source>&amp;Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="64"/>
<source>&amp;Grid lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="80"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimal width if the panel is horizontal.&lt;/p&gt;&lt;p&gt;Minimal height is the panel is vertical.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="83"/> <location filename="../lxqtsysstatconfiguration.ui" line="83"/>
<source> px</source> <source> px</source>
@ -134,103 +164,241 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="14"/> <location filename="../lxqtsysstatconfiguration.ui" line="149"/>
<source>System Statistics Settings</source> <source>Use &amp;frequency</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="34"/> <location filename="../lxqtsysstatconfiguration.ui" line="207"/>
<source>&amp;Minimal size</source> <source>Ma&amp;ximum</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="44"/> <location filename="../lxqtsysstatconfiguration.ui" line="222"/>
<source>Update &amp;interval</source> <source>XXX KBs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="54"/> <location filename="../lxqtsysstatconfiguration.ui" line="241"/>
<source>&amp;Title</source> <source>Lo&amp;garithmic scale</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="64"/> <location filename="../lxqtsysstatconfiguration.ui" line="248"/>
<source>&amp;Grid lines</source> <source> steps</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="80"/> <location filename="../lxqtsysstatconfiguration.ui" line="286"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Minimal width if the panel is horizontal.&lt;/p&gt;&lt;p&gt;Minimal height is the panel is vertical.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&amp;Source</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="149"/> <location filename="../lxqtsysstatconfiguration.ui" line="296"/>
<source>Use &amp;frequency</source> <source>T&amp;ype</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="207"/> <location filename="../lxqtsysstatconfiguration.ui" line="312"/>
<source>Ma&amp;ximum</source> <source>Colours</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="241"/> <location filename="../lxqtsysstatconfiguration.ui" line="327"/>
<source>Lo&amp;garithmic scale</source> <source>Use t&amp;heme colours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="337"/>
<source>Use c&amp;ustom colours</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="290"/> <location filename="../lxqtsysstatconfiguration.ui" line="344"/>
<source>Custom colour ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="41"/>
<source>CPU</source> <source>CPU</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="295"/> <location filename="../lxqtsysstatconfiguration.cpp" line="42"/>
<source>Memory</source> <source>Memory</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="300"/> <location filename="../lxqtsysstatconfiguration.cpp" line="43"/>
<source>Network</source> <source>Network</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="308"/> <location filename="../lxqtsysstatconfiguration.cpp" line="55"/>
<source>&amp;Source</source> <source>cpu</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="318"/> <location filename="../lxqtsysstatconfiguration.cpp" line="56"/>
<source>T&amp;ype</source> <source>cpu0</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="334"/> <location filename="../lxqtsysstatconfiguration.cpp" line="57"/>
<source>Colours</source> <source>cpu1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="349"/> <location filename="../lxqtsysstatconfiguration.cpp" line="58"/>
<source>Use t&amp;heme colours</source> <source>cpu2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="359"/> <location filename="../lxqtsysstatconfiguration.cpp" line="59"/>
<source>Use c&amp;ustom colours</source> <source>cpu3</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="366"/> <location filename="../lxqtsysstatconfiguration.cpp" line="60"/>
<source>Custom colour ...</source> <source>cpu4</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="222"/> <location filename="../lxqtsysstatconfiguration.cpp" line="61"/>
<source>XXX KBs</source> <source>cpu5</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="248"/> <location filename="../lxqtsysstatconfiguration.cpp" line="62"/>
<source> steps</source> <source>cpu6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="63"/>
<source>cpu7</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="64"/>
<source>cpu8</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="65"/>
<source>cpu9</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="66"/>
<source>cpu10</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="67"/>
<source>cpu11</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="68"/>
<source>cpu12</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="69"/>
<source>cpu13</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="70"/>
<source>cpu14</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="71"/>
<source>cpu15</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="72"/>
<source>cpu16</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="73"/>
<source>cpu17</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="74"/>
<source>cpu18</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="75"/>
<source>cpu19</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="76"/>
<source>cpu20</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="77"/>
<source>cpu21</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="78"/>
<source>cpu22</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="79"/>
<source>cpu23</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="80"/>
<source>memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="81"/>
<source>swap</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LXQtSysStatContent</name>
<message>
<location filename="../lxqtsysstat.cpp" line="397"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: %5%</source>
<comment>CPU tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="446"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: n/a</source>
<comment>CPU tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="488"/>
<source>apps: %1%&lt;br&gt;buffers: %2%&lt;br&gt;cached: %3%</source>
<comment>Memory tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="522"/>
<source>used: %1%</source>
<comment>Swap tooltip information</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="552"/>
<source>min: %1%&lt;br&gt;max: %2%</source>
<comment>Network tooltip information</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>

@ -189,49 +189,217 @@
<translation> Schritte</translation> <translation> Schritte</translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="290"/> <location filename="../lxqtsysstatconfiguration.ui" line="286"/>
<source>CPU</source>
<translation>Prozessor</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="295"/>
<source>Memory</source>
<translation>Speicher</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="300"/>
<source>Network</source>
<translation>Netzwerk</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.ui" line="308"/>
<source>&amp;Source</source> <source>&amp;Source</source>
<translation>&amp;Quelle</translation> <translation>&amp;Quelle</translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="318"/> <location filename="../lxqtsysstatconfiguration.ui" line="296"/>
<source>T&amp;ype</source> <source>T&amp;ype</source>
<translation>T&amp;yp</translation> <translation>T&amp;yp</translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="334"/> <location filename="../lxqtsysstatconfiguration.ui" line="312"/>
<source>Colours</source> <source>Colours</source>
<translation>Farben</translation> <translation>Farben</translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="349"/> <location filename="../lxqtsysstatconfiguration.ui" line="327"/>
<source>Use t&amp;heme colours</source> <source>Use t&amp;heme colours</source>
<translation>Farben des Farbsc&amp;hemas</translation> <translation>Farben des Farbsc&amp;hemas</translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="359"/> <location filename="../lxqtsysstatconfiguration.ui" line="337"/>
<source>Use c&amp;ustom colours</source> <source>Use c&amp;ustom colours</source>
<translation>&amp;Eigene Farben</translation> <translation>&amp;Eigene Farben</translation>
</message> </message>
<message> <message>
<location filename="../lxqtsysstatconfiguration.ui" line="366"/> <location filename="../lxqtsysstatconfiguration.ui" line="344"/>
<source>Custom colour ...</source> <source>Custom colour ...</source>
<translation>auswählen...</translation> <translation>auswählen...</translation>
</message> </message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="41"/>
<source>CPU</source>
<translation>Prozessor</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="42"/>
<source>Memory</source>
<translation>Speicher</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="43"/>
<source>Network</source>
<translation>Netzwerk</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="55"/>
<source>cpu</source>
<translation>CPU</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="56"/>
<source>cpu0</source>
<translation>CPU0</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="57"/>
<source>cpu1</source>
<translation>CPU1</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="58"/>
<source>cpu2</source>
<translation>CPU2</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="59"/>
<source>cpu3</source>
<translation>CPU3</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="60"/>
<source>cpu4</source>
<translation>CPU4</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="61"/>
<source>cpu5</source>
<translation>CPU5</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="62"/>
<source>cpu6</source>
<translation>CPU6</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="63"/>
<source>cpu7</source>
<translation>CPU7</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="64"/>
<source>cpu8</source>
<translation>CPU8</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="65"/>
<source>cpu9</source>
<translation>CPU9</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="66"/>
<source>cpu10</source>
<translation>CPU10</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="67"/>
<source>cpu11</source>
<translation>CPU11</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="68"/>
<source>cpu12</source>
<translation>CPU12</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="69"/>
<source>cpu13</source>
<translation>CPU13</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="70"/>
<source>cpu14</source>
<translation>CPU14</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="71"/>
<source>cpu15</source>
<translation>CPU15</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="72"/>
<source>cpu16</source>
<translation>CPU16</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="73"/>
<source>cpu17</source>
<translation>CPU17</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="74"/>
<source>cpu18</source>
<translation>CPU18</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="75"/>
<source>cpu19</source>
<translation>CPU19</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="76"/>
<source>cpu20</source>
<translation>CPU20</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="77"/>
<source>cpu21</source>
<translation>CPU21</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="78"/>
<source>cpu22</source>
<translation>CPU22</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="79"/>
<source>cpu23</source>
<translation>CPU23</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="80"/>
<source>memory</source>
<translation>Speicher</translation>
</message>
<message>
<location filename="../lxqtsysstatconfiguration.cpp" line="81"/>
<source>swap</source>
<translation>Ausgelagert</translation>
</message>
</context>
<context>
<name>LXQtSysStatContent</name>
<message>
<location filename="../lxqtsysstat.cpp" line="397"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: %5%</source>
<comment>CPU tooltip information</comment>
<translation>System: %1%&lt;br&gt;Nutzer: %2%&lt;br&gt;Priorität: %3%&lt;br&gt;Andere: %4%&lt;br&gt;Freq: %5%</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="446"/>
<source>system: %1%&lt;br&gt;user: %2%&lt;br&gt;nice: %3%&lt;br&gt;other: %4%&lt;br&gt;freq: n/a</source>
<comment>CPU tooltip information</comment>
<translation>System: %1%&lt;br&gt;Nutzer: %2%&lt;br&gt;Priorität: %3%&lt;br&gt;Andere: %4%&lt;br&gt;Freq: n/a</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="488"/>
<source>apps: %1%&lt;br&gt;buffers: %2%&lt;br&gt;cached: %3%</source>
<comment>Memory tooltip information</comment>
<translation>Anwendungen: %1%&lt;br&gt;Puffer: %2%&lt;br&gt;Cache: %3%</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="522"/>
<source>used: %1%</source>
<comment>Swap tooltip information</comment>
<translation>Benutzt: %1%</translation>
</message>
<message>
<location filename="../lxqtsysstat.cpp" line="552"/>
<source>min: %1%&lt;br&gt;max: %2%</source>
<comment>Network tooltip information</comment>
<translation>Min: %1%&lt;br&gt;Max: %2%</translation>
</message>
</context> </context>
</TS> </TS>

@ -67,12 +67,11 @@ LXQtGroupPopup::~LXQtGroupPopup()
void LXQtGroupPopup::dropEvent(QDropEvent *event) void LXQtGroupPopup::dropEvent(QDropEvent *event)
{ {
qlonglong temp; qlonglong temp;
WId window;
QDataStream stream(event->mimeData()->data(LXQtTaskButton::mimeDataFormat())); QDataStream stream(event->mimeData()->data(LXQtTaskButton::mimeDataFormat()));
stream >> temp; stream >> temp;
window = (WId) temp; WId window = (WId) temp;
LXQtTaskButton *button; LXQtTaskButton *button = nullptr;
int oldIndex(0); int oldIndex(0);
// get current position of the button being dragged // get current position of the button being dragged
for (int i = 0; i < layout()->count(); i++) for (int i = 0; i < layout()->count(); i++)
@ -86,6 +85,9 @@ void LXQtGroupPopup::dropEvent(QDropEvent *event)
} }
} }
if (button == nullptr)
return;
int newIndex = -1; int newIndex = -1;
// find the new position to place it in // find the new position to place it in
for (int i = 0; i < oldIndex && newIndex == -1; i++) for (int i = 0; i < oldIndex && newIndex == -1; i++)
@ -109,6 +111,7 @@ void LXQtGroupPopup::dropEvent(QDropEvent *event)
l->takeAt(oldIndex); l->takeAt(oldIndex);
l->insertWidget(newIndex, button); l->insertWidget(newIndex, button);
l->invalidate(); l->invalidate();
} }
void LXQtGroupPopup::dragEnterEvent(QDragEnterEvent *event) void LXQtGroupPopup::dragEnterEvent(QDragEnterEvent *event)

@ -140,8 +140,10 @@ bool LXQtTaskBar::acceptWindow(WId window) const
void LXQtTaskBar::dragEnterEvent(QDragEnterEvent* event) void LXQtTaskBar::dragEnterEvent(QDragEnterEvent* event)
{ {
if (event->mimeData()->hasFormat(LXQtTaskGroup::mimeDataFormat())) if (event->mimeData()->hasFormat(LXQtTaskGroup::mimeDataFormat()))
{
event->acceptProposedAction(); event->acceptProposedAction();
else buttonMove(nullptr, LXQtTaskGroup::mimeDataData(event->mimeData()), event->pos());
} else
event->ignore(); event->ignore();
QWidget::dragEnterEvent(event); QWidget::dragEnterEvent(event);
} }
@ -149,56 +151,70 @@ void LXQtTaskBar::dragEnterEvent(QDragEnterEvent* event)
/************************************************ /************************************************
************************************************/ ************************************************/
void LXQtTaskBar::dropEvent(QDropEvent* event) void LXQtTaskBar::dragMoveEvent(QDragMoveEvent * event)
{
if (!event->mimeData()->hasFormat(LXQtTaskGroup::mimeDataFormat()))
{ {
event->ignore(); //we don't get any dragMoveEvents if dragEnter wasn't accepted
return; buttonMove(nullptr, LXQtTaskGroup::mimeDataData(event->mimeData()), event->pos());
QWidget::dragMoveEvent(event);
} }
QString data; /************************************************
QDataStream stream(event->mimeData()->data(LXQtTaskGroup::mimeDataFormat()));
stream >> data;
LXQtTaskGroup *group = mGroupsHash.value(data, NULL); ************************************************/
if (!group) void LXQtTaskBar::buttonMove(LXQtTaskGroup * dst, QString const & srcWindow, QPoint const & pos)
{
LXQtTaskGroup *src_group = mGroupsHash.value(srcWindow, nullptr);
if (!src_group)
{ {
qDebug() << "Dropped invalid"; qDebug() << "Dropped invalid";
return; return;
} }
int droppedIndex = mLayout->indexOf(group); const int src_index = mLayout->indexOf(src_group);
int newPos = -1;
const int size = mLayout->count(); const int size = mLayout->count();
Q_ASSERT(0 < size);
//dst is nullptr in case the drop occured on empty space in taskbar
int dst_index;
if (nullptr == dst)
{
//moving based on taskbar (not signaled by button)
QRect occupied = mLayout->occupiedGeometry();
QRect last_empty_row{occupied};
if (mPlugin->panel()->isHorizontal()) if (mPlugin->panel()->isHorizontal())
{ {
for (int i = 0; i < droppedIndex && newPos == -1; i++) last_empty_row.setTopLeft(mLayout->itemAt(size - 1)->geometry().topRight());
if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 > event->pos().x()) } else
newPos = i;
for (int i = size - 1; i > droppedIndex && newPos == -1; i--)
if (mLayout->itemAt(i)->widget()->x() + mLayout->itemAt(i)->widget()->width() / 2 < event->pos().x())
newPos = i;
}
else
{ {
for (int i = 0; i < droppedIndex && newPos == -1; i++) last_empty_row.setTopLeft(mLayout->itemAt(size - 1)->geometry().bottomLeft());
if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 > event->pos().y())
newPos = i;
for (int i = size - 1; i > droppedIndex && newPos == -1; i--)
if (mLayout->itemAt(i)->widget()->y() + mLayout->itemAt(i)->widget()->height() / 2 < event->pos().y())
newPos = i;
} }
if (newPos == -1 || droppedIndex == newPos) if (occupied.contains(pos) && !last_empty_row.contains(pos))
return; return;
mLayout->moveItem(droppedIndex, newPos); dst_index = size;
mLayout->invalidate(); } else
{
//moving based on signal from child button
dst_index = mLayout->indexOf(dst);
if (mPlugin->panel()->isHorizontal())
{
if (dst->rect().center().x() < pos.x())
++dst_index;
} else
{
if (dst->rect().center().y() < pos.y())
++dst_index;
}
}
//moving lower index to higher one => consider as the QList::move => insert(to, takeAt(from))
if (src_index < dst_index)
--dst_index;
if (dst_index == src_index)
return;
QWidget::dropEvent(event); mLayout->moveItem(src_index, dst_index, true);
} }
/************************************************ /************************************************
@ -229,6 +245,9 @@ void LXQtTaskBar::addWindow(WId window, QString const & groupId)
connect(group, SIGNAL(visibilityChanged(bool)), this, SLOT(refreshPlaceholderVisibility())); connect(group, SIGNAL(visibilityChanged(bool)), this, SLOT(refreshPlaceholderVisibility()));
connect(group, &LXQtTaskGroup::popupShown, this, &LXQtTaskBar::groupPopupShown); connect(group, &LXQtTaskGroup::popupShown, this, &LXQtTaskBar::groupPopupShown);
connect(group, SIGNAL(windowDisowned(WId)), this, SLOT(refreshTaskList())); connect(group, SIGNAL(windowDisowned(WId)), this, SLOT(refreshTaskList()));
connect(group, &LXQtTaskButton::dragging, this, [this] (QString const & mimeWindow, QPoint const & pos) {
buttonMove(qobject_cast<LXQtTaskGroup *>(sender()), mimeWindow, pos);
});
mLayout->addWidget(group); mLayout->addWidget(group);
mGroupsHash.insert(groupId, group); mGroupsHash.insert(groupId, group);

@ -82,7 +82,7 @@ public slots:
protected: protected:
virtual void dragEnterEvent(QDragEnterEvent * event); virtual void dragEnterEvent(QDragEnterEvent * event);
virtual void dropEvent(QDropEvent * event); virtual void dragMoveEvent(QDragMoveEvent * event);
private slots: private slots:
void refreshIconGeometry(); void refreshIconGeometry();
@ -95,6 +95,7 @@ private slots:
private: private:
void addWindow(WId window, QString const & groupId); void addWindow(WId window, QString const & groupId);
void buttonMove(LXQtTaskGroup * dst, QString const & srcWindow, QPoint const & pos);
private: private:
QHash<QString, LXQtTaskGroup*> mGroupsHash; QHash<QString, LXQtTaskGroup*> mGroupsHash;

@ -70,6 +70,17 @@ void LeftAlignedTextStyle::drawItemText(QPainter * painter, const QRect & rect,
} }
/************************************************
************************************************/
QString LXQtTaskButton::mimeDataData(QMimeData const * mime)
{
QString data;
QDataStream stream(mime->data(mimeDataFormat()));
stream >> data;
return data;
}
/************************************************ /************************************************
************************************************/ ************************************************/
@ -157,31 +168,44 @@ void LXQtTaskButton::refreshIconGeometry(QRect const & geom)
************************************************/ ************************************************/
void LXQtTaskButton::dragEnterEvent(QDragEnterEvent *event) void LXQtTaskButton::dragEnterEvent(QDragEnterEvent *event)
{ {
// It must be here otherwise dragLeaveEvent and dragMoveEvent won't be called
// on the other hand drop and dragmove events of parent widget won't be called
event->acceptProposedAction();
if (event->mimeData()->hasFormat(mimeDataFormat())) if (event->mimeData()->hasFormat(mimeDataFormat()))
{ {
event->ignore(); emit dragging(mimeDataData(event->mimeData()), event->pos());
return; setAttribute(Qt::WA_UnderMouse, false);
} } else
{
mDNDTimer->start(); mDNDTimer->start();
}
// It must be here otherwise dragLeaveEvent and dragMoveEvent won't be called
// on the other hand drop and dragmove events of parent widget won't be called
event->accept();
QToolButton::dragEnterEvent(event); QToolButton::dragEnterEvent(event);
} }
void LXQtTaskButton::dragMoveEvent(QDragMoveEvent * event)
{
if (event->mimeData()->hasFormat(mimeDataFormat()))
{
emit dragging(mimeDataData(event->mimeData()), event->pos());
setAttribute(Qt::WA_UnderMouse, false);
}
}
void LXQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event) void LXQtTaskButton::dragLeaveEvent(QDragLeaveEvent *event)
{ {
mDNDTimer->stop(); mDNDTimer->stop();
event->ignore();
QToolButton::dragLeaveEvent(event); QToolButton::dragLeaveEvent(event);
} }
void LXQtTaskButton::dropEvent(QDropEvent *event) void LXQtTaskButton::dropEvent(QDropEvent *event)
{ {
mDNDTimer->stop(); mDNDTimer->stop();
event->ignore(); if (event->mimeData()->hasFormat(mimeDataFormat()))
{
emit dropped(mimeDataData(event->mimeData()), event->pos());
setAttribute(Qt::WA_UnderMouse, false);
}
QToolButton::dropEvent(event); QToolButton::dropEvent(event);
} }
@ -241,12 +265,8 @@ void LXQtTaskButton::mouseMoveEvent(QMouseEvent* event)
QDrag *drag = new QDrag(this); QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData()); drag->setMimeData(mimeData());
QIcon ico = icon();
//fixme when vertical panel, pixmap is empty drag->setPixmap(ico.pixmap(ico.actualSize({32, 32})));
QPixmap pixmap = grab();
drag->setPixmap(pixmap);
drag->setHotSpot(QPoint(mapTo(this, event->pos())));
sDraggging = true; sDraggging = true;
drag->exec(); drag->exec();

@ -85,6 +85,7 @@ public:
void refreshIconGeometry(QRect const & geom); void refreshIconGeometry(QRect const & geom);
static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskbutton"); } static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskbutton"); }
static QString mimeDataData(QMimeData const * mime);
/*! \return true if this buttom received DragEnter event (and no DragLeave event yet) /*! \return true if this buttom received DragEnter event (and no DragLeave event yet)
* */ * */
bool hasDragAndDropHover() const; bool hasDragAndDropHover() const;
@ -104,6 +105,7 @@ public slots:
protected: protected:
virtual void dragEnterEvent(QDragEnterEvent *event); virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragMoveEvent(QDragMoveEvent * event);
virtual void dragLeaveEvent(QDragLeaveEvent *event); virtual void dragLeaveEvent(QDragLeaveEvent *event);
virtual void dropEvent(QDropEvent *event); virtual void dropEvent(QDropEvent *event);
void mousePressEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event);
@ -134,8 +136,8 @@ private slots:
void activateWithDraggable(); void activateWithDraggable();
signals: signals:
void dropped(QDropEvent * event); void dropped(QString const & mimeWindow, QPoint const & pos);
void dragging(bool executing = false); void dragging(QString const & mimeWindow, QPoint const & pos);
}; };
typedef QHash<WId,LXQtTaskButton*> LXQtTaskButtonHash; typedef QHash<WId,LXQtTaskButton*> LXQtTaskButtonHash;

@ -550,13 +550,12 @@ void LXQtTaskGroup::enterEvent(QEvent *event)
************************************************/ ************************************************/
void LXQtTaskGroup::dragEnterEvent(QDragEnterEvent *event) void LXQtTaskGroup::dragEnterEvent(QDragEnterEvent *event)
{ {
sDraggging = true;
// only show the popup if we aren't dragging a taskgroup // only show the popup if we aren't dragging a taskgroup
if (!event->mimeData()->hasFormat(mimeDataFormat())) if (!event->mimeData()->hasFormat(mimeDataFormat()))
{ {
setPopupVisible(true); setPopupVisible(true);
LXQtTaskButton::dragEnterEvent(event);
} }
LXQtTaskButton::dragEnterEvent(event);
} }
/************************************************ /************************************************
@ -568,8 +567,6 @@ void LXQtTaskGroup::dragLeaveEvent(QDragLeaveEvent *event)
// do not close the popup // do not close the popup
if (!sDraggging) if (!sDraggging)
setPopupVisible(false); setPopupVisible(false);
else
sDraggging = false;
LXQtTaskButton::dragLeaveEvent(event); LXQtTaskButton::dragLeaveEvent(event);
} }

@ -73,8 +73,6 @@ public:
void setPopupVisible(bool visible = true, bool fast = false); void setPopupVisible(bool visible = true, bool fast = false);
static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskgroup"); }
protected: protected:
QMimeData * mimeData(); QMimeData * mimeData();

@ -542,7 +542,7 @@ void ActiveLabel::mouseReleaseEvent(QMouseEvent* event)
} }
LXQtWorldClockPopup::LXQtWorldClockPopup(QWidget *parent) : LXQtWorldClockPopup::LXQtWorldClockPopup(QWidget *parent) :
QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint) QDialog(parent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::Popup | Qt::X11BypassWindowManagerHint)
{ {
setLayout(new QHBoxLayout(this)); setLayout(new QHBoxLayout(this));
layout()->setMargin(1); layout()->setMargin(1);
@ -556,7 +556,7 @@ void LXQtWorldClockPopup::show()
bool LXQtWorldClockPopup::event(QEvent *event) bool LXQtWorldClockPopup::event(QEvent *event)
{ {
if (event->type() == QEvent::WindowDeactivate) if (event->type() == QEvent::Close)
emit deactivated(); emit deactivated();
return QDialog::event(event); return QDialog::event(event);

Loading…
Cancel
Save