Commit 483ec8a3 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Revert "Added option to set transparency and blur behind menu frames such as...

Revert "Added option to set transparency and blur behind menu frames such as right click context menu, toolbar menu, etc."

This reverts commit 336cf7b6.
parent f697b073
......@@ -128,7 +128,6 @@ set(breeze_PART_SRCS
animations/breezewidgetstateengine.cpp
animations/breezewidgetstatedata.cpp
debug/breezewidgetexplorer.cpp
breezeblurhelper.cpp
breezeaddeventfilter.cpp
breezeframeshadow.cpp
breezehelper.cpp
......
......@@ -40,7 +40,7 @@
<!-- widget style -->
<group name="Style">
<!-- animations -->
<entry name="AnimationsEnabled" type="Bool">
<default>true</default>
......@@ -97,7 +97,7 @@
<entry name="ViewDrawFocusIndicator" type="Bool">
<default>true</default>
</entry>
<!-- sliders -->
<entry name="SliderDrawTickMarks" type="Bool">
<default>true</default>
......@@ -185,11 +185,6 @@
<default>false</default>
</entry>
<!-- transparency -->
<entry name="MenuOpacity" type="Int">
<default>100</default>
</entry>
</group>
</kcfg>
......@@ -30,7 +30,6 @@
#include "breezestyleconfigdata.h"
#include "breezewidgetexplorer.h"
#include "breezewindowmanager.h"
#include "breezeblurhelper.h"
#include <KColorUtils>
......@@ -153,7 +152,6 @@ namespace Breeze
, _helper( new Helper( "breeze" ) )
#else
, _helper( new Helper( StyleConfigData::self()->sharedConfig() ) )
, _blurHelper( new BlurHelper( this ) )
#endif
, _shadowHelper( new ShadowHelper( this, *_helper ) )
......@@ -319,12 +317,6 @@ namespace Breeze
setTranslucentBackground( widget );
#if !BREEZE_USE_KDE4
if ( _helper->hasAlphaChannel( widget ) && StyleConfigData::menuOpacity() < 100 ) {
_blurHelper->registerWidget( widget->window() );
}
#endif
#if QT_VERSION >= 0x050000
} else if( qobject_cast<QCommandLinkButton*>( widget ) ) {
......@@ -447,10 +439,6 @@ namespace Breeze
_windowManager->unregisterWidget( widget );
_splitterFactory->unregisterWidget( widget );
#if !BREEZE_USE_KDE4
_blurHelper->unregisterWidget( widget );
#endif
// remove event filter
if( qobject_cast<QAbstractScrollArea*>( widget ) ||
qobject_cast<QDockWidget*>( widget ) ||
......@@ -3621,6 +3609,7 @@ namespace Breeze
//___________________________________________________________________________________
bool Style::drawPanelMenuPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const
{
/*
* do nothing if menu is embedded in another widget
* this corresponds to having a transparent background
......@@ -3628,16 +3617,10 @@ namespace Breeze
if( widget && !widget->isWindow() ) return true;
const auto& palette( option->palette );
const auto background( _helper->frameBackgroundColor( palette ) );
const auto outline( _helper->frameOutlineColor( palette ) );
const bool hasAlpha( _helper->hasAlphaChannel( widget ) );
auto background( _helper->frameBackgroundColor( palette ) );
#if !BREEZE_USE_KDE4
if ( hasAlpha ) {
background.setAlphaF(StyleConfigData::menuOpacity() / 100.0);
}
#endif
const bool hasAlpha( _helper->hasAlphaChannel( widget ) );
_helper->renderMenuFrame( painter, option->rect, background, outline, hasAlpha );
return true;
......
......@@ -66,7 +66,6 @@ namespace Breeze
class SplitterFactory;
class WidgetExplorer;
class WindowManager;
class BlurHelper;
//* convenience typedef for base class
#if BREEZE_USE_KDE4
......@@ -498,9 +497,6 @@ namespace Breeze
//* keyboard accelerators
Mnemonics* _mnemonics = nullptr;
//* blur helper
BlurHelper* _blurHelper = nullptr;
//* window manager
WindowManager* _windowManager = nullptr;
......
......@@ -64,7 +64,6 @@ namespace Breeze
connect( _scrollBarAddLineButtons, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( _scrollBarSubLineButtons, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( _windowDragMode, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
connect( _menuOpacity, SIGNAL(valueChanged(int)), SLOT(updateChanged()) );
}
......@@ -85,8 +84,7 @@ namespace Breeze
StyleConfigData::setScrollBarSubLineButtons( _scrollBarSubLineButtons->currentIndex() );
StyleConfigData::setAnimationsEnabled( _animationsEnabled->isChecked() );
StyleConfigData::setAnimationsDuration( _animationsDuration->value() );
StyleConfigData::setWindowDragMode( _windowDragMode->currentIndex() );
StyleConfigData::setMenuOpacity( _menuOpacity->value() );
StyleConfigData::setWindowDragMode( _windowDragMode->currentIndex() );
#if BREEZE_USE_KDE4
StyleConfigData::self()->writeConfig();
......@@ -149,7 +147,6 @@ namespace Breeze
else if( _animationsEnabled->isChecked() != StyleConfigData::animationsEnabled() ) modified = true;
else if( _animationsDuration->value() != StyleConfigData::animationsDuration() ) modified = true;
else if( _windowDragMode->currentIndex() != StyleConfigData::windowDragMode() ) modified = true;
else if( _menuOpacity->value() != StyleConfigData::menuOpacity() ) modified = true;
emit changed(modified);
......@@ -174,7 +171,6 @@ namespace Breeze
_animationsEnabled->setChecked( StyleConfigData::animationsEnabled() );
_animationsDuration->setValue( StyleConfigData::animationsDuration() );
_windowDragMode->setCurrentIndex( StyleConfigData::windowDragMode() );
_menuOpacity->setValue( StyleConfigData::menuOpacity() );
}
......
......@@ -6,16 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>562</width>
<height>264</height>
<width>522</width>
<height>257</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
......@@ -183,7 +177,7 @@
<bool>false</bool>
</property>
<property name="text">
<string>A&amp;nimations duration:</string>
<string>Anima&amp;tions duration:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -386,140 +380,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Transparency</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="10" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="_menuOpacityTransparentLabel">
<property name="text">
<string>Transparent</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="_menuOpacityOpaqueLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Opaque</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="_menuGroupDescription">
<property name="text">
<string>Menu:</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="_menuOpacity">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>10</number>
</property>
<property name="value">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="0" colspan="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>542</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment