added the possibility to hide decoration 'titlebar', but not decoration 'border' in window-specific override rules
svn path=/trunk/KDE/kdebase/workspace/; revision=1046005
This commit is contained in:
parent
854121ea8e
commit
d4344b7bba
8 changed files with 74 additions and 21 deletions
|
@ -124,6 +124,7 @@ namespace Oxygen
|
|||
ui.sizeGripComboBox->setCurrentIndex( ui.sizeGripComboBox->findText( exception.sizeGripModeName( true ) ) );
|
||||
ui.separatorComboBox->setCurrentIndex( ui.separatorComboBox->findText( exception.drawSeparator() ? yes:no ) );
|
||||
ui.titleOutlineComboBox->setCurrentIndex( ui.titleOutlineComboBox->findText( exception.drawTitleOutline() ? yes:no ) );
|
||||
ui.hideTitleBar->setChecked( exception.hideTitleBar() );
|
||||
|
||||
// mask
|
||||
for( CheckBoxMap::iterator iter = checkboxes_.begin(); iter != checkboxes_.end(); ++iter )
|
||||
|
@ -144,6 +145,7 @@ namespace Oxygen
|
|||
// flags
|
||||
exception.setDrawSeparator( ui.separatorComboBox->currentText() == yes );
|
||||
exception.setDrawTitleOutline( ui.titleOutlineComboBox->currentText() == yes );
|
||||
exception.setHideTitleBar( ui.hideTitleBar->isChecked() );
|
||||
|
||||
// mask
|
||||
unsigned int mask = OxygenException::None;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>463</width>
|
||||
<height>311</height>
|
||||
<width>460</width>
|
||||
<height>352</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
|
@ -109,6 +109,23 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="hideTitleBar">
|
||||
<property name="text">
|
||||
<string>Hide window title bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="3">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -228,7 +228,6 @@ namespace Oxygen
|
|||
|
||||
if( iter->regExp().indexIn( value ) < 0 ) continue;
|
||||
|
||||
|
||||
OxygenConfiguration configuration( defaultConfiguration() );
|
||||
|
||||
// propagate all features found in mask to the output configuration
|
||||
|
@ -237,7 +236,7 @@ namespace Oxygen
|
|||
if( iter->mask() & OxygenException::DrawSeparator ) configuration.setDrawSeparator( iter->drawSeparator() );
|
||||
if( iter->mask() & OxygenException::TitleOutline ) configuration.setDrawTitleOutline( iter->drawTitleOutline() );
|
||||
if( iter->mask() & OxygenException::SizeGripMode ) configuration.setSizeGripMode( iter->sizeGripMode() );
|
||||
|
||||
configuration.setHideTitleBar( iter->hideTitleBar() );
|
||||
return configuration;
|
||||
|
||||
}
|
||||
|
|
|
@ -166,6 +166,8 @@ namespace Oxygen
|
|||
void OxygenButton::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
|
||||
if( client_.configuration().hideTitleBar() ) return;
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setClipRect(this->rect().intersected( event->rect() ) );
|
||||
painter.setRenderHints(QPainter::Antialiasing);
|
||||
|
|
|
@ -224,13 +224,13 @@ namespace Oxygen
|
|||
|
||||
}
|
||||
|
||||
//___________________________________________
|
||||
//___________________________________________
|
||||
int OxygenClient::layoutMetric(LayoutMetric lm, bool respectWindowState, const KCommonDecorationButton *btn) const
|
||||
{
|
||||
|
||||
bool maximized( isMaximized() );
|
||||
int frameBorder( configuration().frameBorder() );
|
||||
int buttonSize( configuration().buttonSize() );
|
||||
int buttonSize( configuration().hideTitleBar() ? 0 : configuration().buttonSize() );
|
||||
|
||||
switch (lm)
|
||||
{
|
||||
|
@ -270,9 +270,15 @@ namespace Oxygen
|
|||
case LM_TitleEdgeTop:
|
||||
{
|
||||
int border = 0;
|
||||
if( !( respectWindowState && maximized ))
|
||||
if( frameBorder == OxygenConfiguration::BorderNone && configuration().hideTitleBar() )
|
||||
{
|
||||
|
||||
border = 0;
|
||||
|
||||
} else if( !( respectWindowState && maximized )) {
|
||||
|
||||
border = TFRAMESIZE;
|
||||
|
||||
}
|
||||
|
||||
return border;
|
||||
|
@ -952,23 +958,28 @@ namespace Oxygen
|
|||
painter.restore();
|
||||
}
|
||||
|
||||
// title bounding rect
|
||||
painter.setFont( options()->font(isActive(), false) );
|
||||
QRect boundingRect( titleBoundingRect( &painter, caption() ) );
|
||||
if( isActive() && configuration().drawTitleOutline() )
|
||||
if( !configuration().hideTitleBar() )
|
||||
{
|
||||
renderTitleOutline( &painter, boundingRect.adjusted(
|
||||
-layoutMetric( LM_TitleBorderLeft ),
|
||||
-layoutMetric( LM_TitleEdgeTop ),
|
||||
layoutMetric( LM_TitleBorderRight ), 0 ), palette );
|
||||
|
||||
// title bounding rect
|
||||
painter.setFont( options()->font(isActive(), false) );
|
||||
QRect boundingRect( titleBoundingRect( &painter, caption() ) );
|
||||
if( isActive() && configuration().drawTitleOutline() )
|
||||
{
|
||||
renderTitleOutline( &painter, boundingRect.adjusted(
|
||||
-layoutMetric( LM_TitleBorderLeft ),
|
||||
-layoutMetric( LM_TitleEdgeTop ),
|
||||
layoutMetric( LM_TitleBorderRight ), 0 ), palette );
|
||||
}
|
||||
|
||||
// title text
|
||||
renderTitleText( &painter, boundingRect, titlebarTextColor( backgroundPalette( widget(), palette ) ) );
|
||||
|
||||
// separator
|
||||
if( drawSeparator() ) renderSeparator(&painter, frame, widget(), color );
|
||||
|
||||
}
|
||||
|
||||
// title text
|
||||
renderTitleText( &painter, boundingRect, titlebarTextColor( backgroundPalette( widget(), palette ) ) );
|
||||
|
||||
// separator
|
||||
if( drawSeparator() ) renderSeparator(&painter, frame, widget(), color );
|
||||
|
||||
}
|
||||
|
||||
//_________________________________________________________________
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace Oxygen
|
|||
return
|
||||
( timeLineIsRunning() || isActive() ) &&
|
||||
configuration().drawSeparator() &&
|
||||
!configuration().hideTitleBar() &&
|
||||
!configuration().drawTitleOutline();
|
||||
}
|
||||
|
||||
|
@ -224,6 +225,7 @@ namespace Oxygen
|
|||
return
|
||||
configuration().useAnimations() &&
|
||||
!configuration().drawTitleOutline() &&
|
||||
!configuration().hideTitleBar() &&
|
||||
!isPreview();
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace Oxygen
|
|||
sizeGripMode_( SizeGripWhenNeeded ),
|
||||
drawSeparator_( false ),
|
||||
drawTitleOutline_( false ),
|
||||
hideTitleBar_( false ),
|
||||
useOxygenShadows_( true ),
|
||||
useAnimations_( true ),
|
||||
animationsDuration_( 150 )
|
||||
|
@ -86,6 +87,11 @@ namespace Oxygen
|
|||
OxygenConfig::DRAW_TITLE_OUTLINE,
|
||||
defaultConfiguration.drawTitleOutline() ) );
|
||||
|
||||
// hide title bar
|
||||
setHideTitleBar( group.readEntry(
|
||||
OxygenConfig::HIDE_TITLEBAR,
|
||||
defaultConfiguration.hideTitleBar() ) );
|
||||
|
||||
// oxygen shadows
|
||||
setUseOxygenShadows( group.readEntry(
|
||||
OxygenConfig::USE_OXYGEN_SHADOWS,
|
||||
|
@ -114,6 +120,7 @@ namespace Oxygen
|
|||
|
||||
group.writeEntry( OxygenConfig::DRAW_SEPARATOR, drawSeparator() );
|
||||
group.writeEntry( OxygenConfig::DRAW_TITLE_OUTLINE, drawTitleOutline() );
|
||||
group.writeEntry( OxygenConfig::HIDE_TITLEBAR, hideTitleBar() );
|
||||
group.writeEntry( OxygenConfig::USE_OXYGEN_SHADOWS, useOxygenShadows() );
|
||||
group.writeEntry( OxygenConfig::USE_ANIMATIONS, useAnimations() );
|
||||
group.writeEntry( OxygenConfig::ANIMATIONS_DURATION, animationsDuration() );
|
||||
|
@ -280,6 +287,7 @@ namespace Oxygen
|
|||
sizeGripMode() == other.sizeGripMode() &&
|
||||
drawSeparator() == other.drawSeparator() &&
|
||||
drawTitleOutline() == other.drawTitleOutline() &&
|
||||
hideTitleBar() == other.hideTitleBar() &&
|
||||
useOxygenShadows() == other.useOxygenShadows() &&
|
||||
useAnimations() == other.useAnimations() &&
|
||||
animationsDuration() == other.animationsDuration();
|
||||
|
|
|
@ -39,6 +39,7 @@ namespace OxygenConfig
|
|||
static const QString BLEND_COLOR = "BlendColor";
|
||||
static const QString SIZE_GRIP_MODE = "SizeGripMode";
|
||||
static const QString USE_OXYGEN_SHADOWS = "UseOxygenShadows";
|
||||
static const QString HIDE_TITLEBAR = "HideTitleBar";
|
||||
static const QString USE_ANIMATIONS = "UseAnimations";
|
||||
static const QString ANIMATIONS_DURATION = "AnimationsDuration";
|
||||
|
||||
|
@ -225,6 +226,14 @@ namespace Oxygen
|
|||
virtual void setDrawTitleOutline( bool value )
|
||||
{ drawTitleOutline_ = value; }
|
||||
|
||||
//! hide title bar
|
||||
virtual bool hideTitleBar( void ) const
|
||||
{ return hideTitleBar_; }
|
||||
|
||||
//! hide title bar
|
||||
virtual void setHideTitleBar( bool value )
|
||||
{ hideTitleBar_ = value; }
|
||||
|
||||
//! oxygen shadows
|
||||
virtual bool useOxygenShadows( void ) const
|
||||
{ return useOxygenShadows_; }
|
||||
|
@ -272,6 +281,9 @@ namespace Oxygen
|
|||
//! active window title outline
|
||||
bool drawTitleOutline_;
|
||||
|
||||
//! hide titlebar completely (but not window border)
|
||||
bool hideTitleBar_;
|
||||
|
||||
//! oxygen shadows
|
||||
bool useOxygenShadows_;
|
||||
|
||||
|
|
Loading…
Reference in a new issue