fix #31, update submodules

This commit is contained in:
arcan1s 2014-10-01 02:33:10 +04:00
parent 952fa97fcc
commit 0ab74b493c
7 changed files with 30 additions and 19 deletions

View File

@ -1,6 +1,8 @@
Ver.2.0.5:
+ add tooltip bottom (#30)
* fix network interface update
* fix battery tooltip bug
* edit DP layout (#31)
Ver.2.0.4:
* more correct work with batteries

View File

@ -1,6 +1,8 @@
Вер.2.0.5:
+ добавлен нижний край к тултипу (#30)
* исправлен баг с обновлением сетевого интерфейса
* исправлен баг с тултипом батареи
* отредактирована разметка DP (#31)
Вер.2.0.4:
* более корректная работа с батареями

View File

@ -1,4 +1,4 @@
# Maintainer: Evgeniy "arcanis" Alexeev <arcanis.arch at gmail dot com>
# Maintainer: Evgeniy Alekseev <arcanis at archlinux dot org>
pkgname=kdeplasma-applets-awesome-widgets
_pkgname=awesome-widgets

View File

@ -1,9 +1,5 @@
post_install() {
kbuildsycoca4 > /dev/null 2>&1
cat << __EOF
To migrate to version 2.* and newer see this article:
http://arcanis.name/en/2014/09/04/migration-to-v2/
__EOF
}
post_upgrade() {

@ -1 +1 @@
Subproject commit f78c18d38156e8f7dd0d342d9f8779bed8b7f84e
Subproject commit d4e154aa948b82cee2d41b145763ffd9d9ec3ca7

View File

@ -27,8 +27,9 @@
#include <QDebug>
#include <QFile>
#include <QGraphicsGridLayout>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsProxyWidget>
#include <QGraphicsView>
#include <QMouseEvent>
#include <QProcessEnvironment>
#include <QTextCodec>
@ -37,7 +38,7 @@
CustomPlasmaLabel::CustomPlasmaLabel(DesktopPanel *wid, const int num, const bool debugCmd)
: Plasma::Label(wid),
: QLabel(0),
debug(debugCmd),
number(num),
widget(wid)
@ -59,7 +60,7 @@ int CustomPlasmaLabel::getNumber()
}
void CustomPlasmaLabel::mousePressEvent(QGraphicsSceneMouseEvent *event)
void CustomPlasmaLabel::mousePressEvent(QMouseEvent *event)
{
if (debug) qDebug() << PDEBUG;
if (debug) qDebug() << PDEBUG << ":" << "Get signal" << event->button();
@ -183,11 +184,13 @@ void DesktopPanel::reinit()
// clear
// labels
for (int i=0; i<labels.count(); i++) {
layout->removeItem(labels[i]);
for (int i=0; i<proxyWidgets.count(); i++) {
layout->removeItem(proxyWidgets[i]);
delete proxyWidgets[i];
delete labels[i];
}
labels.clear();
proxyWidgets.clear();
// layout
layout = new QGraphicsGridLayout();
layout->setContentsMargins(1, 1, 1, 1);
@ -199,13 +202,18 @@ void DesktopPanel::reinit()
setBackgroundHints(NoBackground);
// labels
for (int i=0; i<desktopNames.count(); i++) {
labels.append(new CustomPlasmaLabel(this, i));
proxyWidgets.append(new QGraphicsProxyWidget(this));
proxyWidgets[i]->setAttribute(Qt::WA_TranslucentBackground, true);
proxyWidgets[i]->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
labels.append(new CustomPlasmaLabel(this, i, debug));
labels[i]->setWordWrap(false);
labels[i]->setAttribute(Qt::WA_NoSystemBackground, true);
labels[i]->setAttribute(Qt::WA_TranslucentBackground, true);
labels[i]->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
proxyWidgets[i]->setWidget(labels[i]);
if (configuration[QString("layout")].toInt() == 0)
layout->addItem(labels[i], 0, i);
layout->addItem(proxyWidgets[i], 0, i);
else
layout->addItem(labels[i], i, 0);
layout->addItem(proxyWidgets[i], i, 0);
}
updateText(true);

View File

@ -21,7 +21,7 @@
#include <Plasma/Applet>
#include <Plasma/DataEngine>
#include <Plasma/Label>
#include <QLabel>
#include <ui_appearance.h>
#include <ui_toggle.h>
@ -29,21 +29,23 @@
class QGraphicsGridLayout;
class QGraphicsProxyWidget;
class DesktopPanel;
class CustomPlasmaLabel : public Plasma::Label
class CustomPlasmaLabel : public QLabel
{
Q_OBJECT
public:
CustomPlasmaLabel(DesktopPanel *wid, const int num,
CustomPlasmaLabel(DesktopPanel *wid,
const int num,
const bool debugCmd = false);
~CustomPlasmaLabel();
int getNumber();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
private:
// debug
@ -89,6 +91,7 @@ private:
void updateText(const bool first = false);
// ui
QGraphicsGridLayout *layout;
QList<QGraphicsProxyWidget *> proxyWidgets;
QList<CustomPlasmaLabel *> labels;
// debug
bool debug;