diff --git a/CHANGELOG b/CHANGELOG index dee759d..da39c75 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ Ver.2.0.2: - remove ps stats from notification * yet another fix cpu* and cpucl* * rewrite DP configuration interface +* fix non-standard temp units Ver.2.0.1: + add support of custom interfaces diff --git a/CHANGELOG-RU b/CHANGELOG-RU index 94e1fa1..61ae472 100644 --- a/CHANGELOG-RU +++ b/CHANGELOG-RU @@ -4,6 +4,7 @@ - удалено ps stats из уведомлений * еще один фикс тегов cpu* и cpucl * переписан конфигурационный интерфейс DP +* исправлены нестандартные единицы температуры Вер.2.0.1: + добавлена поддержка кастомных интерфейсов diff --git a/sources/awesome-widget/configuration.cpp b/sources/awesome-widget/configuration.cpp index ab51e56..14ce72a 100644 --- a/sources/awesome-widget/configuration.cpp +++ b/sources/awesome-widget/configuration.cpp @@ -768,9 +768,9 @@ void AwesomeWidget::setFontFormating() false, false); if (font != defaultFont) { QString selectedText = uiWidConfig.textEdit_elements->textCursor().selectedText(); - uiWidConfig.textEdit_elements->insertPlainText(QString("") + uiWidConfig.textEdit_elements->insertPlainText(QString("") .arg(font.color().name()).arg(font.family()).arg(font.pointSize()) + - selectedText + QString("")); + selectedText + QString("")); } } diff --git a/sources/desktop-panel/desktop-panel.cpp b/sources/desktop-panel/desktop-panel.cpp index 6443746..2fccb17 100644 --- a/sources/desktop-panel/desktop-panel.cpp +++ b/sources/desktop-panel/desktop-panel.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -106,7 +106,7 @@ void DesktopPanel::init() extsysmonEngine = dataEngine(QString("ext-sysmon")); - layout = new QGraphicsLinearLayout(); + layout = new QGraphicsGridLayout(); layout->setContentsMargins(1, 1, 1, 1); setLayout(layout); @@ -192,7 +192,7 @@ void DesktopPanel::reinit() } labels.clear(); // layout - layout = new QGraphicsLinearLayout(); + layout = new QGraphicsGridLayout(); layout->setContentsMargins(1, 1, 1, 1); setLayout(layout); @@ -200,25 +200,18 @@ void DesktopPanel::reinit() // layout if (configuration[QString("background")].toInt() == 0) setBackgroundHints(NoBackground); - if (configuration[QString("layout")].toInt() == 0) - layout->setOrientation(Qt::Horizontal); - else - layout->setOrientation(Qt::Vertical); - // left stretch - if (configuration[QString("leftStretch")].toInt() == 2) - layout->addStretch(1); // labels for (int i=0; isetWordWrap(false); - qDebug() << labels[i]->styleSheet(); - layout->addItem(labels[i]); + if (configuration[QString("layout")].toInt() == 0) + layout->addItem(labels[i], 0, i); + else + layout->addItem(labels[i], i, 0); } - // right stretch - if (configuration[QString("rightStretch")].toInt() == 2) - layout->addStretch(1); - updateText(); + updateText(true); +// layout->updateGeometry(); resize(10, 10); } @@ -264,15 +257,17 @@ void DesktopPanel::setCurrentDesktop(const int number) } -void DesktopPanel::updateText() +void DesktopPanel::updateText(const bool first) { if (debug) qDebug() << PDEBUG; - if (labels.isEmpty()) return; QString line, text; for (int i=0; isetCheckState(Qt::Unchecked); else uiWidConfig.checkBox_layout->setCheckState(Qt::Checked); - if (configuration[QString("leftStretch")].toInt() == 0) - uiWidConfig.checkBox_leftStretch->setCheckState(Qt::Unchecked); - else - uiWidConfig.checkBox_leftStretch->setCheckState(Qt::Checked); - if (configuration[QString("rightStretch")].toInt() == 0) - uiWidConfig.checkBox_rightStretch->setCheckState(Qt::Unchecked); - else - uiWidConfig.checkBox_rightStretch->setCheckState(Qt::Checked); uiWidConfig.spinBox_interval->setValue(configuration[QString("interval")].toInt()); uiWidConfig.comboBox_mark->setItemText(uiWidConfig.comboBox_mark->count()-1, configuration[QString("mark")]); uiWidConfig.comboBox_mark->setCurrentIndex(uiWidConfig.comboBox_mark->count()-1); @@ -408,8 +395,6 @@ void DesktopPanel::configAccepted() cg.writeEntry("pattern", uiWidConfig.textEdit_elements->toPlainText()); cg.writeEntry("background", QString::number(uiWidConfig.checkBox_background->checkState())); cg.writeEntry("layout", QString::number(uiWidConfig.checkBox_layout->checkState())); - cg.writeEntry("leftStretch", QString::number(uiWidConfig.checkBox_leftStretch->checkState())); - cg.writeEntry("rightStretch", QString::number(uiWidConfig.checkBox_rightStretch->checkState())); cg.writeEntry("interval", QString::number(uiWidConfig.spinBox_interval->value())); cg.writeEntry("mark", uiWidConfig.comboBox_mark->currentText()); cg.writeEntry("desktopcmd", uiWidConfig.lineEdit_desktopcmd->text()); @@ -448,10 +433,8 @@ void DesktopPanel::configChanged() configuration[QString("desktopcmd")] = cg.readEntry("desktopcmd", "qdbus org.kde.kwin /KWin setCurrentDesktop $number"); configuration[QString("interval")] = cg.readEntry("interval", "1000"); configuration[QString("layout")] = cg.readEntry("layout", "0"); - configuration[QString("leftStretch")] = cg.readEntry("leftStretch", "2"); configuration[QString("mark")] = cg.readEntry("mark", "¤"); configuration[QString("panels")] = cg.readEntry("panels", "-1"); - configuration[QString("rightStretch")] = cg.readEntry("rightStretch", "2"); extsysmonEngine->connectSource(QString("desktop"), this, configuration[QString("interval")].toInt()); @@ -506,9 +489,9 @@ void DesktopPanel::setFontFormating() CFont font = CFontDialog::getFont(i18n("Select font"), defaultFont, false, false); QString selectedText = uiWidConfig.textEdit_elements->textCursor().selectedText(); - uiWidConfig.textEdit_elements->insertPlainText(QString("") + uiWidConfig.textEdit_elements->insertPlainText(QString("") .arg(font.color().name()).arg(font.family()).arg(font.pointSize()) + - selectedText + QString("")); + selectedText + QString("")); } diff --git a/sources/desktop-panel/desktop-panel.h b/sources/desktop-panel/desktop-panel.h index 39128c3..a2bc5bf 100644 --- a/sources/desktop-panel/desktop-panel.h +++ b/sources/desktop-panel/desktop-panel.h @@ -28,7 +28,7 @@ #include -class QGraphicsLinearLayout; +class QGraphicsGridLayout; class DesktopPanel; @@ -86,9 +86,9 @@ private: // functions QList getPanels(); QString panelLocationToStr(Plasma::Location loc); - void updateText(); + void updateText(const bool first = false); // ui - QGraphicsLinearLayout *layout; + QGraphicsGridLayout *layout; QList labels; // debug bool debug; diff --git a/sources/desktop-panel/widget.ui b/sources/desktop-panel/widget.ui index 138a8bf..2fe3faf 100644 --- a/sources/desktop-panel/widget.ui +++ b/sources/desktop-panel/widget.ui @@ -20,7 +20,7 @@ Widget - + @@ -75,13 +75,6 @@ - - - - Add stretch to left/top of the layout - - - @@ -89,7 +82,7 @@ - + @@ -186,13 +179,6 @@ - - - - Add stretch to right/bottom of the layout - - - @@ -200,7 +186,7 @@ - +