[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace
From: Marco Martin <notmart () gmail ! com>
Date: 2008-05-27 10:57:10
Message-ID: 1211885830.022886.16469.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 813283 by mart:
new BackgroundHint:
TranslucentBackground, now used by folder view.
when an applet has TranslucentBackground set, it loads
"widgets/tranlucentbackground" as its own background
when that svg does not exists in theh them it falls back to
"widgets/background" instead of translucentbackground of the default
theme
M +24 -10 libs/plasma/applet.cpp
M +3 -2 libs/plasma/applet.h
M +2 -0 plasma/containments/folderview/folderview.cpp
M +1 -0 plasma/desktoptheme/CMakeLists.txt
A plasma/desktoptheme/widgets/translucentbackground.svg
--- trunk/KDE/kdebase/workspace/libs/plasma/applet.cpp #813282:813283
@@ -540,20 +540,31 @@
d->backgroundHints = hints;
//Draw the standard background?
- if (hints & StandardBackground) {
+ if ((hints & StandardBackground) || (hints & TranslucentBackground)) {
if (!d->background) {
d->background = new Plasma::PanelSvg();
+ }
+
+ if (hints & TranslucentBackground) {
+ d->background->setImagePath("widgets/translucentbackground");
+
+ //FIXME: this fallback is an hack, an api like Plasma::Theme::hasImage() would be needed to \
make this clean + if \
(!Plasma::Theme::defaultTheme()->imagePath("widgets/translucentbackground").contains(Plasma::Theme::defaultTheme()->themeName())) \
{ + d->background->setImagePath("widgets/background");
+ }
+ } else {
d->background->setImagePath("widgets/background");
- d->background->setEnabledBorders(Plasma::PanelSvg::AllBorders);
- qreal left, top, right, bottom;
- d->background->getMargins(left, top, right, bottom);
- setContentsMargins(left, right, top, bottom);
- QSizeF fitSize(left + right, top + bottom);
- if (minimumSize().expandedTo(fitSize) != minimumSize()) {
- setMinimumSize(minimumSize().expandedTo(fitSize));
- }
- d->background->resizePanel(boundingRect().size());
}
+
+ d->background->setEnabledBorders(Plasma::PanelSvg::AllBorders);
+ qreal left, top, right, bottom;
+ d->background->getMargins(left, top, right, bottom);
+ setContentsMargins(left, right, top, bottom);
+ QSizeF fitSize(left + right, top + bottom);
+ if (minimumSize().expandedTo(fitSize) != minimumSize()) {
+ setMinimumSize(minimumSize().expandedTo(fitSize));
+ }
+ d->background->resizePanel(boundingRect().size());
} else if (d->background) {
qreal left, top, right, bottom;
d->background->getMargins(left, top, right, bottom);
@@ -1597,6 +1608,9 @@
void Applet::Private::themeChanged()
{
if (background) {
+ //do again the translucent background fallback
+ q->setBackgroundHints(backgroundHints);
+
qreal left;
qreal right;
qreal top;
--- trunk/KDE/kdebase/workspace/libs/plasma/applet.h #813282:813283
@@ -82,8 +82,9 @@
* Description on how draw a background for the applet
*/
enum BackgroundHint { NoBackground = 0 /** Not drawing a background under the applet, the applet \
has its own implementation */,
- StandardBackground /** The standard background from the theme is drawn */,
- ShadowedBackground /** The applet has a drop shadow */,
+ StandardBackground = 1 /** The standard background from the theme is drawn \
*/, + TranslucentBackground = 2 /** An alternate version of the background \
is drawn, usually more translucent */, + ShadowedBackground = 4 /** The \
applet has a drop shadow */,
DefaultBackground = StandardBackground | ShadowedBackground /** Default \
settings: both standard background and shadow */ };
Q_DECLARE_FLAGS(BackgroundHints, BackgroundHint)
--- trunk/KDE/kdebase/workspace/plasma/containments/folderview/folderview.cpp #813282:813283
@@ -312,6 +312,8 @@
//if (constraints & Plasma::FormFactorConstraint)
// setBackgroundHints(Applet::NoBackground);
+ setBackgroundHints(Applet::TranslucentBackground);
+
if ((constraints & Plasma::SizeConstraint) &&
columnsForWidth(contentsRect().width()) != m_columns)
{
--- trunk/KDE/kdebase/workspace/plasma/desktoptheme/CMakeLists.txt #813282:813283
@@ -18,6 +18,7 @@
widgets/tooltip.svg
widgets/clock.svg
widgets/pager.svg
+ widgets/translucentbackground.svg
widgets/systemtray.svg
widgets/tasks.svg
widgets/toolbox-button.svg
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic