summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--kcontrol/background/bgdialog.cpp2
-rw-r--r--kcontrol/icons/icons.cpp72
-rw-r--r--kcontrol/icons/icons.h6
-rw-r--r--kdesktop/bgmanager.cc21
4 files changed, 96 insertions, 5 deletions
diff --git a/kcontrol/background/bgdialog.cpp b/kcontrol/background/bgdialog.cpp
index 34cff9f53..6a7e44234 100644
--- a/kcontrol/background/bgdialog.cpp
+++ b/kcontrol/background/bgdialog.cpp
@@ -98,7 +98,6 @@ BGDialog::BGDialog(QWidget* parent, KConfig* _config, bool _multidesktop)
delete m_kwin;
m_desk = m_multidesktop ? KWin::currentDesktop() : 1;
- //m_desk = m_multidesktop ? (m_useViewports ? (m_desk * m_numViewports) : m_desk) : m_desk;
m_desk = m_multidesktop ? (m_useViewports ? (((m_desk - 1) * m_numViewports) + t_eViewport) : m_desk) : m_desk;
m_numDesks = m_multidesktop ? (m_useViewports ? (m_numDesks * m_numViewports) : m_numDesks) : m_numDesks;
@@ -320,7 +319,6 @@ void BGDialog::load( bool useDefaults )
for (unsigned screen = 0; screen < m_renderer[desk].size(); ++screen)
{
unsigned eScreen = screen>1 ? screen-2 : 0;
-// m_renderer[desk][screen]->load( eDesk, eScreen, (screen>0) );
m_renderer[desk][screen]->load( eDesk, eScreen, (screen>0), useDefaults );
}
}
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;
diff --git a/kcontrol/icons/icons.h b/kcontrol/icons/icons.h
index 93171f6d1..b1f167066 100644
--- a/kcontrol/icons/icons.h
+++ b/kcontrol/icons/icons.h
@@ -75,6 +75,7 @@ private slots:
void slotSize(int index);
void slotDPCheck(bool check);
void slotAnimatedCheck(bool check);
+ void QLSizeLockedChanged(bool checked);
private:
void preview(int i);
@@ -96,6 +97,8 @@ private:
int mUsage;
QString mTheme, mExample;
QStringList mGroups, mStates;
+ int mSysTraySize;
+ int mQuickLaunchSize;
KIconEffect *mpEffect;
KIconTheme *mpTheme;
@@ -107,6 +110,9 @@ private:
QListBox *mpUsageList;
QComboBox *mpSizeBox;
+ QComboBox *mpSysTraySizeBox;
+ QComboBox *mpQuickLaunchSizeBox;
+ QCheckBox *mQLSizeLocked;
QCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck;
QTabWidget *m_pTabWidget;
QWidget *m_pTab1;
diff --git a/kdesktop/bgmanager.cc b/kdesktop/bgmanager.cc
index 7a9fe5fd5..c3317708c 100644
--- a/kdesktop/bgmanager.cc
+++ b/kdesktop/bgmanager.cc
@@ -243,6 +243,16 @@ void KBackgroundManager::configure()
// Repaint desktop
slotChangeDesktop(0);
+
+ // Redraw all desktops so that applications relying on exported data, e.g. kpager, continue to work properly
+ QSize s(m_pKwinmodule->numberOfViewports(m_pKwinmodule->currentDesktop()));
+ m_numberOfViewports = s.width() * s.height();
+ if (m_numberOfViewports < 1) {
+ m_numberOfViewports = 1;
+ }
+ for (unsigned j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) {
+ renderBackground(j);
+ }
}
@@ -947,8 +957,15 @@ void KBackgroundManager::desktopResized()
slotChangeDesktop(0);
repaintBackground();
- // Signal KWin that the usable desktop area has probably changed...
- // Use the DCOP signal kDestopResized
+ // Redraw all desktops so that applications relying on exported data, e.g. kpager, continue to work properly
+ QSize s(m_pKwinmodule->numberOfViewports(m_pKwinmodule->currentDesktop()));
+ m_numberOfViewports = s.width() * s.height();
+ if (m_numberOfViewports < 1) {
+ m_numberOfViewports = 1;
+ }
+ for (unsigned j=0;j<(m_pKwinmodule->numberOfDesktops() * m_numberOfViewports);j++) {
+ renderBackground(j);
+ }
}
// DCOP exported