Sync r926623 from Oxygen.
svn path=/trunk/KDE/kdebase/workspace/; revision=980080
This commit is contained in:
parent
ac1bd1e6ec
commit
2c0b61630f
5 changed files with 57 additions and 29 deletions
|
@ -49,7 +49,8 @@ OxygenConfig::OxygenConfig( KConfig*, QWidget* parent )
|
|||
c = new KConfig( "oxygenrc" );
|
||||
KConfigGroup cg(c, "Windeco");
|
||||
ui = new OxygenConfigUI( parent );
|
||||
connect( ui->showStripes, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui->showStripes, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui->thinBorders, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui->blendTitlebarColors, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui->titleAlignmentLeft, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
connect( ui->titleAlignmentCenter, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||
|
@ -73,6 +74,7 @@ void OxygenConfig::load( const KConfigGroup& )
|
|||
{
|
||||
KConfigGroup cg(c, "Windeco");
|
||||
ui->showStripes->setChecked( cg.readEntry("ShowStripes", true) );
|
||||
ui->thinBorders->setChecked( cg.readEntry("ThinBorders", true) );
|
||||
ui->blendTitlebarColors->setChecked( cg.readEntry("BlendTitlebarColors", true) );
|
||||
|
||||
QString titleAlignment = cg.readEntry("TitleAlignment", "Left");
|
||||
|
@ -87,6 +89,7 @@ void OxygenConfig::save( KConfigGroup& )
|
|||
{
|
||||
KConfigGroup cg(c, "Windeco");
|
||||
cg.writeEntry( "ShowStripes", ui->showStripes->isChecked() );
|
||||
cg.writeEntry( "ThinBorders", ui->thinBorders->isChecked() );
|
||||
cg.writeEntry( "BlendTitlebarColors", ui->blendTitlebarColors->isChecked() );
|
||||
|
||||
QString titleAlignment = "Left";
|
||||
|
@ -107,6 +110,7 @@ void OxygenConfig::save( KConfigGroup& )
|
|||
void OxygenConfig::defaults()
|
||||
{
|
||||
ui->showStripes->setChecked( true );
|
||||
ui->thinBorders->setChecked( true );
|
||||
ui->titleAlignmentLeft->setChecked( true );
|
||||
ui->blendTitlebarColors->setChecked( true );
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Ozone::OxygenConfigUI</class>
|
||||
<widget class="QWidget" name="OxygenConfigUI" >
|
||||
<property name="geometry" >
|
||||
<widget class="QWidget" name="OxygenConfigUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
|
@ -9,39 +10,39 @@
|
|||
<height>234</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Ozone</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Title &Alignment</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="titleAlignmentLeft" >
|
||||
<property name="enabled" >
|
||||
<widget class="QRadioButton" name="titleAlignmentLeft">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>&Left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="titleAlignmentCenter" >
|
||||
<property name="text" >
|
||||
<widget class="QRadioButton" name="titleAlignmentCenter">
|
||||
<property name="text">
|
||||
<string>Center</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="titleAlignmentRight" >
|
||||
<property name="text" >
|
||||
<widget class="QRadioButton" name="titleAlignmentRight">
|
||||
<property name="text">
|
||||
<string>&Right</string>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -50,25 +51,32 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="blendTitlebarColors" >
|
||||
<property name="whatsThis" >
|
||||
<widget class="QCheckBox" name="blendTitlebarColors">
|
||||
<property name="whatsThis">
|
||||
<string>When enabled, this option makes the window title bar use the same colors as the window contents, instead of using the system title bar colors.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Blend title bar colors with window contents</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showStripes" >
|
||||
<property name="whatsThis" >
|
||||
<widget class="QCheckBox" name="showStripes">
|
||||
<property name="whatsThis">
|
||||
<string>When enabled, this option increases the visibility of the window titlebar by showing stripes</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Show stripes next to the title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="thinBorders">
|
||||
<property name="text">
|
||||
<string>Use thin borders</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
|
@ -54,6 +54,7 @@ bool OxygenFactory::initialized_ = false;
|
|||
Qt::Alignment OxygenFactory::titleAlignment_ = Qt::AlignLeft;
|
||||
bool OxygenFactory::showStripes_ = true;
|
||||
bool OxygenFactory::blendTitlebarColors_ = true;
|
||||
bool OxygenFactory::thinBorders_ = true;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// OxygenFactory()
|
||||
|
@ -126,13 +127,17 @@ bool OxygenFactory::readConfig()
|
|||
else if (value == "Right")
|
||||
titleAlignment_ = Qt::AlignRight;
|
||||
|
||||
bool oldstripes = showStripes;
|
||||
bool oldborders = thinBorders_;
|
||||
thinBorders_ = group.readEntry( "ThinBorders", true );
|
||||
|
||||
bool oldstripes = showStripes_;
|
||||
showStripes_ = group.readEntry( "ShowStripes", true );
|
||||
|
||||
bool oldblend = blendTitlebarColors;
|
||||
blendTitlebarColors_ = group.readEntry( "BlendTitlebarColors", true );
|
||||
|
||||
if (oldalign == titleAlignment_ && oldstripes == showStripes_ && oldblend == blendTitlebarColors_)
|
||||
if (oldalign == titleAlignment_ && oldstripes == showStripes_
|
||||
&& oldborders == thinBorders_)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
static bool initialized();
|
||||
static Qt::Alignment titleAlignment();
|
||||
static bool showStripes();
|
||||
static bool thinBorders();
|
||||
static bool blendTitlebarColors();
|
||||
|
||||
private:
|
||||
|
@ -81,6 +82,7 @@ private:
|
|||
static bool initialized_;
|
||||
static Qt::Alignment titleAlignment_;
|
||||
static bool showStripes_;
|
||||
static bool thinBorders_;
|
||||
static bool blendTitlebarColors_;
|
||||
};
|
||||
|
||||
|
@ -96,6 +98,9 @@ inline bool OxygenFactory::blendTitlebarColors()
|
|||
inline bool OxygenFactory::showStripes()
|
||||
{ return showStripes_; }
|
||||
|
||||
inline bool OxygenFactory::thinBorders()
|
||||
{ return thinBorders_; }
|
||||
|
||||
} //namespace Oxygen
|
||||
} //namespace Ozone
|
||||
|
||||
|
|
|
@ -133,10 +133,16 @@ int OxygenClient::layoutMetric(LayoutMetric lm, bool respectWindowState, const K
|
|||
if (respectWindowState && maximized) {
|
||||
return 0;
|
||||
} else {
|
||||
if (lm == LM_BorderBottom)
|
||||
return BFRAMESIZE + 2;
|
||||
else
|
||||
return 2;
|
||||
if (OxygenFactory::thinBorders())
|
||||
{
|
||||
if (lm == LM_BorderBottom) {
|
||||
return BFRAMESIZE + 2;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
return BFRAMESIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue