summaryrefslogtreecommitdiffstats
path: root/kcontrol/icons/icons.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-06 21:35:54 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-06 21:35:54 +0000
commit4b06331086ba155155239d9e9a174a2dbc48c899 (patch)
treec203753dbde58faa1f2f07d16f91ab458ba129c0 /kcontrol/icons/icons.cpp
parent09699fd899efc9ba7a1bb1a1b3f3172ef9b6fc19 (diff)
downloadtdebase-4b06331086ba155155239d9e9a174a2dbc48c899.tar.gz
tdebase-4b06331086ba155155239d9e9a174a2dbc48c899.zip
Repaired background update problems on desktop resize/background configuration change
Added initial framework for panel icon size configuration git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1123766 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/icons/icons.cpp')
-rw-r--r--kcontrol/icons/icons.cpp72
1 files changed, 71 insertions, 1 deletions
diff --git a/kcontrol/icons/icons.cpp b/kcontrol/icons/icons.cpp
index 85a72e075..8ad71540e 100644
--- a/kcontrol/icons/icons.cpp
+++ b/kcontrol/icons/icons.cpp
@@ -35,7 +35,7 @@ KIconConfig::KIconConfig(QWidget *parent, const char *name)
: KCModule(parent, name)
{
- QGridLayout *top = new QGridLayout(this, 2, 2,
+ QGridLayout *top = new QGridLayout(this, 4, 2,
KDialog::marginHint(),
KDialog::spacingHint());
top->setColStretch(0, 1);
@@ -95,6 +95,36 @@ KIconConfig::KIconConfig(QWidget *parent, const char *name)
top->activate();
+ KSeparator *panelsep = new KSeparator( KSeparator::HLine, this );
+ top->addMultiCellWidget ( panelsep, 3, 3, 0, 1);
+
+ QGroupBox *gboxpnl = new QGroupBox(i18n("Panel Settings"), this);
+ //top->addMultiCellWidget(gboxpnl, 4, 4, 0, 1);
+ top->addMultiCellWidget(gboxpnl, 4, 4, 0, 0);
+ QGridLayout *gpnl_lay = new QGridLayout(gboxpnl, 3, 3, KDialog::marginHint(), KDialog::spacingHint());
+ gpnl_lay->addRowSpacing(0, fontMetrics().lineSpacing());
+
+ QLabel *lbl2 = new QLabel(i18n("System tray icon size:"), gboxpnl);
+ lbl2->setFixedSize(lbl2->sizeHint());
+ gpnl_lay->addWidget(lbl2, 1, 0, Qt::AlignLeft);
+ mpSysTraySizeBox = new QComboBox(gboxpnl);
+ connect(mpSysTraySizeBox, SIGNAL(activated(int)), SLOT(changed()));
+ lbl2->setBuddy(mpSysTraySizeBox);
+ gpnl_lay->addWidget(mpSysTraySizeBox, 1, 1, Qt::AlignCenter);
+
+ QLabel *lbl3 = new QLabel(i18n("Quick launch icon size:"), gboxpnl);
+ lbl3->setFixedSize(lbl3->sizeHint());
+ gpnl_lay->addWidget(lbl3, 2, 0, Qt::AlignLeft);
+ mpQuickLaunchSizeBox = new QComboBox(gboxpnl);
+ connect(mpQuickLaunchSizeBox, SIGNAL(activated(int)), SLOT(changed()));
+ lbl3->setBuddy(mpQuickLaunchSizeBox);
+ gpnl_lay->addWidget(mpQuickLaunchSizeBox, 2, 1, Qt::AlignCenter);
+
+ mQLSizeLocked = new QCheckBox(i18n("Lock to panel size"), gboxpnl);
+ mQLSizeLocked->setFixedSize(mQLSizeLocked->sizeHint());
+ connect(mQLSizeLocked, SIGNAL(toggled(bool)), SLOT(QLSizeLockedChanged(bool)));
+ gpnl_lay->addWidget(mQLSizeLocked, 2, 2, Qt::AlignRight);
+
init();
read();
apply();
@@ -265,6 +295,39 @@ void KIconConfig::read()
mEffects[i][j].transparant = mpConfig->readBoolEntry(*it2 + "SemiTransparent");
}
}
+
+ mpSysTraySizeBox->clear();
+ mpQuickLaunchSizeBox->clear();
+ mpSysTraySizeBox->insertItem(QString().setNum(16));
+ mpQuickLaunchSizeBox->insertItem(QString().setNum(16));
+ mpSysTraySizeBox->insertItem(QString().setNum(22));
+ mpQuickLaunchSizeBox->insertItem(QString().setNum(22));
+ mpSysTraySizeBox->insertItem(QString().setNum(32));
+ mpQuickLaunchSizeBox->insertItem(QString().setNum(32));
+ mpSysTraySizeBox->insertItem(QString().setNum(48));
+ mpQuickLaunchSizeBox->insertItem(QString().setNum(48));
+ mpSysTraySizeBox->insertItem(QString().setNum(64));
+ mpQuickLaunchSizeBox->insertItem(QString().setNum(64));
+
+ // FIXME
+ // For now, disable mpQuickLaunchSizeBox as the required backend code does not exist yet
+ // This will change in the near future however
+ mpQuickLaunchSizeBox->setEnabled(false);
+ mQLSizeLocked->setEnabled(false);
+ mQLSizeLocked->setChecked(true);
+
+ // FIXME
+ // Due to issues with the system tray handling code, mpSysTraySizeBox also needs to be disabled
+ // This should be fixed ASAP
+ mpSysTraySizeBox->setEnabled(false);
+
+ mpConfig->setGroup("System Tray");
+ mSysTraySize = mpConfig->readNumEntry("systrayIconWidth", 22);
+ for (i=0;i<(mpSysTraySizeBox->count());i++) {
+ if (mpSysTraySizeBox->text(i) == QString().setNum(mSysTraySize)) {
+ mpSysTraySizeBox->setCurrentItem(i);
+ }
+ }
}
void KIconConfig::apply()
@@ -387,6 +450,9 @@ void KIconConfig::save()
}
}
+ mpConfig->setGroup("System Tray");
+ mpConfig->writeEntry("systrayIconWidth", mpSysTraySizeBox->currentText());
+
mpConfig->sync();
emit changed(false);
@@ -407,6 +473,10 @@ void KIconConfig::defaults()
load( true );
}
+void KIconConfig::QLSizeLockedChanged(bool checked) {
+ emit changed();
+}
+
void KIconConfig::slotUsage(int index)
{
mUsage = index;