Remove the obsolete Translucency config module

svn path=/trunk/KDE/kdebase/workspace/; revision=690346
This commit is contained in:
Rivo Laks 2007-07-20 19:11:20 +00:00
parent 5d21a58b44
commit e96e352513
6 changed files with 1 additions and 667 deletions

View file

@ -19,7 +19,7 @@ install(TARGETS kcm_kwinoptions DESTINATION ${PLUGIN_INSTALL_DIR} )
########### install files ###############
install( FILES kwinoptions.desktop kwinactions.desktop kwinadvanced.desktop
kwinfocus.desktop kwinmoving.desktop kwintranslucency.desktop
kwinfocus.desktop kwinmoving.desktop
DESTINATION ${SERVICES_INSTALL_DIR})
kde4_install_icons( ${ICON_INSTALL_DIR} )

View file

@ -1,163 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Icon=kcmkwm
Type=Service
ServiceTypes=KCModule
Exec=kcmshell kwintranslucency
DocPath=kcontrol/windowmanagement/index.html#action-translucency
X-KDE-Library=kwinoptions
X-KDE-FactoryName=kwintranslucency
Name=Translucency
Name[af]=Deursigtigheid
Name[be]=Празрыстасць
Name[br]=Treuzwel
Name[ca]=Translucidesa
Name[cs]=Průhlednost
Name[csb]=Przezérnota
Name[da]=Gennemsigtighed
Name[de]=Transparenz
Name[el]=Hμιδιαφάνεια
Name[eo]=Travidebleco
Name[es]=Translúcido
Name[et]=Läbipaistvus
Name[eu]=Gardentasuna
Name[fa]=نیمۀ شفافی
Name[fi]=Läpikuultavuus
Name[fr]=Transparence
Name[fy]=Trochsichtichheid
Name[ga]=Tréshoilseacht
Name[gl]=Translucidez
Name[he]=שקיפות
Name[hr]=Prozirnost
Name[hu]=Áttetszőség
Name[is]=Gegnsæi
Name[it]=Trasparenza
Name[ja]=
Name[ka]=
Name[kk]=Мөлдірлігі
Name[km]=
Name[lt]=Permatomumas
Name[mk]=Провидност
Name[nb]=Gjennomsiktighet
Name[nds]=Dörschienen
Name[ne]=
Name[nl]=Transparantie
Name[nn]=Gjennomsynleg
Name[pa]=
Name[pl]=Przezroczystość
Name[pt]=Transparência
Name[pt_BR]=Translúcido
Name[ro]=Translucenţă
Name[ru]=Полупрозрачность
Name[se]=Čađačuovgi
Name[sl]=Prosojnost
Name[sr]=Прозирност
Name[sr@latin]=Prozirnost
Name[sv]=Genomskinlighet
Name[ta]=ிி
Name[tr]=Şeffaflık
Name[uk]=Прозорість
Name[uz]=Шаффофлик
Name[x-test]=xxTranslucencyxx
Name[zh_TW]=
Comment=Configure window translucency and shadow management
Comment[af]=Stel die venster deursigtigheid en skaduwee op
Comment[be]=Настаўленні празрыстасці вокнаў і кіраванне ценем
Comment[ca]=Configura la translucidesa de finestres i gestiona l'ombra
Comment[cs]=Nastavení průhlednosti a stínování oken
Comment[csb]=Kònfigùracëjô przezérnotë ë ceniów òknów
Comment[da]=Indstil vinduets gennemsigtighed og skyggehåndtering
Comment[de]=Einrichtung der Fenstertransparenz und Schatten
Comment[el]=Ρύθμιση ημιδιαφάνειας παραθύρου και διαχείρισης σκίασης
Comment[eo]=Agordu administradon de fenestro-travidebleco kaj ombreco.
Comment[es]=Configurar la opacidad de la ventana y gestión de sombra
Comment[et]=Akende läbipaistvuse ja varjude seadistamine
Comment[eu]=Konfiguratu leiho gardentasunak eta itzalen kudeaketa
Comment[fa]=پیکربندی مدیریت نیمۀ شفافی و سایۀ پنجره
Comment[fi]=Muokkaa ikkunoinnin läpikuultavuus ja varjostus
Comment[fr]=Configuration de la transparence et de l'ombre des fenêtres
Comment[fy]=Finstertrochsichtichheid- en -skaadbehear ynstelle
Comment[ga]=Cumraigh tréshoilseacht na fuinneoige agus bainisteoireacht scátha
Comment[gl]=Configurar a xestión de sombras e translucidez das fiestras
Comment[he]=תצורה של שקיפות החלונות וניהול ההצללות
Comment[hr]=Konfiguriranje prozirnosti prozora i upravljanje sjenčanjem
Comment[hu]=Az ablakkezelés áttetszőségi és árnyékolási beállításai
Comment[is]=Stilla gegnsæi glugga og sýsla með skugga
Comment[it]=Configura la trasparenza e le ombre delle finestre
Comment[ja]=
Comment[ka]=
Comment[kk]=Терезенің мөлдірлігін және көлеңкесін баптау
Comment[km]=
Comment[lt]=Konfigūruoti langų permatomumą ir šešėlius
Comment[mk]=Конфигурирајте ги провидноста на прозорците и менаџментот на сенки
Comment[nb]=Tilpass behandling av vindusgjennomsiktighet og -skygge
Comment[nds]=Finsterdörschienen un -Schadden instellen
Comment[ne]= ि
Comment[nl]=Venstertransparantie- en -schaduwbeheer instellen
Comment[nn]=Oppsett av gjennomsiktige vindauge og vindaugsskugge
Comment[pa]=
Comment[pl]=Konfiguracja przezroczystości i cieni okien
Comment[pt]=Configuração da transparência e sombras de janelas
Comment[pt_BR]=Configura o gerenciamento de sombra e transparência da janela
Comment[ro]=Configurează translucenţa şi umbra ferestrelor
Comment[ru]=Настройка полупрозрачности и теней окна
Comment[se]=Heivet lášečađačuovgivuođa ja suoivvanasgieđaheami
Comment[sl]=Nastavitve prosojnosti oken in upravljanje s sencami
Comment[sr]=Подешавање прозирности прозора и управљање сенкама
Comment[sr@latin]=Podešavanje prozirnosti prozora i upravljanje senkama
Comment[sv]=Anpassa fönstergenomskinlighet och skugghantering
Comment[ta]= ிி ி ி
Comment[tr]=Pencere şeffaflığını ve gölge yönetimini yapılandır
Comment[uk]=Налаштування прозорості вікон та керування затіненням
Comment[uz]=Ойнанинг шаффофлигини ва соясини мослаш
Comment[x-test]=xxConfigure window translucency and shadow managementxx
Comment[zh_TW]=
Keywords=translucency,transparence,shadows
Keywords[be]=Празрыстасць,Цені,translucency,transparence,shadows
Keywords[ca]=translucidesa,transparència,ombres
Keywords[cs]=průhlednost,průsvitnost,stín
Keywords[csb]=przezérnota,półprzezérnota,przeswiécëna,ceniô,cenie
Keywords[da]=gennemsigtighed,transparens,skygge
Keywords[el]=ημιδιαφάνεια,διαφάνεια,σκιές
Keywords[eo]=Tavidebleco, ombroj
Keywords[es]=translucido,transparente,sombras,opacidad
Keywords[et]=läbipaistvus,läbipaistev,vari
Keywords[eu]=gardena,gardentasunak,itzalak
Keywords[fa]=نیمۀ شفافی، شفافیت، سایهها
Keywords[fi]=läpikuultavuus, läpinäkyvyys, varjot
Keywords[fr]=translucidité,translucide,transparence,transparent,ombre
Keywords[fy]=translucency,trochsichtich,ransparantie,schaduwen,skaden
Keywords[ga]=tréshoilseacht,gléine,scáthanna
Keywords[gl]=translucéncia,transparéncia,sombras
Keywords[he]=translucency,transparence,shadows,הצללה,צל,צללים,שקוף,שקיפות
Keywords[hr]=translucency,transparence,shadows,prozirnost,sjene,providnost
Keywords[hu]=áttetszőség,áttetsző,árnyékok
Keywords[it]=trasparenza,ombre
Keywords[ja]=,,
Keywords[km]=,,
Keywords[lt]=translucency,transparence,shadows,permatomumas,šešėliai
Keywords[mk]=translucency,transparence,shadows,провидност,проѕирност,сенки
Keywords[nb]=gjennomsiktighet,skygge
Keywords[nds]=Transparenz,Schadden,Dörschienen
Keywords[ne]=,,
Keywords[nl]=translucency,transparantie,schaduwen
Keywords[nn]=gjennomsiktig,skugge
Keywords[pa]=translucency,transparence,
Keywords[pl]=przezroczystość,półprzezroczystość,prześwitywanie,cień,cienie
Keywords[pt]=translucidez,transparência,sombras
Keywords[pt_BR]=translúcido,transparência,sombras
Keywords[ro]=translucenţă,transparenţă,umbre
Keywords[sl]=prosojnost,prozornost,sence
Keywords[sr]=translucency,transparence,shadows,провидност,сенке
Keywords[sr@latin]=translucency,transparence,shadows,providnost,senke
Keywords[sv]=genomskinlighet,skuggor
Keywords[ta]=ிி,,ி
Keywords[tr]=şeffaflık,şeffaf,gölge,opak,opasite
Keywords[uk]=translucency,transparence,shadows,прозорість,напівпрозорість,тіні
Keywords[uz]=шаффоф,соя
Keywords[x-test]=xxtranslucency,transparence,shadowsxx
Keywords[zh_TW]=translucency,transparence,shadows,,

View file

@ -74,16 +74,6 @@ class KAdvancedConfigStandalone : public KAdvancedConfig
typedef KGenericFactory<KAdvancedConfigStandalone> KAdvancedConfigFactory;
K_EXPORT_COMPONENT_FACTORY(kwinadvanced, KAdvancedConfigFactory)
class KTranslucencyConfigStandalone : public KTranslucencyConfig
{
public:
KTranslucencyConfigStandalone(QWidget* parent, const QStringList &)
: KTranslucencyConfig(true, new KConfig("kwinrc"), inst(), parent)
{}
};
typedef KGenericFactory<KTranslucencyConfigStandalone> KTranslucencyConfigFactory;
K_EXPORT_COMPONENT_FACTORY(kwintranslucency, KTranslucencyConfigFactory)
typedef KGenericFactory<KWinOptions> KWinOptionsFactory;
K_EXPORT_COMPONENT_FACTORY(kwinoptions, KWinOptionsFactory)
@ -127,12 +117,6 @@ KWinOptions::KWinOptions(QWidget *parent, const QStringList &)
tab->addTab(mAdvanced, i18n("Ad&vanced"));
connect(mAdvanced, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mTranslucency = new KTranslucencyConfig(false, mConfig, componentData(), this);
mTranslucency->setObjectName("KWin Translucency");
mTranslucency->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mTranslucency, i18n("&Translucency"));
connect(mTranslucency, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
KAboutData *about =
new KAboutData(I18N_NOOP("kcmkwinoptions"), 0, ki18n("Window Behavior Configuration Module"),
0, KLocalizedString(), KAboutData::License_GPL,
@ -163,7 +147,6 @@ void KWinOptions::load()
mWindowActions->load();
mMoving->load();
mAdvanced->load();
mTranslucency->load();
emit KCModule::changed( false );
}
@ -175,7 +158,6 @@ void KWinOptions::save()
mWindowActions->save();
mMoving->save();
mAdvanced->save();
mTranslucency->save();
emit KCModule::changed( false );
// Send signal to kwin
@ -196,7 +178,6 @@ void KWinOptions::defaults()
mWindowActions->defaults();
mMoving->defaults();
mAdvanced->defaults();
mTranslucency->defaults();
}
QString KWinOptions::quickHelp() const

View file

@ -33,7 +33,6 @@ class KFocusConfig;
class KTitleBarActionsConfig;
class KWindowActionsConfig;
class KAdvancedConfig;
class KTranslucencyConfig;
class QStringList;
class KWinOptions : public KCModule
@ -65,7 +64,6 @@ private:
KWindowActionsConfig *mWindowActions;
KMovingConfig *mMoving;
KAdvancedConfig *mAdvanced;
KTranslucencyConfig *mTranslucency;
KConfig *mConfig;
};

View file

@ -1279,432 +1279,4 @@ void KMovingConfig::setWindowSnapZone(int pxls) {
WndwSnap->setValue(pxls);
}
KTranslucencyConfig::~KTranslucencyConfig ()
{
if (standAlone)
delete config;
if (kompmgr)
kompmgr->detach();
}
KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, const KComponentData &inst, QWidget *parent)
: KCModule(inst, parent), config(_config), standAlone(_standAlone)
{
kompmgr = 0L;
resetKompmgr_ = false;
QVBoxLayout *lay = new QVBoxLayout (this);
kompmgrAvailable_ = kompmgrAvailable();
if (!kompmgrAvailable_){
QLabel *label = new QLabel(i18n("<qt><b>It seems that alpha channel support is not available.</b><br><br>"
"Please make sure you have "
"<a href=\"http://www.freedesktop.org/\">Xorg &ge; 6.8</a>,"
" and have installed the kompmgr that came with kwin.<br>"
"Also, make sure you have the following entries in your XConfig (e.g. /etc/X11/xorg.conf):<br><br>"
"<i>Section \"Extensions\"<br>"
"Option \"Composite\" \"Enable\"<br>"
"EndSection</i><br><br>"
"And if your GPU provides hardware-accelerated Xrender support (mainly nVidia cards):<br><br>"
"<i>Option \"RenderAccel\" \"true\"</i><br>"
"In <i>Section \"Device\"</i></qt>"), this);
label->setOpenExternalLinks(true);
label->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
lay->addWidget(label);
}
else
{
QTabWidget *tabW = new QTabWidget(this);
QWidget *tGroup = new QWidget(tabW);
QVBoxLayout *vLay = new QVBoxLayout (tGroup);
vLay->setMargin(KDialog::marginHint());
vLay->setSpacing(KDialog::spacingHint());
vLay->addSpacing(11); // to get the proper gb top offset
onlyDecoTranslucent = new QCheckBox(i18n("Apply translucency only to decoration"),tGroup);
vLay->addWidget(onlyDecoTranslucent);
vLay->addSpacing(11);
QGridLayout *gLay = new QGridLayout();
gLay->setSpacing(KDialog::spacingHint());
gLay->setColumnStretch(1,1);
vLay->addLayout( gLay );
activeWindowTransparency = new QCheckBox(i18n("Active windows:"),tGroup);
gLay->addWidget(activeWindowTransparency,0,0);
activeWindowOpacity = new KIntNumInput(100, tGroup);
activeWindowOpacity->setRange(0,100);
activeWindowOpacity->setSuffix("%");
gLay->addWidget(activeWindowOpacity,0,1);
inactiveWindowTransparency = new QCheckBox(i18n("Inactive windows:"),tGroup);
gLay->addWidget(inactiveWindowTransparency,1,0);
inactiveWindowOpacity = new KIntNumInput(100, tGroup);
inactiveWindowOpacity->setRange(0,100);
inactiveWindowOpacity->setSuffix("%");
gLay->addWidget(inactiveWindowOpacity,1,1);
movingWindowTransparency = new QCheckBox(i18n("Moving windows:"),tGroup);
gLay->addWidget(movingWindowTransparency,2,0);
movingWindowOpacity = new KIntNumInput(100, tGroup);
movingWindowOpacity->setRange(0,100);
movingWindowOpacity->setSuffix("%");
gLay->addWidget(movingWindowOpacity,2,1);
dockWindowTransparency = new QCheckBox(i18n("Dock windows:"),tGroup);
gLay->addWidget(dockWindowTransparency,3,0);
dockWindowOpacity = new KIntNumInput(100, tGroup);
dockWindowOpacity->setRange(0,100);
dockWindowOpacity->setSuffix("%");
gLay->addWidget(dockWindowOpacity,3,1);
vLay->addSpacing(11);
keepAboveAsActive = new QCheckBox(i18n("Treat 'keep above' windows as active ones"),tGroup);
vLay->addWidget(keepAboveAsActive);
disableARGB = new QCheckBox(i18n("Disable ARGB windows (ignores window alpha maps, fixes gtk1 apps)"),tGroup);
vLay->addWidget(disableARGB);
vLay->addStretch();
tabW->addTab(tGroup, i18n("Opacity"));
QWidget *sGroup = new QWidget(tabW);
// sGroup->setCheckable(true);
QVBoxLayout *vLay2 = new QVBoxLayout (sGroup);
vLay2->setMargin(11);
vLay2->setSpacing(6);
vLay2->addSpacing(11); // to get the proper gb top offset
useShadows = new QCheckBox(i18n("Use shadows"),sGroup);
vLay2->addWidget(useShadows);
vLay2->addSpacing(11);
QGridLayout *gLay2 = new QGridLayout();
gLay2->setColumnStretch(1,1);
vLay2->addLayout( gLay2 );
QLabel *label1 = new QLabel(i18n("Active window size:"),sGroup);
gLay2->addWidget(label1,0,0);
activeWindowShadowSize = new KIntNumInput(12,sGroup);
activeWindowShadowSize->setRange(0,32);
// activeWindowShadowSize->setSuffix("px");
gLay2->addWidget(activeWindowShadowSize,0,1);
QLabel *label2 = new QLabel(i18n("Inactive window size:"),sGroup);
gLay2->addWidget(label2,1,0);
inactiveWindowShadowSize = new KIntNumInput(6,sGroup);
inactiveWindowShadowSize->setRange(0,32);
// inactiveWindowShadowSize->setSuffix("px");
gLay2->addWidget(inactiveWindowShadowSize,1,1);
QLabel *label3 = new QLabel(i18n("Dock window size:"),sGroup);
gLay2->addWidget(label3,2,0);
dockWindowShadowSize = new KIntNumInput(6,sGroup);
dockWindowShadowSize->setRange(0,32);
// dockWindowShadowSize->setSuffix("px");
gLay2->addWidget(dockWindowShadowSize,2,1);
QLabel *label4 = new QLabel(i18n("Vertical offset:"),sGroup);
gLay2->addWidget(label4,3,0);
shadowTopOffset = new KIntNumInput(80,sGroup);
shadowTopOffset->setSuffix("%");
shadowTopOffset->setRange(-200,200);
gLay2->addWidget(shadowTopOffset,3,1);
QLabel *label5 = new QLabel(i18n("Horizontal offset:"),sGroup);
gLay2->addWidget(label5,4,0);
shadowLeftOffset = new KIntNumInput(0,sGroup);
shadowLeftOffset->setSuffix("%");
shadowLeftOffset->setRange(-200,200);
gLay2->addWidget(shadowLeftOffset,4,1);
QLabel *label6 = new QLabel(i18n("Shadow color:"),sGroup);
gLay2->addWidget(label6,5,0);
shadowColor = new KColorButton(Qt::black,sGroup);
gLay2->addWidget(shadowColor,5,1);
gLay2->setColumnStretch(1,1);
vLay2->addSpacing(11);
removeShadowsOnMove = new QCheckBox(i18n("Remove shadows on move"),sGroup);
vLay2->addWidget(removeShadowsOnMove);
removeShadowsOnResize = new QCheckBox(i18n("Remove shadows on resize"),sGroup);
vLay2->addWidget(removeShadowsOnResize);
vLay2->addStretch();
tabW->addTab(sGroup, i18n("Shadows"));
QWidget *eGroup = new QWidget(this);
QVBoxLayout *vLay3 = new QVBoxLayout (eGroup);
vLay3->setMargin( 11 );
vLay3->setSpacing( 6 );
fadeInWindows = new QCheckBox(i18n("Fade-in windows (including popups)"),eGroup);
fadeOnOpacityChange = new QCheckBox(i18n("Fade between opacity changes"),eGroup);
fadeInSpeed = new KIntNumInput(100, eGroup);
fadeInSpeed->setRange(1,100);
fadeInSpeed->setLabel("Fade-in speed:");
fadeOutSpeed = new KIntNumInput(100, eGroup);
fadeOutSpeed->setRange(1,100);
fadeOutSpeed->setLabel("Fade-out speed:");
vLay3->addWidget(fadeInWindows);
vLay3->addWidget(fadeOnOpacityChange);
vLay3->addWidget(fadeInSpeed);
vLay3->addWidget(fadeOutSpeed);
vLay3->addStretch();
tabW->addTab(eGroup, i18n("Effects"));
useTranslucency = new QCheckBox(i18n("Use translucency/shadows"),this);
lay->addWidget(useTranslucency);
lay->addWidget(tabW);
connect(useTranslucency, SIGNAL(toggled(bool)), tabW, SLOT(setEnabled(bool)));
connect(activeWindowTransparency, SIGNAL(toggled(bool)), activeWindowOpacity, SLOT(setEnabled(bool)));
connect(inactiveWindowTransparency, SIGNAL(toggled(bool)), inactiveWindowOpacity, SLOT(setEnabled(bool)));
connect(movingWindowTransparency, SIGNAL(toggled(bool)), movingWindowOpacity, SLOT(setEnabled(bool)));
connect(dockWindowTransparency, SIGNAL(toggled(bool)), dockWindowOpacity, SLOT(setEnabled(bool)));
connect(useTranslucency, SIGNAL(toggled(bool)), SLOT(changed()));
connect(onlyDecoTranslucent, SIGNAL(toggled(bool)), SLOT(changed()));
connect(activeWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
connect(inactiveWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
connect(movingWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
connect(dockWindowTransparency, SIGNAL(toggled(bool)), SLOT(changed()));
connect(keepAboveAsActive, SIGNAL(toggled(bool)), SLOT(changed()));
connect(disableARGB, SIGNAL(toggled(bool)), SLOT(changed()));
connect(useShadows, SIGNAL(toggled(bool)), SLOT(changed()));
connect(removeShadowsOnResize, SIGNAL(toggled(bool)), SLOT(changed()));
connect(removeShadowsOnMove, SIGNAL(toggled(bool)), SLOT(changed()));
connect(activeWindowOpacity, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(inactiveWindowOpacity, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(movingWindowOpacity, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(dockWindowOpacity, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(dockWindowShadowSize, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(activeWindowShadowSize, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(inactiveWindowShadowSize, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(shadowTopOffset, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(shadowLeftOffset, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(shadowColor, SIGNAL(changed(const QColor&)), SLOT(changed()));
connect(fadeInWindows, SIGNAL(toggled(bool)), SLOT(changed()));
connect(fadeOnOpacityChange, SIGNAL(toggled(bool)), SLOT(changed()));
connect(fadeInSpeed, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(fadeOutSpeed, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(useShadows, SIGNAL(toggled(bool)), dockWindowShadowSize, SLOT(setEnabled(bool)));
connect(useShadows, SIGNAL(toggled(bool)), activeWindowShadowSize, SLOT(setEnabled(bool)));
connect(useShadows, SIGNAL(toggled(bool)), inactiveWindowShadowSize, SLOT(setEnabled(bool)));
connect(useShadows, SIGNAL(toggled(bool)), shadowTopOffset, SLOT(setEnabled(bool)));
connect(useShadows, SIGNAL(toggled(bool)), shadowLeftOffset, SLOT(setEnabled(bool)));
connect(useShadows, SIGNAL(toggled(bool)), shadowColor, SLOT(setEnabled(bool)));
load();
tabW->setEnabled(useTranslucency->isChecked());
connect(useTranslucency, SIGNAL(toggled(bool)), this, SLOT(showWarning(bool)));
// handle kompmgr restarts if necessary
connect(useTranslucency, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(disableARGB, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(useShadows, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(inactiveWindowShadowSize, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
connect(shadowTopOffset, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
connect(shadowLeftOffset, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
connect(shadowColor, SIGNAL(changed(const QColor&)), SLOT(resetKompmgr()));
connect(fadeInWindows, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(fadeOnOpacityChange, SIGNAL(toggled(bool)), SLOT(resetKompmgr()));
connect(fadeInSpeed, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
connect(fadeOutSpeed, SIGNAL(valueChanged(int)), SLOT(resetKompmgr()));
}
}
void KTranslucencyConfig::resetKompmgr()
{
resetKompmgr_ = true;
}
void KTranslucencyConfig::load( void )
{
if (!kompmgrAvailable_)
return;
KConfigGroup translucencyConfig(config, "Translucency");
useTranslucency->setChecked(translucencyConfig.readEntry("UseTranslucency", false));
activeWindowTransparency->setChecked(translucencyConfig.readEntry("TranslucentActiveWindows", false));
inactiveWindowTransparency->setChecked(translucencyConfig.readEntry("TranslucentInactiveWindows", true));
movingWindowTransparency->setChecked(translucencyConfig.readEntry("TranslucentMovingWindows", false));
removeShadowsOnMove->setChecked(translucencyConfig.readEntry("RemoveShadowsOnMove", false));
removeShadowsOnResize->setChecked(translucencyConfig.readEntry("RemoveShadowsOnResize", false));
dockWindowTransparency->setChecked(translucencyConfig.readEntry("TranslucentDocks", true));
keepAboveAsActive->setChecked(translucencyConfig.readEntry("TreatKeepAboveAsActive", true));
onlyDecoTranslucent->setChecked(translucencyConfig.readEntry("OnlyDecoTranslucent", false));
activeWindowOpacity->setValue(translucencyConfig.readEntry("ActiveWindowOpacity",100));
inactiveWindowOpacity->setValue(translucencyConfig.readEntry("InactiveWindowOpacity",75));
movingWindowOpacity->setValue(translucencyConfig.readEntry("MovingWindowOpacity",25));
dockWindowOpacity->setValue(translucencyConfig.readEntry("DockOpacity",80));
int ass, iss, dss;
dss = translucencyConfig.readEntry("DockShadowSize", 33);
ass = translucencyConfig.readEntry("ActiveWindowShadowSize", 133);
iss = translucencyConfig.readEntry("InactiveWindowShadowSize", 67);
activeWindowOpacity->setEnabled(activeWindowTransparency->isChecked());
inactiveWindowOpacity->setEnabled(inactiveWindowTransparency->isChecked());
movingWindowOpacity->setEnabled(movingWindowTransparency->isChecked());
dockWindowOpacity->setEnabled(dockWindowTransparency->isChecked());
KConfig *pConf = new KConfig(QDir::homePath() + "/.xcompmgrrc");
KConfigGroup conf_(pConf, "xcompmgr");
disableARGB->setChecked(conf_.readEntry("DisableARGB", false));
useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0);
shadowTopOffset->setValue(-1*(conf_.readEntry("ShadowOffsetY",-80)));
shadowLeftOffset->setValue(-1*(conf_.readEntry("ShadowOffsetX",0)));
int ss = conf_.readEntry("ShadowRadius",6);
dockWindowShadowSize->setValue((int)(dss*ss/100.0));
activeWindowShadowSize->setValue((int)(ass*ss/100.0));
inactiveWindowShadowSize->setValue((int)(iss*ss/100.0));
QString hex = conf_.readEntry("ShadowColor","#000000");
uint r, g, b;
r = g = b = 256;
if (sscanf(hex.toLatin1(), "0x%02x%02x%02x", &r, &g, &b)!=3 || r > 255 || g > 255 || b > 255)
shadowColor->setColor(Qt::black);
else
shadowColor->setColor(QColor(r,g,b));
fadeInWindows->setChecked(conf_.readEntry("FadeWindows", true));
fadeOnOpacityChange->setChecked(conf_.readEntry("FadeTrans", false));
fadeInSpeed->setValue((int)(conf_.readEntry("FadeInStep",0.020)*1000.0));
fadeOutSpeed->setValue((int)(conf_.readEntry("FadeOutStep",0.070)*1000.0));
delete pConf;
emit KCModule::changed(false);
}
void KTranslucencyConfig::save( void )
{
if (!kompmgrAvailable_)
return;
KConfigGroup translucencyConfig(config, "Translucency");
translucencyConfig.writeEntry("UseTranslucency",useTranslucency->isChecked());
translucencyConfig.writeEntry("TranslucentActiveWindows",activeWindowTransparency->isChecked());
translucencyConfig.writeEntry("TranslucentInactiveWindows",inactiveWindowTransparency->isChecked());
translucencyConfig.writeEntry("TranslucentMovingWindows",movingWindowTransparency->isChecked());
translucencyConfig.writeEntry("TranslucentDocks",dockWindowTransparency->isChecked());
translucencyConfig.writeEntry("TreatKeepAboveAsActive",keepAboveAsActive->isChecked());
translucencyConfig.writeEntry("ActiveWindowOpacity",activeWindowOpacity->value());
translucencyConfig.writeEntry("InactiveWindowOpacity",inactiveWindowOpacity->value());
translucencyConfig.writeEntry("MovingWindowOpacity",movingWindowOpacity->value());
translucencyConfig.writeEntry("DockOpacity",dockWindowOpacity->value());
// for simplification:
// xcompmgr supports a general shadow radius and additionally lets external apps set a multiplicator for each window
// (speed reasons, so the shadow matrix hasn't to be recreated for every window)
// we set inactive windows to 100%, the radius to the inactive window value and adjust the multiplicators for docks and active windows
// this way the user can set the three values without caring about the radius/multiplicator stuff
// additionally we find a value between big and small values to have a more smooth appereance
translucencyConfig.writeEntry("DockShadowSize",(int)(200.0 * dockWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value())));
translucencyConfig.writeEntry("ActiveWindowShadowSize",(int)(200.0 * activeWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value())));
translucencyConfig.writeEntry("InctiveWindowShadowSize",(int)(200.0 * inactiveWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value())));
translucencyConfig.writeEntry("RemoveShadowsOnMove",removeShadowsOnMove->isChecked());
translucencyConfig.writeEntry("RemoveShadowsOnResize",removeShadowsOnResize->isChecked());
translucencyConfig.writeEntry("OnlyDecoTranslucent", onlyDecoTranslucent->isChecked());
translucencyConfig.writeEntry("ResetKompmgr",resetKompmgr_);
KConfig *pConf = new KConfig(QDir::homePath() + "/.xcompmgrrc");
KConfigGroup conf_(pConf, "xcompmgr");
conf_.writeEntry("Compmode",useShadows->isChecked()?"CompClientShadows":"");
conf_.writeEntry("DisableARGB",disableARGB->isChecked());
conf_.writeEntry("ShadowOffsetY",-1*shadowTopOffset->value());
conf_.writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value());
int r, g, b;
shadowColor->color().getRgb( &r, &g, &b );
QString hex;
hex.sprintf("0x%02X%02X%02X", r,g,b);
conf_.writeEntry("ShadowColor",hex);
conf_.writeEntry("ShadowRadius",(activeWindowShadowSize->value() + inactiveWindowShadowSize->value()) / 2);
conf_.writeEntry("FadeWindows",fadeInWindows->isChecked());
conf_.writeEntry("FadeTrans",fadeOnOpacityChange->isChecked());
conf_.writeEntry("FadeInStep",fadeInSpeed->value()/1000.0);
conf_.writeEntry("FadeOutStep",fadeOutSpeed->value()/1000.0);
delete pConf;
if (standAlone)
{
config->sync();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
emit KCModule::changed(false);
}
void KTranslucencyConfig::defaults()
{
if (!kompmgrAvailable_)
return;
useTranslucency->setChecked(false);
onlyDecoTranslucent->setChecked(false);
activeWindowTransparency->setChecked(false);
inactiveWindowTransparency->setChecked(true);
movingWindowTransparency->setChecked(false);
dockWindowTransparency->setChecked(true);
keepAboveAsActive->setChecked(true);
disableARGB->setChecked(false);
activeWindowOpacity->setValue(100);
inactiveWindowOpacity->setValue(75);
movingWindowOpacity->setValue(25);
dockWindowOpacity->setValue(80);
dockWindowShadowSize->setValue(6);
activeWindowShadowSize->setValue(12);
inactiveWindowShadowSize->setValue(6);
shadowTopOffset->setValue(80);
shadowLeftOffset->setValue(0);
activeWindowOpacity->setEnabled(false);
inactiveWindowOpacity->setEnabled(true);
movingWindowOpacity->setEnabled(false);
dockWindowOpacity->setEnabled(true);
useShadows->setChecked(true);
removeShadowsOnMove->setChecked(false);
removeShadowsOnResize->setChecked(false);
shadowColor->setColor(Qt::black);
fadeInWindows->setChecked(true);
fadeOnOpacityChange->setChecked(false);
fadeInSpeed->setValue(70);
fadeOutSpeed->setValue(20);
emit KCModule::changed(true);
}
bool KTranslucencyConfig::kompmgrAvailable()
{
KProcess proc;
proc.setOutputChannelMode( KProcess::MergedChannels );
proc.setStandardOutputFile( "/dev/null" );
proc << "kompmgr" << "-v";
return proc.startDetached() != 0;
}
void KTranslucencyConfig::showWarning(bool alphaActivated)
{
if (alphaActivated)
KMessageBox::information(this, i18n("<qt>Translucency support is new and may cause problems<br> including crashes (sometimes the translucency engine, seldom even X).</qt>"), i18n("Warning"));
}
#include "windows.moc"

View file

@ -237,58 +237,4 @@ private:
QComboBox* focusStealing;
QCheckBox* hideUtilityWindowsForInactive;
};
class K3Process;
class KTranslucencyConfig : public KCModule
{
Q_OBJECT
public:
KTranslucencyConfig( bool _standAlone, KConfig *config, const KComponentData &inst, QWidget *parent);
~KTranslucencyConfig();
void load();
void save();
void defaults();
private:
QCheckBox *useTranslucency;
QCheckBox *activeWindowTransparency;
QCheckBox *inactiveWindowTransparency;
QCheckBox *movingWindowTransparency;
QCheckBox *dockWindowTransparency;
QCheckBox *keepAboveAsActive;
QCheckBox *disableARGB;
QCheckBox *fadeInWindows;
QCheckBox *fadeOnOpacityChange;
QCheckBox *useShadows;
QCheckBox *removeShadowsOnResize;
QCheckBox *removeShadowsOnMove;
QGroupBox *sGroup;
QCheckBox *onlyDecoTranslucent;
// QPushButton *xcompmgrButton;
KIntNumInput *activeWindowOpacity;
KIntNumInput *inactiveWindowOpacity;
KIntNumInput *movingWindowOpacity;
KIntNumInput *dockWindowOpacity;
KIntNumInput *dockWindowShadowSize;
KIntNumInput *activeWindowShadowSize;
KIntNumInput *inactiveWindowShadowSize;
KIntNumInput *shadowTopOffset;
KIntNumInput *shadowLeftOffset;
KIntNumInput *fadeInSpeed;
KIntNumInput *fadeOutSpeed;
KColorButton *shadowColor;
KConfig *config;
bool standAlone;
bool alphaActivated;
bool resetKompmgr_;
bool kompmgrAvailable();
bool kompmgrAvailable_;
K3Process *kompmgr;
private slots:
void resetKompmgr();
void showWarning(bool alphaActivated);
};
#endif