Author: coolo
Date: Wed Dec 19 19:17:37 2007
New Revision: 43192
URL: http://svn.opensuse.org/viewcvs/yast?rev=43192&view=rev
Log:
make the non-steps layout look similiar to the one with steps
Removed:
trunk/theme/openSUSE/wizard/Os103-installer-mockup.png
Modified:
trunk/qt/src/QY2Styler.cc
trunk/qt/src/QY2Styler.h
trunk/theme/openSUSE/wizard/background-1024x768.png
trunk/theme/openSUSE/wizard/style.qss
Modified: trunk/qt/src/QY2Styler.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/QY2Styler.cc?rev=43192&r1=43191&r2=43192&view=diff
==============================================================================
--- trunk/qt/src/QY2Styler.cc (original)
+++ trunk/qt/src/QY2Styler.cc Wed Dec 19 19:17:37 2007
@@ -6,6 +6,7 @@
#include <QWidget>
#include <QPainter>
#include <QSvgRenderer>
+#include <QDebug>
QY2Styler *QY2Styler::_self = 0;
@@ -39,7 +40,14 @@
line.replace( urlx, ": url(" + themeDir() + urlx.cap( 1 ) + ")");
if ( backgroundx.exactMatch( line ) )
- _backgroundFn[backgroundx.cap( 1 )] = themeDir() + backgroundx.cap( 2 );
+ {
+ QStringList name = backgroundx.cap( 1 ).split( '#' );
+ qDebug() << name;
+ _backgrounds[ name[0] ].filename = themeDir() + backgroundx.cap( 2 );
+ _backgrounds[ name[0] ].full = false;
+ if ( name.size() > 1 )
+ _backgrounds[ name[0] ].full = ( name[1] == "full" );
+ }
result += line;
}
@@ -63,34 +71,40 @@
if ( ev->type() != QEvent::Resize )
return QObject::eventFilter( obj, ev );
- if ( !_backgroundFn.contains( name ) )
+ qDebug( "eventFilter %s %s %d", qPrintable( name ), obj->metaObject()->className(), ev->type() );
+
+ if ( !_backgrounds.contains( name ) )
return QObject::eventFilter( obj, ev );
qDebug( "eventFilter %s %s %d", qPrintable( name ), obj->metaObject()->className(), ev->type() );
QWidget *wid = qobject_cast( obj );
- if ( !_backgroundPx.contains( name ) )
+ if ( _backgrounds[name].pix.isNull() )
{
- QString back = _backgroundFn[ name ];
- _backgroundPx[ name ] = QImage( back );
+ QString back = _backgrounds[ name ].filename;
+ _backgrounds[ name ].pix = QImage( back );
qDebug( "loading %s for %s", qPrintable( back ), qPrintable( name ) );
}
wid->setAutoFillBackground( true );
QPixmap result( wid->size() );
- if ( wid->contentsRect() != wid->rect() )
+ QRect fillRect = wid->contentsRect();
+ if ( _backgrounds[name].full )
+ fillRect = wid->rect();
+
+ if ( fillRect != wid->rect() )
result.fill( QColor( 0, 128, 0, 0 ) );
QPainter pain( &result );
- if ( !_backgroundFn[ name ].endsWith( ".svg" ) )
+ if ( !_backgrounds[ name ].filename.endsWith( ".svg" ) )
{
- QImage scaled = _backgroundPx[name].scaled( wid->contentsRect().width(), wid->contentsRect().height() );
- pain.drawImage( wid->contentsRect().topLeft(), scaled, QRectF(QPointF(0,0), scaled.size()), Qt::OrderedAlphaDither);
+ QImage scaled = _backgrounds[name].pix.scaled( fillRect.width(), fillRect.height() );
+ pain.drawImage( fillRect.topLeft(), scaled, QRectF(QPointF(0,0), scaled.size()), Qt::OrderedAlphaDither);
} else {
#if 0
QSvgRenderer rend( _backgroundFn[ name ] );
- rend.render( &pain, wid->contentsRect() );
+ rend.render( &pain, fillRect );
#endif
}
QPalette p = wid->palette();
Modified: trunk/qt/src/QY2Styler.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/QY2Styler.h?rev=43192&r1=43191&r2=43192&view=diff
==============================================================================
--- trunk/qt/src/QY2Styler.h (original)
+++ trunk/qt/src/QY2Styler.h Wed Dec 19 19:17:37 2007
@@ -29,8 +29,13 @@
bool eventFilter( QObject * obj, QEvent * ev );
private:
- QHash _backgroundFn;
- QHash _backgroundPx;
+ struct BackgrInfo {
+ QString filename;
+ QImage pix;
+ bool full;
+ };
+
+ QHash _backgrounds;
static QY2Styler *_self;
};
Modified: trunk/theme/openSUSE/wizard/background-1024x768.png
URL: http://svn.opensuse.org/viewcvs/yast/trunk/theme/openSUSE/wizard/background-1024x768.png?rev=43192&r1=43191&r2=43192&view=diff
==============================================================================
Binary files - no diff available.
Modified: trunk/theme/openSUSE/wizard/style.qss
URL: http://svn.opensuse.org/viewcvs/yast/trunk/theme/openSUSE/wizard/style.qss?rev=43192&r1=43191&r2=43192&view=diff
==============================================================================
--- trunk/theme/openSUSE/wizard/style.qss (original)
+++ trunk/theme/openSUSE/wizard/style.qss Wed Dec 19 19:17:37 2007
@@ -1,25 +1,28 @@
-/* Background: wizard background-1024x768.png */
+/* Background: wizard#full background-1024x768.png */
/* Background: work_area g22503.png */
/* Background: steps rect2174.png */
+#wizard {
+ padding-left: 30px;
+}
+
#work_area {
border-style: none;
- margin-top: 50px;
- margin-right: 110px;
- margin-bottom: 80px;
+ margin-top: 30px;
+ margin-right: 30px;
+ margin-bottom: 30px;
margin-left: 0px;
+ border: 10px;
}
#steps
{
border-style: none;
- padding-left: 20px;
+ padding-left: 0px;
padding-top: 10px;
margin-top: 60px;
- margin-left: 10px;
+ margin-left: 0px;
margin-bottom: 100px;
- min-width: 195px;
- max-width: 195px;
}
QPushButton {
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org