Lines 10-16
Link Here
|
10 |
Supports new kwin configuration plugins, and titlebar button position |
10 |
Supports new kwin configuration plugins, and titlebar button position |
11 |
modification via dnd interface. |
11 |
modification via dnd interface. |
12 |
|
12 |
|
13 |
Based on original "kwintheme" (Window Borders) |
13 |
Based on original "kwintheme" (Window Borders) |
14 |
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> |
14 |
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> |
15 |
*/ |
15 |
*/ |
16 |
|
16 |
|
Lines 25-32
Link Here
|
25 |
#include <qvbox.h> |
25 |
#include <qvbox.h> |
26 |
#include <qlabel.h> |
26 |
#include <qlabel.h> |
27 |
#include <qfile.h> |
27 |
#include <qfile.h> |
|
|
28 |
#include <qslider.h> |
29 |
#include <qspinbox.h> |
28 |
|
30 |
|
29 |
#include <kapplication.h> |
31 |
#include <kapplication.h> |
|
|
32 |
#include <kcolorbutton.h> |
30 |
#include <kdebug.h> |
33 |
#include <kdebug.h> |
31 |
#include <kdesktopfile.h> |
34 |
#include <kdesktopfile.h> |
32 |
#include <kstandarddirs.h> |
35 |
#include <kstandarddirs.h> |
Lines 61-74
Link Here
|
61 |
page1->setMargin( KDialog::marginHint() ); |
64 |
page1->setMargin( KDialog::marginHint() ); |
62 |
|
65 |
|
63 |
QGroupBox* btnGroup = new QGroupBox( 1, Qt::Horizontal, i18n("Window Decoration"), page1 ); |
66 |
QGroupBox* btnGroup = new QGroupBox( 1, Qt::Horizontal, i18n("Window Decoration"), page1 ); |
64 |
QWhatsThis::add( btnGroup, |
67 |
QWhatsThis::add( btnGroup, |
65 |
i18n("Select the window decoration. This is the look and feel of both " |
68 |
i18n("Select the window decoration. This is the look and feel of both " |
66 |
"the window borders and the window handle.") ); |
69 |
"the window borders and the window handle.") ); |
67 |
decorationListBox = new QListBox( btnGroup ); |
70 |
decorationListBox = new QListBox( btnGroup ); |
68 |
|
71 |
|
69 |
QGroupBox* checkGroup = new QGroupBox( 1, Qt::Horizontal, |
72 |
QGroupBox* checkGroup = new QGroupBox( 1, Qt::Horizontal, |
70 |
i18n("General Options (if available)"), page1 ); |
73 |
i18n("General Options (if available)"), page1 ); |
71 |
|
74 |
|
72 |
|
75 |
|
73 |
cbUseCustomButtonPositions = new QCheckBox( |
76 |
cbUseCustomButtonPositions = new QCheckBox( |
74 |
i18n("Use custom titlebar button &positions"), checkGroup ); |
77 |
i18n("Use custom titlebar button &positions"), checkGroup ); |
Lines 76-87
Link Here
|
76 |
i18n( "The appropriate settings can be found in the \"Buttons\" Tab. " |
79 |
i18n( "The appropriate settings can be found in the \"Buttons\" Tab. " |
77 |
"Please note that this option is not available on all styles yet!" ) ); |
80 |
"Please note that this option is not available on all styles yet!" ) ); |
78 |
|
81 |
|
79 |
cbShowToolTips = new QCheckBox( |
82 |
cbShowToolTips = new QCheckBox( |
80 |
i18n("&Show window button tooltips"), checkGroup ); |
83 |
i18n("&Show window button tooltips"), checkGroup ); |
81 |
QWhatsThis::add( cbShowToolTips, |
84 |
QWhatsThis::add( cbShowToolTips, |
82 |
i18n( "Enabling this checkbox will show window button tooltips. " |
85 |
i18n( "Enabling this checkbox will show window button tooltips. " |
83 |
"If this checkbox is off, no window button tooltips will be shown.")); |
86 |
"If this checkbox is off, no window button tooltips will be shown.")); |
84 |
|
87 |
|
|
|
88 |
cbWindowShadow = new QCheckBox( |
89 |
i18n("&Draw a drop shadow under windows"), checkGroup); |
90 |
QWhatsThis::add(cbWindowShadow, |
91 |
i18n("Enabling this checkbox will allow you to choose a kind of " |
92 |
"drop shadow to draw under each window.")); |
93 |
|
85 |
// Save this for later... |
94 |
// Save this for later... |
86 |
// cbUseMiniWindows = new QCheckBox( i18n( "Render mini &titlebars for all windows"), checkGroup ); |
95 |
// cbUseMiniWindows = new QCheckBox( i18n( "Render mini &titlebars for all windows"), checkGroup ); |
87 |
// QWhatsThis::add( cbUseMiniWindows, i18n( "Note that this option is not available on all styles yet!" ) ); |
96 |
// QWhatsThis::add( cbUseMiniWindows, i18n( "Note that this option is not available on all styles yet!" ) ); |
Lines 91-100
Link Here
|
91 |
buttonPage->setSpacing( KDialog::spacingHint() ); |
100 |
buttonPage->setSpacing( KDialog::spacingHint() ); |
92 |
buttonPage->setMargin( KDialog::marginHint() ); |
101 |
buttonPage->setMargin( KDialog::marginHint() ); |
93 |
|
102 |
|
94 |
QGroupBox* buttonBox = new QGroupBox( 1, Qt::Horizontal, |
103 |
QGroupBox* buttonBox = new QGroupBox( 1, Qt::Horizontal, |
95 |
i18n("Titlebar Button Position"), buttonPage ); |
104 |
i18n("Titlebar Button Position"), buttonPage ); |
96 |
|
105 |
|
97 |
// Add nifty dnd button modification widgets |
106 |
// Add nifty dnd button modification widgets |
98 |
QLabel* label = new QLabel( buttonBox ); |
107 |
QLabel* label = new QLabel( buttonBox ); |
99 |
dropSite = new ButtonDropSite( buttonBox ); |
108 |
dropSite = new ButtonDropSite( buttonBox ); |
100 |
label->setText( i18n( "To add or remove titlebar buttons, simply <i>drag</i> items " |
109 |
label->setText( i18n( "To add or remove titlebar buttons, simply <i>drag</i> items " |
Lines 102-108
Link Here
|
102 |
"drag items within the titlebar preview to re-position them.") ); |
111 |
"drag items within the titlebar preview to re-position them.") ); |
103 |
buttonSource = new ButtonSource( buttonBox ); |
112 |
buttonSource = new ButtonSource( buttonBox ); |
104 |
|
113 |
|
105 |
// Page 3 (Configure decoration via client plugin page) |
114 |
// Page 3 (Window Shadows) |
|
|
115 |
QGroupBox *activeShadowSettings, *inactiveShadowSettings; |
116 |
QGroupBox *whichShadowSettings; |
117 |
QHBox *inactiveShadowColourHBox, *shadowColourHBox; |
118 |
QHBox *inactiveShadowOpacityHBox, *shadowOpacityHBox; |
119 |
QHBox *inactiveShadowXOffsetHBox, *shadowXOffsetHBox; |
120 |
QHBox *inactiveShadowYOffsetHBox, *shadowYOffsetHBox; |
121 |
QHBox *inactiveShadowThicknessHBox, *shadowThicknessHBox; |
122 |
QLabel *inactiveShadowColourLabel, *shadowColourLabel; |
123 |
QLabel *inactiveShadowOpacityLabel, *shadowOpacityLabel; |
124 |
QLabel *inactiveShadowXOffsetLabel, *shadowXOffsetLabel; |
125 |
QLabel *inactiveShadowYOffsetLabel, *shadowYOffsetLabel; |
126 |
QLabel *inactiveShadowThicknessLabel, *shadowThicknessLabel; |
127 |
|
128 |
shadowPage = new QVBox(tabWidget); |
129 |
shadowPage->setSpacing(KDialog::spacingHint()); |
130 |
shadowPage->setMargin(KDialog::marginHint()); |
131 |
|
132 |
activeShadowSettings = new QGroupBox(1, Qt::Horizontal, |
133 |
i18n("Active Window Shadow"), shadowPage); |
134 |
inactiveShadowSettings = new QGroupBox(1, Qt::Horizontal, |
135 |
i18n("Inactive Window Shadows"), shadowPage); |
136 |
whichShadowSettings = new QGroupBox(3, Qt::Horizontal, |
137 |
i18n("Draw Shadow Under Normal Windows And..."), shadowPage); |
138 |
|
139 |
cbShadowDocks = new QCheckBox(i18n("Docks and &panels"), |
140 |
whichShadowSettings); |
141 |
connect(cbShadowDocks, SIGNAL(toggled(bool)), |
142 |
SLOT(slotSelectionChanged())); |
143 |
cbShadowOverrides = new QCheckBox(i18n("O&verride windows"), |
144 |
whichShadowSettings); |
145 |
connect(cbShadowOverrides, SIGNAL(toggled(bool)), |
146 |
SLOT(slotSelectionChanged())); |
147 |
cbShadowTopMenus = new QCheckBox(i18n("&Top menu"), |
148 |
whichShadowSettings); |
149 |
connect(cbShadowTopMenus, SIGNAL(toggled(bool)), |
150 |
SLOT(slotSelectionChanged())); |
151 |
cbInactiveShadow = new QCheckBox( |
152 |
i18n("Draw shadow under &inactive windows"), inactiveShadowSettings); |
153 |
connect(cbInactiveShadow, SIGNAL(toggled(bool)), |
154 |
SLOT(slotSelectionChanged())); |
155 |
|
156 |
shadowColourHBox = new QHBox(activeShadowSettings); |
157 |
shadowColourHBox->setSpacing(KDialog::spacingHint()); |
158 |
shadowColourLabel = new QLabel(i18n("Colour:"), shadowColourHBox); |
159 |
shadowColourButton = new KColorButton(shadowColourHBox); |
160 |
connect(shadowColourButton, SIGNAL(changed(const QColor &)), SLOT(slotSelectionChanged())); |
161 |
|
162 |
inactiveShadowColourHBox = new QHBox(inactiveShadowSettings); |
163 |
inactiveShadowColourHBox->setSpacing(KDialog::spacingHint()); |
164 |
inactiveShadowColourLabel = new QLabel(i18n("Colour:"), inactiveShadowColourHBox); |
165 |
inactiveShadowColourButton = new KColorButton(inactiveShadowColourHBox); |
166 |
connect(inactiveShadowColourButton, SIGNAL(changed(const QColor &)), SLOT(slotSelectionChanged())); |
167 |
|
168 |
shadowOpacityHBox = new QHBox(activeShadowSettings); |
169 |
shadowOpacityHBox->setSpacing(KDialog::spacingHint()); |
170 |
shadowOpacityLabel = new QLabel(i18n("Maximum opacity:"), shadowOpacityHBox); |
171 |
shadowOpacitySlider = new QSlider(1, 100, 10, 50, Qt::Horizontal, |
172 |
shadowOpacityHBox); |
173 |
shadowOpacitySlider->setTickmarks(QSlider::Below); |
174 |
shadowOpacitySlider->setTickInterval(10); |
175 |
shadowOpacitySpinBox = new QSpinBox(1, 100, 1, shadowOpacityHBox); |
176 |
shadowOpacitySpinBox->setSuffix(" %"); |
177 |
connect(shadowOpacitySlider, SIGNAL(valueChanged(int)), shadowOpacitySpinBox, |
178 |
SLOT(setValue(int))); |
179 |
connect(shadowOpacitySpinBox, SIGNAL(valueChanged(int)), shadowOpacitySlider, |
180 |
SLOT(setValue(int))); |
181 |
connect(shadowOpacitySlider, SIGNAL(valueChanged(int)), |
182 |
SLOT(slotSelectionChanged())); |
183 |
|
184 |
inactiveShadowOpacityHBox = new QHBox(inactiveShadowSettings); |
185 |
inactiveShadowOpacityHBox->setSpacing(KDialog::spacingHint()); |
186 |
inactiveShadowOpacityLabel = new QLabel(i18n("Maximum opacity:"), |
187 |
inactiveShadowOpacityHBox); |
188 |
inactiveShadowOpacitySlider = new QSlider(1, 100, 10, 50, Qt::Horizontal, |
189 |
inactiveShadowOpacityHBox); |
190 |
inactiveShadowOpacitySlider->setTickmarks(QSlider::Below); |
191 |
inactiveShadowOpacitySlider->setTickInterval(10); |
192 |
inactiveShadowOpacitySpinBox = new QSpinBox(1, 100, 1, |
193 |
inactiveShadowOpacityHBox); |
194 |
inactiveShadowOpacitySpinBox->setSuffix(" %"); |
195 |
connect(inactiveShadowOpacitySlider, SIGNAL(valueChanged(int)), |
196 |
inactiveShadowOpacitySpinBox, |
197 |
SLOT(setValue(int))); |
198 |
connect(inactiveShadowOpacitySpinBox, SIGNAL(valueChanged(int)), |
199 |
inactiveShadowOpacitySlider, |
200 |
SLOT(setValue(int))); |
201 |
connect(inactiveShadowOpacitySlider, SIGNAL(valueChanged(int)), |
202 |
SLOT(slotSelectionChanged())); |
203 |
|
204 |
shadowXOffsetHBox = new QHBox(activeShadowSettings); |
205 |
shadowXOffsetHBox->setSpacing(KDialog::spacingHint()); |
206 |
shadowXOffsetLabel = new QLabel( |
207 |
i18n("Offset rightward (may be negative):"), |
208 |
shadowXOffsetHBox); |
209 |
shadowXOffsetSpinBox = new QSpinBox(-1024, 1024, 1, shadowXOffsetHBox); |
210 |
shadowXOffsetSpinBox->setSuffix(i18n(" pixels")); |
211 |
connect(shadowXOffsetSpinBox, SIGNAL(valueChanged(int)), |
212 |
SLOT(slotSelectionChanged())); |
213 |
|
214 |
inactiveShadowXOffsetHBox = new QHBox(inactiveShadowSettings); |
215 |
inactiveShadowXOffsetHBox->setSpacing(KDialog::spacingHint()); |
216 |
inactiveShadowXOffsetLabel = new QLabel( |
217 |
i18n("Offset rightward (may be negative):"), |
218 |
inactiveShadowXOffsetHBox); |
219 |
inactiveShadowXOffsetSpinBox = new QSpinBox(-1024, 1024, 1, |
220 |
inactiveShadowXOffsetHBox); |
221 |
inactiveShadowXOffsetSpinBox->setSuffix(i18n(" pixels")); |
222 |
connect(inactiveShadowXOffsetSpinBox, SIGNAL(valueChanged(int)), |
223 |
SLOT(slotSelectionChanged())); |
224 |
|
225 |
shadowYOffsetHBox = new QHBox(activeShadowSettings); |
226 |
shadowYOffsetHBox->setSpacing(KDialog::spacingHint()); |
227 |
shadowYOffsetLabel = new QLabel( |
228 |
i18n("Offset downward (may be negative):"), |
229 |
shadowYOffsetHBox); |
230 |
shadowYOffsetSpinBox = new QSpinBox(-1024, 1024, 1, shadowYOffsetHBox); |
231 |
shadowYOffsetSpinBox->setSuffix(i18n(" pixels")); |
232 |
connect(shadowYOffsetSpinBox, SIGNAL(valueChanged(int)), |
233 |
SLOT(slotSelectionChanged())); |
234 |
|
235 |
inactiveShadowYOffsetHBox = new QHBox(inactiveShadowSettings); |
236 |
inactiveShadowYOffsetHBox->setSpacing(KDialog::spacingHint()); |
237 |
inactiveShadowYOffsetLabel = new QLabel( |
238 |
i18n("Offset downward (may be negative):"), |
239 |
inactiveShadowYOffsetHBox); |
240 |
inactiveShadowYOffsetSpinBox = new QSpinBox(-1024, 1024, 1, |
241 |
inactiveShadowYOffsetHBox); |
242 |
inactiveShadowYOffsetSpinBox->setSuffix(i18n(" pixels")); |
243 |
connect(inactiveShadowYOffsetSpinBox, SIGNAL(valueChanged(int)), |
244 |
SLOT(slotSelectionChanged())); |
245 |
|
246 |
shadowThicknessHBox = new QHBox(activeShadowSettings); |
247 |
shadowThicknessHBox->setSpacing(KDialog::spacingHint()); |
248 |
shadowThicknessLabel = new QLabel( |
249 |
i18n("Thickness to either side of window:"), |
250 |
shadowThicknessHBox); |
251 |
shadowThicknessSpinBox = new QSpinBox(1, 100, 1, |
252 |
shadowThicknessHBox); |
253 |
shadowThicknessSpinBox->setSuffix(i18n(" pixels")); |
254 |
connect(shadowThicknessSpinBox, SIGNAL(valueChanged(int)), |
255 |
SLOT(slotSelectionChanged())); |
256 |
|
257 |
inactiveShadowThicknessHBox = new QHBox(inactiveShadowSettings); |
258 |
inactiveShadowThicknessHBox->setSpacing(KDialog::spacingHint()); |
259 |
inactiveShadowThicknessLabel = new QLabel( |
260 |
i18n("Thickness to either side of window:"), |
261 |
inactiveShadowThicknessHBox); |
262 |
inactiveShadowThicknessSpinBox = new QSpinBox(1, 100, 1, |
263 |
inactiveShadowThicknessHBox); |
264 |
inactiveShadowThicknessSpinBox->setSuffix(i18n(" pixels")); |
265 |
connect(inactiveShadowThicknessSpinBox, SIGNAL(valueChanged(int)), |
266 |
SLOT(slotSelectionChanged())); |
267 |
|
268 |
// Page 4 (Configure decoration via client plugin page) |
106 |
pluginPage = new QVBox( tabWidget ); |
269 |
pluginPage = new QVBox( tabWidget ); |
107 |
pluginPage->setSpacing( KDialog::spacingHint() ); |
270 |
pluginPage->setSpacing( KDialog::spacingHint() ); |
108 |
pluginPage->setMargin( KDialog::marginHint() ); |
271 |
pluginPage->setMargin( KDialog::marginHint() ); |
Lines 117-126
Link Here
|
117 |
|
280 |
|
118 |
tabWidget->insertTab( page1, i18n("&General") ); |
281 |
tabWidget->insertTab( page1, i18n("&General") ); |
119 |
tabWidget->insertTab( buttonPage, i18n("&Buttons") ); |
282 |
tabWidget->insertTab( buttonPage, i18n("&Buttons") ); |
120 |
tabWidget->insertTab( pluginPage, i18n("&Configure [") + |
283 |
tabWidget->insertTab( shadowPage, i18n("S&hadows") ); |
|
|
284 |
tabWidget->insertTab( pluginPage, i18n("&Configure [") + |
121 |
decorationListBox->currentText() + i18n("]") ); |
285 |
decorationListBox->currentText() + i18n("]") ); |
122 |
|
286 |
|
123 |
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() ); |
287 |
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() ); |
|
|
288 |
tabWidget->setTabEnabled(shadowPage, cbWindowShadow->isChecked()); |
124 |
tabWidget->setTabEnabled( pluginPage, pluginObject ? true : false ); |
289 |
tabWidget->setTabEnabled( pluginPage, pluginObject ? true : false ); |
125 |
|
290 |
|
126 |
connect( dropSite, SIGNAL(buttonAdded(char)), buttonSource, SLOT(hideButton(char)) ); |
291 |
connect( dropSite, SIGNAL(buttonAdded(char)), buttonSource, SLOT(hideButton(char)) ); |
Lines 129-139
Link Here
|
129 |
connect( dropSite, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); |
294 |
connect( dropSite, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); |
130 |
connect( buttonSource, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) ); |
295 |
connect( buttonSource, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) ); |
131 |
connect( decorationListBox, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); |
296 |
connect( decorationListBox, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); |
132 |
connect( decorationListBox, SIGNAL(highlighted(const QString&)), |
297 |
connect( decorationListBox, SIGNAL(highlighted(const QString&)), |
133 |
SLOT(slotDecorationHighlighted(const QString&)) ); |
298 |
SLOT(slotDecorationHighlighted(const QString&)) ); |
134 |
connect( cbUseCustomButtonPositions, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); |
299 |
connect( cbUseCustomButtonPositions, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); |
135 |
connect( cbUseCustomButtonPositions, SIGNAL(toggled(bool)), SLOT(slotEnableButtonTab(bool)) ); |
300 |
connect( cbUseCustomButtonPositions, SIGNAL(toggled(bool)), SLOT(slotEnableButtonTab(bool)) ); |
136 |
connect( cbShowToolTips, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); |
301 |
connect( cbShowToolTips, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); |
|
|
302 |
connect( cbWindowShadow, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); |
303 |
connect( cbWindowShadow, SIGNAL(toggled(bool)), SLOT(slotEnableShadowTab(bool)) ); |
137 |
// connect( cbUseMiniWindows, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); |
304 |
// connect( cbUseMiniWindows, SIGNAL(clicked()), SLOT(slotSelectionChanged()) ); |
138 |
|
305 |
|
139 |
// Allow kwin dcop signal to update our selection list |
306 |
// Allow kwin dcop signal to update our selection list |
Lines 184-190
Link Here
|
184 |
QValueList<DecorationInfo>::ConstIterator it; |
351 |
QValueList<DecorationInfo>::ConstIterator it; |
185 |
|
352 |
|
186 |
// Sync with kwin hardcoded KDE2 style which has no desktop item |
353 |
// Sync with kwin hardcoded KDE2 style which has no desktop item |
187 |
decorationListBox->insertItem( i18n("KDE 2") ); |
354 |
decorationListBox->insertItem( i18n("KDE 2") ); |
188 |
|
355 |
|
189 |
for (it = decorations.begin(); it != decorations.end(); ++it) |
356 |
for (it = decorations.begin(); it != decorations.end(); ++it) |
190 |
{ |
357 |
{ |
Lines 221-226
Link Here
|
221 |
tabWidget->setTabEnabled( buttonPage, on ); |
388 |
tabWidget->setTabEnabled( buttonPage, on ); |
222 |
} |
389 |
} |
223 |
|
390 |
|
|
|
391 |
void KWinDecorationModule::slotEnableShadowTab(bool on) |
392 |
{ |
393 |
tabWidget->setTabEnabled(shadowPage, on); |
394 |
} |
224 |
|
395 |
|
225 |
QString KWinDecorationModule::decorationName( QString& libName ) |
396 |
QString KWinDecorationModule::decorationName( QString& libName ) |
226 |
{ |
397 |
{ |
Lines 253-259
Link Here
|
253 |
} |
424 |
} |
254 |
|
425 |
|
255 |
if (libName.isEmpty()) |
426 |
if (libName.isEmpty()) |
256 |
libName = "kwin_default"; // KDE 2 |
427 |
libName = "kwin_default"; // KDE 2 |
257 |
|
428 |
|
258 |
return libName; |
429 |
return libName; |
259 |
} |
430 |
} |
Lines 290-311
Link Here
|
290 |
|
461 |
|
291 |
KLibrary* library = loader->library( QFile::encodeName(currentName) ); |
462 |
KLibrary* library = loader->library( QFile::encodeName(currentName) ); |
292 |
if (library != NULL) |
463 |
if (library != NULL) |
293 |
{ |
464 |
{ |
294 |
void* alloc_ptr = library->symbol("allocate_config"); |
465 |
void* alloc_ptr = library->symbol("allocate_config"); |
295 |
|
466 |
|
296 |
if (alloc_ptr != NULL) |
467 |
if (alloc_ptr != NULL) |
297 |
{ |
468 |
{ |
298 |
allocatePlugin = (QObject* (*)(KConfig* conf, QWidget* parent))alloc_ptr; |
469 |
allocatePlugin = (QObject* (*)(KConfig* conf, QWidget* parent))alloc_ptr; |
299 |
pluginObject = allocatePlugin( conf, pluginPage ); |
470 |
pluginObject = allocatePlugin( conf, pluginPage ); |
300 |
|
471 |
|
301 |
// connect required signals and slots together... |
472 |
// connect required signals and slots together... |
302 |
connect( pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); |
473 |
connect( pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); |
303 |
connect( this, SIGNAL(pluginLoad(KConfig*)), pluginObject, SLOT(load(KConfig*)) ); |
474 |
connect( this, SIGNAL(pluginLoad(KConfig*)), pluginObject, SLOT(load(KConfig*)) ); |
304 |
connect( this, SIGNAL(pluginSave(KConfig*)), pluginObject, SLOT(save(KConfig*)) ); |
475 |
connect( this, SIGNAL(pluginSave(KConfig*)), pluginObject, SLOT(save(KConfig*)) ); |
305 |
connect( this, SIGNAL(pluginDefaults()), pluginObject, SLOT(defaults()) ); |
476 |
connect( this, SIGNAL(pluginDefaults()), pluginObject, SLOT(defaults()) ); |
306 |
|
477 |
|
307 |
return; |
478 |
return; |
308 |
} |
479 |
} |
309 |
} |
480 |
} |
310 |
|
481 |
|
311 |
pluginObject = NULL; |
482 |
pluginObject = NULL; |
Lines 322-334
Link Here
|
322 |
cbUseCustomButtonPositions->setChecked( conf->readBoolEntry("CustomButtonPositions", false)); |
493 |
cbUseCustomButtonPositions->setChecked( conf->readBoolEntry("CustomButtonPositions", false)); |
323 |
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() ); |
494 |
tabWidget->setTabEnabled( buttonPage, cbUseCustomButtonPositions->isChecked() ); |
324 |
cbShowToolTips->setChecked( conf->readBoolEntry("ShowToolTips", true )); |
495 |
cbShowToolTips->setChecked( conf->readBoolEntry("ShowToolTips", true )); |
|
|
496 |
cbWindowShadow->setChecked( conf->readBoolEntry("ShadowEnabled", false) ); |
325 |
// cbUseMiniWindows->setChecked( conf->readBoolEntry("MiniWindowBorders", false)); |
497 |
// cbUseMiniWindows->setChecked( conf->readBoolEntry("MiniWindowBorders", false)); |
326 |
|
498 |
|
327 |
// Find the corresponding decoration name to that of |
499 |
// Find the corresponding decoration name to that of |
328 |
// the current plugin library name |
500 |
// the current plugin library name |
329 |
|
501 |
|
330 |
oldLibraryName = currentLibraryName; |
502 |
oldLibraryName = currentLibraryName; |
331 |
currentLibraryName = conf->readEntry("PluginLib", |
503 |
currentLibraryName = conf->readEntry("PluginLib", |
332 |
((QPixmap::defaultDepth() > 8) ? "kwin_keramik" : "kwin_quartz")); |
504 |
((QPixmap::defaultDepth() > 8) ? "kwin_keramik" : "kwin_quartz")); |
333 |
QString decoName = decorationName( currentLibraryName ); |
505 |
QString decoName = decorationName( currentLibraryName ); |
334 |
|
506 |
|
Lines 349-354
Link Here
|
349 |
|
521 |
|
350 |
buttonSource->showAllButtons(); |
522 |
buttonSource->showAllButtons(); |
351 |
|
523 |
|
|
|
524 |
// Shadows tab |
525 |
// =========== |
526 |
shadowColourButton->setColor( |
527 |
conf->readColorEntry("ShadowColour", &Qt::black)); |
528 |
shadowOpacitySlider->setValue( |
529 |
(int)(conf->readDoubleNumEntry("ShadowOpacity", 0.75) * 100)); |
530 |
shadowXOffsetSpinBox->setValue(conf->readNumEntry("ShadowXOffset", 0)); |
531 |
shadowYOffsetSpinBox->setValue(conf->readNumEntry("ShadowYOffset", 8)); |
532 |
cbShadowDocks->setChecked( |
533 |
conf->readBoolEntry("ShadowDocks", false)); |
534 |
cbShadowOverrides->setChecked( |
535 |
conf->readBoolEntry("ShadowOverrides", false)); |
536 |
cbShadowTopMenus->setChecked( |
537 |
conf->readBoolEntry("ShadowTopMenus", false)); |
538 |
shadowThicknessSpinBox->setValue( |
539 |
conf->readNumEntry("ShadowThickness", 8)); |
540 |
cbInactiveShadow->setChecked( |
541 |
conf->readBoolEntry("InactiveShadowEnabled", false)); |
542 |
inactiveShadowColourButton->setColor( |
543 |
conf->readColorEntry("InactiveShadowColour", &Qt::black)); |
544 |
inactiveShadowOpacitySlider->setValue( |
545 |
(int)(conf->readDoubleNumEntry("InactiveShadowOpacity", 0.75)*100)); |
546 |
inactiveShadowXOffsetSpinBox->setValue( |
547 |
conf->readNumEntry("InactiveShadowXOffset", 0)); |
548 |
inactiveShadowYOffsetSpinBox->setValue( |
549 |
conf->readNumEntry("InactiveShadowYOffset", 4)); |
550 |
inactiveShadowThicknessSpinBox->setValue( |
551 |
conf->readNumEntry("InactiveShadowThickness", 4)); |
552 |
|
352 |
// Step through the button lists, and hide the dnd button source items |
553 |
// Step through the button lists, and hide the dnd button source items |
353 |
unsigned int i; |
554 |
unsigned int i; |
354 |
for(i = 0; i < dropSite->buttonsLeft.length(); i++) |
555 |
for(i = 0; i < dropSite->buttonsLeft.length(); i++) |
Lines 368-384
Link Here
|
368 |
|
569 |
|
369 |
KConfig kwinConfig("kwinrc"); |
570 |
KConfig kwinConfig("kwinrc"); |
370 |
kwinConfig.setGroup("Style"); |
571 |
kwinConfig.setGroup("Style"); |
371 |
|
572 |
|
372 |
// General settings |
573 |
// General settings |
373 |
conf->writeEntry("PluginLib", libName); |
574 |
conf->writeEntry("PluginLib", libName); |
374 |
conf->writeEntry("CustomButtonPositions", cbUseCustomButtonPositions->isChecked()); |
575 |
conf->writeEntry("CustomButtonPositions", cbUseCustomButtonPositions->isChecked()); |
375 |
conf->writeEntry("ShowToolTips", cbShowToolTips->isChecked()); |
576 |
conf->writeEntry("ShowToolTips", cbShowToolTips->isChecked()); |
|
|
577 |
conf->writeEntry("ShadowEnabled", cbWindowShadow->isChecked()); |
376 |
// conf->writeEntry("MiniWindowBorders", cbUseMiniWindows->isChecked()); |
578 |
// conf->writeEntry("MiniWindowBorders", cbUseMiniWindows->isChecked()); |
377 |
|
579 |
|
378 |
// Button settings |
580 |
// Button settings |
379 |
conf->writeEntry("ButtonsOnLeft", dropSite->buttonsLeft ); |
581 |
conf->writeEntry("ButtonsOnLeft", dropSite->buttonsLeft ); |
380 |
conf->writeEntry("ButtonsOnRight", dropSite->buttonsRight ); |
582 |
conf->writeEntry("ButtonsOnRight", dropSite->buttonsRight ); |
381 |
|
583 |
|
|
|
584 |
// Shadow settings |
585 |
conf->writeEntry("ShadowColour", shadowColourButton->color()); |
586 |
conf->writeEntry("ShadowOpacity", shadowOpacitySlider->value() / 100.0); |
587 |
conf->writeEntry("ShadowXOffset", shadowXOffsetSpinBox->value()); |
588 |
conf->writeEntry("ShadowYOffset", shadowYOffsetSpinBox->value()); |
589 |
conf->writeEntry("ShadowThickness", shadowThicknessSpinBox->value()); |
590 |
conf->writeEntry("ShadowDocks", cbShadowDocks->isChecked()); |
591 |
conf->writeEntry("ShadowOverrides", cbShadowOverrides->isChecked()); |
592 |
conf->writeEntry("ShadowTopMenus", cbShadowTopMenus->isChecked()); |
593 |
conf->writeEntry("InactiveShadowEnabled", cbInactiveShadow->isChecked()); |
594 |
conf->writeEntry("InactiveShadowColour", inactiveShadowColourButton->color()); |
595 |
conf->writeEntry("InactiveShadowOpacity", |
596 |
inactiveShadowOpacitySlider->value() / 100.0); |
597 |
conf->writeEntry("InactiveShadowXOffset", |
598 |
inactiveShadowXOffsetSpinBox->value()); |
599 |
conf->writeEntry("InactiveShadowYOffset", |
600 |
inactiveShadowYOffsetSpinBox->value()); |
601 |
conf->writeEntry("InactiveShadowThickness", |
602 |
inactiveShadowThicknessSpinBox->value()); |
603 |
|
382 |
oldLibraryName = currentLibraryName; |
604 |
oldLibraryName = currentLibraryName; |
383 |
currentLibraryName = libName; |
605 |
currentLibraryName = libName; |
384 |
|
606 |
|
Lines 405-411
Link Here
|
405 |
KConfig kwinConfig("kwinrc"); |
627 |
KConfig kwinConfig("kwinrc"); |
406 |
kwinConfig.setGroup("Style"); |
628 |
kwinConfig.setGroup("Style"); |
407 |
|
629 |
|
408 |
// Reset by re-reading the config |
630 |
// Reset by re-reading the config |
409 |
// The plugin doesn't need changing, as we have not saved |
631 |
// The plugin doesn't need changing, as we have not saved |
410 |
readConfig( &kwinConfig ); |
632 |
readConfig( &kwinConfig ); |
411 |
emit pluginLoad( &kwinConfig ); |
633 |
emit pluginLoad( &kwinConfig ); |
Lines 431-439
Link Here
|
431 |
// Set the KDE defaults |
653 |
// Set the KDE defaults |
432 |
cbUseCustomButtonPositions->setChecked( false ); |
654 |
cbUseCustomButtonPositions->setChecked( false ); |
433 |
cbShowToolTips->setChecked( true ); |
655 |
cbShowToolTips->setChecked( true ); |
|
|
656 |
cbWindowShadow->setChecked( false ); |
434 |
// cbUseMiniWindows->setChecked( false); |
657 |
// cbUseMiniWindows->setChecked( false); |
435 |
// Don't set default for now |
658 |
// Don't set default for now |
436 |
// decorationListBox->setSelected( |
659 |
// decorationListBox->setSelected( |
437 |
// decorationListBox->findItem( i18n("KDE 2") ), true ); // KDE classic client |
660 |
// decorationListBox->findItem( i18n("KDE 2") ), true ); // KDE classic client |
438 |
|
661 |
|
439 |
dropSite->buttonsLeft = "MS"; |
662 |
dropSite->buttonsLeft = "MS"; |
Lines 448-453
Link Here
|
448 |
buttonSource->hideButton('A'); |
671 |
buttonSource->hideButton('A'); |
449 |
buttonSource->hideButton('X'); |
672 |
buttonSource->hideButton('X'); |
450 |
|
673 |
|
|
|
674 |
shadowColourButton->setColor(Qt::black); |
675 |
shadowOpacitySlider->setValue(75); |
676 |
shadowXOffsetSpinBox->setValue(0); |
677 |
shadowYOffsetSpinBox->setValue(10); |
678 |
shadowThicknessSpinBox->setValue(10); |
679 |
cbShadowDocks->setChecked(false); |
680 |
cbShadowOverrides->setChecked(false); |
681 |
cbShadowTopMenus->setChecked(false); |
682 |
cbInactiveShadow->setChecked(false); |
683 |
inactiveShadowColourButton->setColor(Qt::black); |
684 |
inactiveShadowOpacitySlider->setValue(75); |
685 |
inactiveShadowXOffsetSpinBox->setValue(0); |
686 |
inactiveShadowYOffsetSpinBox->setValue(5); |
687 |
inactiveShadowThicknessSpinBox->setValue(5); |
688 |
|
451 |
// Set plugin defaults |
689 |
// Set plugin defaults |
452 |
emit pluginDefaults(); |
690 |
emit pluginDefaults(); |
453 |
} |
691 |
} |
Lines 463-469
Link Here
|
463 |
|
701 |
|
464 |
const KAboutData* KWinDecorationModule::aboutData() const |
702 |
const KAboutData* KWinDecorationModule::aboutData() const |
465 |
{ |
703 |
{ |
466 |
KAboutData* about = |
704 |
KAboutData* about = |
467 |
new KAboutData(I18N_NOOP("kcmkwindecoration"), |
705 |
new KAboutData(I18N_NOOP("kcmkwindecoration"), |
468 |
I18N_NOOP("Window Decoration Control Module"), |
706 |
I18N_NOOP("Window Decoration Control Module"), |
469 |
0, 0, KAboutData::License_GPL, |
707 |
0, 0, KAboutData::License_GPL, |
Lines 477-483
Link Here
|
477 |
{ |
715 |
{ |
478 |
bool ok = kapp->dcopClient()->send("kwin", "KWinInterface", |
716 |
bool ok = kapp->dcopClient()->send("kwin", "KWinInterface", |
479 |
"reconfigure()", QByteArray()); |
717 |
"reconfigure()", QByteArray()); |
480 |
if (!ok) |
718 |
if (!ok) |
481 |
kdDebug() << "kcmkwindecoration: Could not reconfigure kwin" << endl; |
719 |
kdDebug() << "kcmkwindecoration: Could not reconfigure kwin" << endl; |
482 |
} |
720 |
} |
483 |
|
721 |
|