mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
plasma: add labels for potd wallpaper configuration widgets
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
ef3b17cf74
commit
c6d3f7f04a
6 changed files with 32 additions and 16 deletions
|
@ -349,7 +349,7 @@ void PagerApplet::createConfigurationInterface(KConfigDialog *parent)
|
|||
QGridLayout* widgetlayout = new QGridLayout(widget);
|
||||
QLabel* pagermodelabel = new QLabel(widget);
|
||||
pagermodelabel->setText(i18n("Text:"));
|
||||
widgetlayout->addWidget(pagermodelabel, 0, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(pagermodelabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_pagermodebox = new QComboBox(widget);
|
||||
m_pagermodebox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
|
||||
m_pagermodebox->addItem(i18n("Desktop number"), static_cast<int>(PagerApplet::ShowNumber));
|
||||
|
|
|
@ -833,14 +833,14 @@ void SystemMonitor::createConfigurationInterface(KConfigDialog *parent)
|
|||
QGridLayout* widgetlayout = new QGridLayout(widget);
|
||||
QLabel* hostnamelabel = new QLabel(widget);
|
||||
hostnamelabel->setText(i18n("Hostname:"));
|
||||
widgetlayout->addWidget(hostnamelabel, 0, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(hostnamelabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_hostnameedit = new KLineEdit(widget);
|
||||
m_hostnameedit->setText(m_hostname);
|
||||
widgetlayout->addWidget(m_hostnameedit, 0, 1);
|
||||
|
||||
QLabel* portlabel = new QLabel(widget);
|
||||
portlabel->setText(i18n("Port:"));
|
||||
widgetlayout->addWidget(portlabel, 1, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(portlabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_portbox = new KIntNumInput(widget);
|
||||
m_portbox->setMinimum(s_port);
|
||||
m_portbox->setMaximum(USHRT_MAX);
|
||||
|
@ -850,7 +850,7 @@ void SystemMonitor::createConfigurationInterface(KConfigDialog *parent)
|
|||
|
||||
QLabel* updatelabel = new QLabel(widget);
|
||||
updatelabel->setText(i18n("Update interval:"));
|
||||
widgetlayout->addWidget(updatelabel, 2, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(updatelabel, 2, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_updateedit = new KTimeEdit(widget);
|
||||
m_updateedit->setMinimumTime(QTime(0, 0, 1));
|
||||
m_updateedit->setTime(QTime(0, 0, 0).addSecs(m_update));
|
||||
|
@ -858,7 +858,7 @@ void SystemMonitor::createConfigurationInterface(KConfigDialog *parent)
|
|||
|
||||
QLabel* cpulabel = new QLabel(widget);
|
||||
cpulabel->setText(i18n("CPU color:"));
|
||||
widgetlayout->addWidget(cpulabel, 3, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(cpulabel, 3, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
const QColor defaultcpucolor = kCPUVisualizerColor();
|
||||
QColor cpucolor = m_cpucolor;
|
||||
if (!cpucolor.isValid()) {
|
||||
|
@ -871,7 +871,7 @@ void SystemMonitor::createConfigurationInterface(KConfigDialog *parent)
|
|||
|
||||
QLabel* receiverlabel = new QLabel(widget);
|
||||
receiverlabel->setText(i18n("Receiver color:"));
|
||||
widgetlayout->addWidget(receiverlabel, 4, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(receiverlabel, 4, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
const QColor defaultreceivercolor = kNetReceiverVisualizerColor();
|
||||
QColor receivercolor = m_receivercolor;
|
||||
if (!receivercolor.isValid()) {
|
||||
|
@ -884,7 +884,7 @@ void SystemMonitor::createConfigurationInterface(KConfigDialog *parent)
|
|||
|
||||
QLabel* transmitterlabel = new QLabel(widget);
|
||||
transmitterlabel->setText(i18n("Transmitter color:"));
|
||||
widgetlayout->addWidget(transmitterlabel, 5, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(transmitterlabel, 5, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
const QColor defaulttransmittercolor = kNetTransmitterVisualizerColor();
|
||||
QColor transmittercolor = m_transmittercolor;
|
||||
if (!transmittercolor.isValid()) {
|
||||
|
|
|
@ -371,7 +371,7 @@ void TasksApplet::createConfigurationInterface(KConfigDialog *parent)
|
|||
QGridLayout* widgetlayout = new QGridLayout(widget);
|
||||
QLabel* tooltipmodelabel = new QLabel(widget);
|
||||
tooltipmodelabel->setText(i18n("Tooltip:"));
|
||||
widgetlayout->addWidget(tooltipmodelabel, 0, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(tooltipmodelabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_tooltipmodebox = new QComboBox(widget);
|
||||
m_tooltipmodebox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
|
||||
m_tooltipmodebox->addItem(i18n("Task name"), static_cast<int>(TasksApplet::ToolTipPreview));
|
||||
|
|
|
@ -784,7 +784,7 @@ void WeatherApplet::createConfigurationInterface(KConfigDialog *parent)
|
|||
QGridLayout* widgetlayout = new QGridLayout(widget);
|
||||
QLabel* tempunitlabel = new QLabel(widget);
|
||||
tempunitlabel->setText(i18n("Temperature unit:"));
|
||||
widgetlayout->addWidget(tempunitlabel, 0, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(tempunitlabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_tempunitbox = new QComboBox(widget);
|
||||
m_tempunitbox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
|
||||
for (int i = 0; i < KTemperature::UnitCount; i++) {
|
||||
|
@ -795,7 +795,7 @@ void WeatherApplet::createConfigurationInterface(KConfigDialog *parent)
|
|||
widgetlayout->addWidget(m_tempunitbox, 0, 1);
|
||||
QLabel* locationlabel = new QLabel(widget);
|
||||
locationlabel->setText(i18n("Location:"));
|
||||
widgetlayout->addWidget(locationlabel, 1, 0, Qt::AlignRight);
|
||||
widgetlayout->addWidget(locationlabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_locationbox = new QComboBox(widget);
|
||||
m_locationbox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
|
||||
QMap<QString,QString> sortedzones;
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include <QImageWriter>
|
||||
#include <QFileInfo>
|
||||
#include <QJsonDocument>
|
||||
#include <QHBoxLayout>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <KStandardDirs>
|
||||
#include <KIO/Job>
|
||||
#include <KIO/StoredTransferJob>
|
||||
|
@ -62,7 +63,8 @@ PoTD::PoTD(QObject *parent, const QVariantList &args)
|
|||
m_downloading(false),
|
||||
m_providerbox(nullptr),
|
||||
m_resizemethodbox(nullptr),
|
||||
m_colorbutton(nullptr)
|
||||
m_colorbutton(nullptr),
|
||||
m_spacer(nullptr)
|
||||
{
|
||||
m_timer = new QTimer(this);
|
||||
m_timer->setInterval(10000);
|
||||
|
@ -123,9 +125,12 @@ void PoTD::paint(QPainter *painter, const QRectF &exposedRect)
|
|||
QWidget* PoTD::createConfigurationInterface(QWidget *parent)
|
||||
{
|
||||
QWidget* potdconfigwidget = new QWidget(parent);
|
||||
QHBoxLayout* potdconfiglayout = new QHBoxLayout(potdconfigwidget);
|
||||
QGridLayout* potdconfiglayout = new QGridLayout(potdconfigwidget);
|
||||
potdconfigwidget->setLayout(potdconfiglayout);
|
||||
|
||||
QLabel* providerlabel = new QLabel(potdconfigwidget);
|
||||
providerlabel->setText(i18n("Provider:"));
|
||||
potdconfiglayout->addWidget(providerlabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_providerbox = new QComboBox(potdconfigwidget);
|
||||
m_providerbox->addItem(i18n("Pexels"), "pexels");
|
||||
m_providerbox->addItem(i18n("Flickr"), "flickr");
|
||||
|
@ -139,8 +144,11 @@ QWidget* PoTD::createConfigurationInterface(QWidget *parent)
|
|||
m_providerbox, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(slotProviderChanged(int))
|
||||
);
|
||||
potdconfiglayout->addWidget(m_providerbox);
|
||||
potdconfiglayout->addWidget(m_providerbox, 0, 1);
|
||||
|
||||
QLabel* resizemodelabel = new QLabel(potdconfigwidget);
|
||||
resizemodelabel->setText(i18n("Positioning:"));
|
||||
potdconfiglayout->addWidget(resizemodelabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_resizemethodbox = new QComboBox(potdconfigwidget);
|
||||
m_resizemethodbox->addItem(i18n("Scaled & Cropped"), Plasma::Wallpaper::ResizeMethod::ScaledAndCroppedResize);
|
||||
m_resizemethodbox->addItem(i18n("Scaled"), Plasma::Wallpaper::ResizeMethod::ScaledResize);
|
||||
|
@ -158,12 +166,18 @@ QWidget* PoTD::createConfigurationInterface(QWidget *parent)
|
|||
m_resizemethodbox, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(slotResizeMethodChanged(int))
|
||||
);
|
||||
potdconfiglayout->addWidget(m_resizemethodbox);
|
||||
potdconfiglayout->addWidget(m_resizemethodbox, 1, 1);
|
||||
|
||||
QLabel* colorlabel = new QLabel(potdconfigwidget);
|
||||
colorlabel->setText(i18n("Color:"));
|
||||
potdconfiglayout->addWidget(colorlabel, 2, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_colorbutton = new KColorButton(potdconfigwidget);
|
||||
m_colorbutton->setColor(m_color);
|
||||
connect(m_colorbutton, SIGNAL(changed(QColor)), this, SLOT(slotColorChanged(QColor)));
|
||||
potdconfiglayout->addWidget(m_colorbutton);
|
||||
potdconfiglayout->addWidget(m_colorbutton, 2, 1);
|
||||
|
||||
m_spacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
potdconfiglayout->addItem(m_spacer, 3, 0, 1, 2);
|
||||
|
||||
connect(this, SIGNAL(settingsChanged(bool)), parent, SLOT(settingsChanged(bool)));
|
||||
return potdconfigwidget;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <QColor>
|
||||
#include <QTimer>
|
||||
#include <QComboBox>
|
||||
#include <QSpacerItem>
|
||||
#include <Plasma/Wallpaper>
|
||||
#include <KJob>
|
||||
#include <KColorButton>
|
||||
|
@ -71,6 +72,7 @@ private:
|
|||
QComboBox* m_providerbox;
|
||||
QComboBox* m_resizemethodbox;
|
||||
KColorButton* m_colorbutton;
|
||||
QSpacerItem* m_spacer;
|
||||
};
|
||||
|
||||
K_EXPORT_PLASMA_WALLPAPER(potd, PoTD)
|
||||
|
|
Loading…
Add table
Reference in a new issue