Get rid of the titlebar height slider.

- It's not really necessary for usability reasons since the titlebar grows
with bigger font sizes.
- Confusing as it overlaps with the font size setting.
- The space for the configuration dialog is quite limited. :)
I guess removing strings doesn't violate the string freeze...

svn path=/trunk/kdeartwork/kwin-styles/plastik/; revision=263881
This commit is contained in:
Sandro Giessl 2003-11-02 11:34:32 +00:00
parent 69f858427e
commit fd896cc84d
3 changed files with 7 additions and 146 deletions

View file

@ -57,8 +57,6 @@ PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent)
this, SIGNAL(changed()));
connect(m_dialog->titleShadow, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
connect(m_dialog->titlebarHeight, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
}
@ -82,31 +80,6 @@ void PlastikConfig::load(KConfig*)
m_dialog->menuClose->setChecked(menuClose);
bool titleShadow = m_config->readBoolEntry("TitleShadow", true);
m_dialog->titleShadow->setChecked(titleShadow);
int titlebarHeight = m_config->readNumEntry("TitleHeightMin", 19);
if(titlebarHeight <= 16)
{
m_dialog->titlebarHeight->setValue(1);
}
else if(titlebarHeight <= 19)
{
m_dialog->titlebarHeight->setValue(2);
}
else if(titlebarHeight <= 23)
{
m_dialog->titlebarHeight->setValue(3);
}
else if(titlebarHeight <= 27)
{
m_dialog->titlebarHeight->setValue(4);
}
else if(titlebarHeight <= 31)
{
m_dialog->titlebarHeight->setValue(5);
}
else
{
m_dialog->titlebarHeight->setValue(6);
}
}
void PlastikConfig::save(KConfig*)
@ -118,27 +91,6 @@ void PlastikConfig::save(KConfig*)
m_config->writeEntry("AnimateButtons", m_dialog->animateButtons->isChecked() );
m_config->writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked() );
m_config->writeEntry("TitleShadow", m_dialog->titleShadow->isChecked() );
switch(m_dialog->titlebarHeight->value())
{
case 2:
m_config->writeEntry("TitleHeightMin", 19 );
break;
case 3:
m_config->writeEntry("TitleHeightMin", 23 );
break;
case 4:
m_config->writeEntry("TitleHeightMin", 27 );
break;
case 5:
m_config->writeEntry("TitleHeightMin", 31 );
break;
case 6:
m_config->writeEntry("TitleHeightMin", 35 );
break;
case 1:
default:
m_config->writeEntry("TitleHeightMin", 16 );
}
m_config->sync();
}
@ -150,7 +102,6 @@ void PlastikConfig::defaults()
m_dialog->animateButtons->setChecked(true);
m_dialog->menuClose->setChecked(false);
m_dialog->titleShadow->setChecked(true);
m_dialog->titlebarHeight->setValue(2);
}
//////////////////////////////////////////////////////////////////////////////

View file

@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>541</width>
<height>214</height>
<height>167</height>
</rect>
</property>
<property name="caption">
@ -59,95 +59,6 @@
</widget>
</hbox>
</widget>
<spacer row="5" column="2">
<property name="name">
<cstring>spacer5_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>270</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QSlider" row="4" column="1" rowspan="1" colspan="3">
<property name="name">
<cstring>titlebarHeight</cstring>
</property>
<property name="minValue">
<number>1</number>
</property>
<property name="maxValue">
<number>6</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="tickmarks">
<enum>NoMarks</enum>
</property>
<property name="whatsThis" stdset="0">
<string>By adjusting this slider, you can modify the height of the title bar.
Note: This setting gets overwritten if the caption font is bigger than the title bar.</string>
</property>
</widget>
<widget class="QLabel" row="5" column="1">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="text">
<string>Small</string>
</property>
</widget>
<widget class="QLabel" row="4" column="0">
<property name="name">
<cstring>textLabel1_2</cstring>
</property>
<property name="text">
<string>Tit&amp;le bar height:</string>
</property>
<property name="buddy" stdset="0">
<cstring>titlebarHeight</cstring>
</property>
<property name="whatsThis" stdset="0">
<string>By adjusting this slider, you can modify the height of the title bar.
Note: This setting gets overwritten if the caption font is bigger than the title bar.</string>
</property>
</widget>
<spacer row="5" column="0">
<property name="name">
<cstring>spacer7</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>161</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QLabel" row="5" column="3">
<property name="name">
<cstring>textLabel4</cstring>
</property>
<property name="text">
<string>Large</string>
</property>
</widget>
<widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="4">
<property name="name">
<cstring>titleShadow</cstring>
@ -192,7 +103,6 @@ Note: This setting gets overwritten if the caption font is bigger than the title
<tabstop>AlignRight</tabstop>
<tabstop>animateButtons</tabstop>
<tabstop>titleShadow</tabstop>
<tabstop>titlebarHeight</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
</UI>

View file

@ -126,12 +126,12 @@ void PlastikHandler::readConfig()
m_titleShadow = config.readBoolEntry("TitleShadow", true);
QFontMetrics fm(m_titleFont); // active font = inactive font
int titleHeightMin = config.readNumEntry("TitleHeightMin", 19);
int titleHeightMin = 16;
// The title should strech with bigger font sizes!
m_titleHeight = QMAX(titleHeightMin, fm.height() + 4); // 4 px for the shadow etc.
fm = QFontMetrics(m_titleFontTool); // active font = inactive font
int titleHeightToolMin = config.readNumEntry("TitleHeightToolMin", 13);
int titleHeightToolMin = 13;
// The title should strech with bigger font sizes!
m_titleHeightTool = QMAX(titleHeightToolMin, fm.height() ); // don't care about the shadow etc.
@ -179,12 +179,12 @@ QColor PlastikHandler::getColor(KWinPlastik::ColorType type, const bool active)
}
}
QValueList< PlastikHandler::BorderSize >
QValueList< PlastikHandler::BorderSize >
PlastikHandler::borderSizes() const
{
{
// the list must be sorted
return QValueList< BorderSize >() << BorderTiny << BorderNormal <<
BorderLarge << BorderVeryLarge << BorderHuge <<
return QValueList< BorderSize >() << BorderTiny << BorderNormal <<
BorderLarge << BorderVeryLarge << BorderHuge <<
BorderVeryHuge << BorderOversized;
}