merging in the first half of the branch - not compiling
authorcoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Mon, 3 Dec 2007 16:55:25 +0000 (16:55 +0000)
committercoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Mon, 3 Dec 2007 16:55:25 +0000 (16:55 +0000)
right now

git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/coolo/qt4-port@42629 e0cc52ee-31ee-0310-8b87-e83c4596d67c

13 files changed:
src/CMakeLists.txt
src/QHelpDialog.ui [new file with mode: 0644]
src/YQUI.h
src/YQUI_core.cc
src/YQWizard.cc
src/YQWizard.h
theme/background-1024x768.png [new file with mode: 0644]
theme/bottom-gradient.png [new file with mode: 0644]
theme/step-current.png [new file with mode: 0644]
theme/step-done.png [new file with mode: 0644]
theme/step-todo.png [new file with mode: 0644]
theme/steps-button.png [new file with mode: 0644]
theme/style.qss [new file with mode: 0644]

index b726c28..d9a7930 100644 (file)
@@ -31,6 +31,8 @@ SET(qt4_yast_plugin_SRCS
 
 QT4_AUTOMOC(${qt4_yast_plugin_SRCS})
 
+QT4_WRAP_UI(qt4_yast_plugin_SRCS QHelpDialog.ui)
+
 INCLUDE_DIRECTORIES( ${QT_INCLUDES} )
 INCLUDE_DIRECTORIES( ${YAST_INCLUDE_DIR} )
 INCLUDE_DIRECTORIES( ${YAST_INCLUDE_DIR}/yui )
@@ -47,8 +49,7 @@ SET_TARGET_PROPERTIES( py2qt4 PROPERTIES SOVERSION 2 )
 
 INSTALL(TARGETS py2qt4 LIBRARY DESTINATION ${YAST_PLUGIN_DIR} )
 
-ADD_SUBDIRECTORY(pkg)
-
+#ADD_SUBDIRECTORY(pkg)
 
 #SET_TARGET_PROPERTIES( y2lang_qt4 PROPERTIES PREFIX "" )
 
diff --git a/src/QHelpDialog.ui b/src/QHelpDialog.ui
new file mode 100644 (file)
index 0000000..25f6faf
--- /dev/null
@@ -0,0 +1,68 @@
+<ui version="4.0" >
+ <class>QHelpDialog</class>
+ <widget class="QDialog" name="QHelpDialog" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Help</string>
+  </property>
+  <layout class="QVBoxLayout" >
+   <item>
+    <layout class="QVBoxLayout" >
+     <item>
+      <widget class="QTextBrowser" name="textBrowser" />
+     </item>
+     <item>
+      <layout class="QHBoxLayout" >
+       <item>
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton" >
+         <property name="text" >
+          <string>Close</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>pushButton</sender>
+   <signal>clicked()</signal>
+   <receiver>QHelpDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>371</x>
+     <y>282</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>289</x>
+     <y>-15</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index 7752184..01504c5 100644 (file)
@@ -565,7 +565,7 @@ protected:
      * argument, so this needs to be embedded into something else - and a QVBox
      * at least handles all the sizeHint and resize stuff.
      **/
-    QFrame * _main_win;
+    QWidget * _main_win;
 
     /**
      * Stack for the Qt widgets inside the main window.
index 7e876ff..c251f7d 100644 (file)
@@ -26,6 +26,7 @@
 #include <QStackedWidget>
 #include <QDesktopWidget>
 #include <QThread>
+#include <QVBoxLayout>
 
 #include <ycp/YCPTerm.h>
 #include <ycp/YCPCode.h>
@@ -135,13 +136,17 @@ void YQUI::init_ui()
        wflags |= Qt::FramelessWindowHint;
     }
 
-    _main_win = new Q3VBox( 0, 0, wflags ); // parent, name, wflags
+    _main_win = new QWidget( 0, 0, wflags ); // parent, name, wflags
     _main_win->setFocusPolicy( Qt::StrongFocus );
 
     // Create widget stack for `opt(`defaultsize) dialogs
+    QVBoxLayout *vbox = new QVBoxLayout( _main_win );
+    vbox->setSpacing( 0 );
+    vbox->setMargin( 0 );
 
     _widget_stack = new QStackedWidget( _main_win );
     _widget_stack->setFocusPolicy( Qt::StrongFocus );
+    vbox->addWidget( _widget_stack );
 #if 0
     _main_win->installEventFilter( this );
 #endif
index f2d1da0..9e8aa3e 100644 (file)
@@ -29,6 +29,8 @@
 #include <string>
 #include <YShortcut.h>
 
+#include <QDialog>
+#include "ui_QHelpDialog.h"
 #include <q3hbox.h>
 #include <q3header.h>
 #include <qimage.h>
@@ -81,33 +83,6 @@ using std::string;
 
 #define TEXTDOMAIN "packages-qt"
 
-#define ENABLE_GRADIENTS               1
-
-#define USE_SEPARATOR                  1
-
-#define WORK_AREA_TOP_MARGIN           10
-
-#if ENABLE_GRADIENTS
-#  define WORK_AREA_BOTTOM_MARGIN      8
-#  define WORK_AREA_RIGHT_MARGIN       8
-#else
-#  define WORK_AREA_BOTTOM_MARGIN      8
-#  define WORK_AREA_RIGHT_MARGIN       6
-#endif
-
-#define BUTTON_BOX_TOP_MARGIN          10
-
-#define SEPARATOR_MARGIN               6
-#define STEPS_MARGIN                   10
-#define STEPS_SPACING                  2
-#define STEPS_HEADING_SPACING          8
-#define MENU_BAR_MARGIN                        8
-
-#define USE_FIXED_STEP_FONTS           0
-#define STEPS_FONT_FAMILY              "Sans Serif"
-#define STEPS_FONT_SIZE                        11
-#define STEPS_HEADING_FONT_SIZE                11
-
 #define USE_ICON_ON_HELP_BUTTON                0
 
 
@@ -126,10 +101,9 @@ YQWizard::YQWizard( YWidget *              parent,
     , _abortButtonLabel( abortButtonLabel )
     , _nextButtonLabel( nextButtonLabel )
 {
-    QVBoxLayout* layout = new QVBoxLayout( this );
+    QHBoxLayout* layout = new QHBoxLayout( this );
     layout->setSpacing( 0 );
     layout->setMargin( 0 );
-    setLayout( layout );
 
     setWidgetRep( this );
 
@@ -141,24 +115,18 @@ YQWizard::YQWizard( YWidget *             parent,
 
     _sideBar           = 0;
     _stepsPanel                = 0;
-    _stepsBox          = 0;
-    _stepsGrid         = 0;
     _helpButton                = 0;
     _stepsButton       = 0;
     _treeButton                = 0;
     _releaseNotesButton = 0;
     _treePanel         = 0;
     _tree              = 0;
-    _helpPanel         = 0;
-    _helpBrowser       = 0;
     _clientArea                = 0;
-    _menuBarBox                = 0;
     _menuBar           = 0;
     _dialogIcon                = 0;
     _dialogHeading     = 0;
     _contents          = 0;
     _backButton                = 0;
-    _backButtonSpacer  = 0;
     _abortButton       = 0;
     _nextButton                = 0;
     _sendButtonEvents  = true;
@@ -169,46 +137,10 @@ YQWizard::YQWizard( YWidget *             parent,
 
     YQUI::setTextdomain( TEXTDOMAIN );
 
+    //layoutTitleBar( this );
 
-    //
-    // Load graphics
-    //
-
-#if ENABLE_GRADIENTS
-    loadGradientPixmaps();
-#endif
-
-    if ( _stepsEnabled )
-       loadStepsIcons();
-
-
-    //
-    // Create widgets
-    //
-
-
-    if ( ! _titleBarGradientPixmap.isNull() )
-    {
-       layoutTitleBar( this );
-    }
-    else
-    {
-       QWidget * spacer = addVSpacing( this, WORK_AREA_TOP_MARGIN );
-       Q_CHECK_PTR( spacer );
-
-#      if ENABLE_GRADIENTS
-           spacer->setPaletteBackgroundColor( _gradientTopColor );
-#      endif
-    }
-
-    Q3HBox * hBox = new Q3HBox( this );
-    YUI_CHECK_NEW( hBox );
-    layout->addWidget( hBox );
-
-    layoutSideBar( hBox );
-    layoutWorkArea( hBox );
-
-    y2debug( "Constructor finished." );
+    layout->addLayout( layoutSideBar( this ) );
+    layout->addLayout( layoutWorkArea( this ) );
 }
 
 
@@ -222,22 +154,9 @@ YQWizard::~YQWizard()
 
 void YQWizard::layoutTitleBar( QWidget * parent )
 {
-    if ( ! highColorDisplay() )                // 8 bit display or worse?
-    {
-       // No colorful title bar, just a spacing to match the one at the bottom.
-       addVSpacing( parent, WORK_AREA_BOTTOM_MARGIN );
-
-       return;
-    }
-
-
     Q3HBox * titleBar = new Q3HBox( parent );
     YUI_CHECK_NEW( titleBar );
 
-#if ENABLE_GRADIENTS
-    setGradient( titleBar, _titleBarGradientPixmap );
-#endif
-
     titleBar->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert
 
     //
@@ -283,7 +202,7 @@ void YQWizard::layoutTitleBar( QWidget * parent )
 
 
 
-void YQWizard::layoutSideBar( QWidget * parent )
+QLayout *YQWizard::layoutSideBar( QWidget * parent )
 {
     _sideBar = new Q3WidgetStack( parent );
     YUI_CHECK_NEW( _sideBar );
@@ -291,6 +210,8 @@ void YQWizard::layoutSideBar( QWidget * parent )
     _sideBar->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) ); // hor/vert
     _sideBar->setMargin( 0 );
 
+    QVBoxLayout *vbox = new QVBoxLayout( );
+    vbox->addWidget( _sideBar );
 
     layoutHelpPanel();
 
@@ -304,101 +225,29 @@ void YQWizard::layoutSideBar( QWidget * parent )
        layoutStepsPanel();
        showSteps();
     }
-}
-
 
+    return vbox;
+}
 
 void YQWizard::layoutStepsPanel()
 {
-    _stepsPanel = new Q3VBox( _sideBar );
-    YUI_CHECK_NEW( _stepsPanel );
-
-
-#if ENABLE_GRADIENTS
-    if ( ! _titleBarGradientPixmap.isNull() )
-    {
-       // Top gradient
-
-       QLabel * topGradient = new QLabel( _stepsPanel );
-       Q_CHECK_PTR( topGradient );
-       setGradient( topGradient, _topGradientPixmap );
-    }
-#endif
-
-
     // Steps
-
+    _stepsPanel = new QWidget( _sideBar );
     _sideBar->addWidget( _stepsPanel );
 
-    _stepsBox = new Q3VBox( _stepsPanel );
-    YUI_CHECK_NEW( _stepsBox );
-#if ENABLE_GRADIENTS
-    _stepsBox->setPaletteBackgroundColor( _gradientCenterColor );
-#endif
-    _stepsBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); // hor/vert
-
-    QWidget * stretch = addVStretch( _stepsPanel );
-    YUI_CHECK_NEW( stretch );
-#if ENABLE_GRADIENTS
-    stretch->setPaletteBackgroundColor( _gradientCenterColor );
-#endif
-
-
     // Steps panel bottom buttons ("Help", "Release Notes")
 
-    QLabel * helpButtonBox = new QLabel( _stepsPanel );
-
-#if ENABLE_GRADIENTS
-    YUI_CHECK_NEW( helpButtonBox );
-    setGradient( helpButtonBox, _bottomGradientPixmap );
-#endif
-
-
-
     // Layouts for the buttons
 
-    QVBoxLayout * vbox = new QVBoxLayout( helpButtonBox, 0, 0 ); // parent, margin, spacing
-    YUI_CHECK_NEW( vbox );
-    vbox->addStretch( 99 );
-
-
-    QHBoxLayout * hbox = new QHBoxLayout( vbox, 0 );   // parent, spacing
-    hbox->addStretch( 99 );
-
-    _releaseNotesButton = new QPushButton( _( "Release Notes..." ), helpButtonBox );
-    hbox->addWidget( _releaseNotesButton );
-
+    _releaseNotesButton = new QPushButton( _( "Release Notes..." ), _stepsPanel );
+    _releaseNotesButton->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ) ); // hor/vert
 
     connect( _releaseNotesButton,      SIGNAL( clicked()  ),
             this,                      SLOT  ( releaseNotesClicked() ) );
 
     _releaseNotesButton->hide();       // hidden until showReleaseNotesButton() is called
 
-    hbox->addStretch( 99 );
-    vbox->addStretch( 99 );
-
-    hbox = new QHBoxLayout( vbox, 0 ); // parent, spacing
-    hbox->addStretch( 99 );
-
-    // Help button - intentionally without keyboard shortcut
-    _helpButton = new QPushButton( _( "Help" ), helpButtonBox );
-    YUI_CHECK_NEW( _helpButton );
-
-    hbox->addWidget( _helpButton );
-    hbox->addStretch( 99 );
-
-    connect( _helpButton, SIGNAL( clicked()  ),
-            this,       SLOT  ( showHelp() ) );
-
-#if USE_ICON_ON_HELP_BUTTON
-    QPixmap pixmap = QPixmap( PIXMAP_DIR "help-button.png" );
-
-    if ( ! pixmap.isNull() )
-       _helpButton->setPixmap( pixmap );
-#endif
-
-
-    vbox->addSpacing( WORK_AREA_BOTTOM_MARGIN );
+    _stepsDirty = true; // no layout yet
 }
 
 
@@ -447,66 +296,25 @@ void YQWizard::addStepHeading( const string & text )
 
 void YQWizard::updateSteps()
 {
-    if ( ! _stepsBox )
+    if ( ! _stepsPanel )
        return;
 
-    //
-    // Delete any previous step widgets
-    //
-
-    if ( _stepsGrid )
-    {
-       delete _stepsGrid->mainWidget();
-       _stepsGrid = 0;
-    }
-
-
-    //
-    // Create a new parent widget for the steps
-    //
-
-    QWidget * stepsParent = new QWidget( _stepsBox );
-    YUI_CHECK_NEW( stepsParent );
-    stepsParent->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); // hor/vert
-#if ENABLE_GRADIENTS
-    stepsParent->setPaletteBackgroundColor( _gradientCenterColor );
-#endif
-
     // Create a grid layout for the steps
+    QVBoxLayout *_stepsVBox = new QVBoxLayout( _stepsPanel );
 
-    _stepsGrid = new QGridLayout(stepsParent);
-                                 //_stepsList.count(), 4,      // rows, cols
-    _stepsGrid->setMargin(0);
-    _stepsGrid->setSpacing(STEPS_SPACING);
+    QGridLayout *_stepsGrid = new QGridLayout( );
     YUI_CHECK_NEW( _stepsGrid );
+    _stepsVBox->addLayout( _stepsGrid );
+    _stepsGrid->setColumnMinimumWidth( 0, 10 );
+    _stepsGrid->setRowStretch( 0, 1 );
+    _stepsGrid->setRowStretch( 1, 1 );
+    _stepsGrid->setRowStretch( 2, 99 );
 
     const int statusCol = 1;
     const int nameCol  = 2;
 
-    _stepsGrid->setColStretch( 0, 99 );                // Left margin column - stretch
-    _stepsGrid->setColStretch( statusCol, 0 ); // Status column - don't stretch
-    _stepsGrid->setColStretch( nameCol,          0 );  // Name column - don't stretch
-    _stepsGrid->setColStretch( 3, 99  );       // Left margin column - stretch
-
-
-    // Work around Qt bug: Grid layout only works right if the parent widget isn't visible.
-    stepsParent->hide();
-
-    //
-    // Add left and right (but not top and bottom) margins
-    //
-
     int row = 0;
 
-    QWidget * leftSpacer  = addHSpacing( stepsParent, STEPS_MARGIN );
-    YUI_CHECK_NEW( leftSpacer );
-    _stepsGrid->addWidget( leftSpacer, row, 0 );
-
-    QWidget * rightSpacer = addHSpacing( stepsParent, STEPS_MARGIN );
-    YUI_CHECK_NEW( rightSpacer );
-    _stepsGrid->addWidget( rightSpacer, row, 3 );
-
-
     //
     // Create widgets for all steps and step headings in the internal list
     //
@@ -517,38 +325,14 @@ void YQWizard::updateSteps()
     {
        if ( step->isHeading() )
        {
-           if ( row > 0 )
-           {
-               // Spacing
-
-               QWidget * spacer = addVSpacing( stepsParent, STEPS_HEADING_SPACING );
-               YUI_CHECK_NEW( spacer );
-               _stepsGrid->addWidget( spacer, row++, nameCol );
-           }
-
            //
            // Heading
            //
 
-           QLabel * label = new QLabel( step->name(), stepsParent );
+           QLabel * label = new QLabel( step->name(), _stepsPanel );
            YUI_CHECK_NEW( label );
            label->setAlignment( Qt::AlignLeft | Qt::AlignTop );
-
-#if USE_FIXED_STEP_FONTS
-           QFont font( STEPS_FONT_FAMILY, STEPS_HEADING_FONT_SIZE );
-           font.setWeight( QFont::Bold );
-           label->setFont( font );
-#else
-           QFont font = YQUI::yqApp()->currentFont();
-
-           int size = font.pointSize();
-
-           if ( size > 1 )
-               font.setPointSize( size + 2 );
-
-           font.setBold( true );
-           label->setFont( font );
-#endif
+            label->setProperty( "class", "steps_heading" );
 
            step->setNameLabel( label );
            _stepsGrid->addMultiCellWidget( label,
@@ -561,27 +345,21 @@ void YQWizard::updateSteps()
            // Step status
            //
 
-           QLabel * statusLabel = new QLabel( stepsParent );
+           QLabel * statusLabel = new QLabel( _stepsPanel );
            YUI_CHECK_NEW( statusLabel );
 
            step->setStatusLabel( statusLabel );
+            statusLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
            _stepsGrid->addWidget( statusLabel, row, statusCol );
 
-
            //
            // Step name
            //
 
-           QLabel * nameLabel = new QLabel( step->name(), stepsParent );
+           QLabel * nameLabel = new QLabel( step->name(), _stepsPanel );
            YUI_CHECK_NEW( nameLabel );
            nameLabel->setAlignment( Qt::AlignLeft | Qt::AlignTop );
 
-#if USE_FIXED_STEP_FONTS
-           nameLabel->setFont( QFont( STEPS_FONT_FAMILY, STEPS_FONT_SIZE ) );
-#else
-           nameLabel->setFont( YQUI::yqApp()->currentFont() );
-#endif
-
            step->setNameLabel( nameLabel );
            _stepsGrid->addWidget( nameLabel, row, nameCol );
        }
@@ -590,8 +368,13 @@ void YQWizard::updateSteps()
        row++;
     }
 
-    _stepsGrid->activate();
-    stepsParent->show();
+    _stepsVBox->addStretch( 99 );
+    QVBoxLayout *rbl = new QVBoxLayout();
+    rbl->addWidget( _releaseNotesButton, 0, Qt::AlignCenter );
+
+    _stepsVBox->addLayout( rbl );
+    _stepsVBox->addStretch( 29 );
+
     _stepsDirty = false;
 }
 
@@ -607,8 +390,7 @@ void YQWizard::updateStepStates()
     if ( currentStep )
     {
        // Set status icon and color for the current step
-       setStepStatus( currentStep, _stepCurrentIcon, _stepCurrentColor );
-
+       currentStep->setStatus( Step::Current );
 
        //
        // Set all steps before the current to "done"
@@ -616,7 +398,7 @@ void YQWizard::updateStepStates()
 
        while ( step && step != currentStep )
        {
-           setStepStatus( step, _stepDoneIcon, _stepDoneColor );
+           step->setStatus( Step::Done );
            step = _stepsList.next();
        }
 
@@ -632,25 +414,11 @@ void YQWizard::updateStepStates()
 
     while ( step )
     {
-       setStepStatus( step, _stepToDoIcon, _stepToDoColor );
+       step->setStatus( Step::Todo );
        step = _stepsList.next();
     }
 }
 
-
-void YQWizard::setStepStatus( YQWizard::Step * step, const QPixmap & icon, const QColor & color )
-{
-    if ( step )
-    {
-       if ( step->nameLabel() )
-           step->nameLabel()->setPaletteForegroundColor( color );
-
-       if ( step->statusLabel() )
-           step->statusLabel()->setPixmap( icon );
-    }
-}
-
-
 void YQWizard::setCurrentStep( const string & id )
 {
     _currentStepID = fromUTF8( id );
@@ -676,52 +444,11 @@ YQWizard::Step * YQWizard::findStep( const QString & id )
 
 void YQWizard::layoutHelpPanel()
 {
-    _helpPanel = new Q3HBox( _sideBar );
-    YUI_CHECK_NEW( _helpPanel );
-    _sideBar->addWidget( _helpPanel );
-
-    addGradientColumn( _helpPanel );
-
-    Q3VBox * vbox = new Q3VBox( _helpPanel );
-    YUI_CHECK_NEW( vbox );
-
-
-    // Help browser
-
-    _helpBrowser = new Q3TextBrowser( vbox );
-    YUI_CHECK_NEW( _helpBrowser );
-
-    _helpBrowser->setMimeSourceFactory( 0 );
-    _helpBrowser->installEventFilter( this );
-    _helpBrowser->setTextFormat( Qt::RichText );
-    _helpBrowser->setMargin( 4 );
-    _helpBrowser->setResizePolicy( Q3ScrollView::Manual );
-
-
-    // Set help browser text color
-    QPixmap fgPixmap = QPixmap( PIXMAP_DIR "help-text-color.png" );
-    if (! fgPixmap.isNull() )
-       _helpBrowser->setPaletteForegroundColor( pixelColor( fgPixmap, 0, 0, paletteForegroundColor() ) );
-
-
-    if ( highColorDisplay() )
-    {
-       // Set fancy help browser background pixmap
-
-       QPixmap bgPixmap( PIXMAP_DIR "help-background.png" );
-
-       if ( ! bgPixmap.isNull() )
-           _helpBrowser->setPaletteBackgroundPixmap( bgPixmap );
-    }
-
-
-
     //
     // Button box with bottom gradient
     //
 
-
-    QLabel * buttonBox = new QLabel( vbox );
+    QLabel * buttonBox = new QLabel( _sideBar );
     YUI_CHECK_NEW( buttonBox );
 
     QPushButton * button;
@@ -734,9 +461,7 @@ void YQWizard::layoutHelpPanel()
        YUI_CHECK_NEW( button );
        _treeButton = button;
 
-#if USE_ICON_ON_HELP_BUTTON
        pixmap = QPixmap( PIXMAP_DIR "tree-button.png" );
-#endif
     }
     else
        if ( _stepsEnabled )
@@ -746,9 +471,7 @@ void YQWizard::layoutHelpPanel()
        YUI_CHECK_NEW( button );
        _stepsButton = button;
 
-#if USE_ICON_ON_HELP_BUTTON
        pixmap = QPixmap( PIXMAP_DIR "steps-button.png" );
-#endif
     }
     else
     {
@@ -758,8 +481,10 @@ void YQWizard::layoutHelpPanel()
     }
 
 
+#if USE_ICON_ON_HELP_BUTTON
     if ( ! pixmap.isNull() )
        button->setPixmap( pixmap );
+#endif
 
     layoutSideBarButtonBox( buttonBox, button );
 
@@ -778,8 +503,6 @@ void YQWizard::layoutHelpPanel()
        // Hide the dummy button - the button box height is fixed now.
        button->hide();
     }
-
-    addGradientColumn( _helpPanel );
 }
 
 
@@ -788,7 +511,6 @@ void YQWizard::layoutSideBarButtonBox( QWidget * parent, QPushButton * button )
 {
     QVBoxLayout * vbox = new QVBoxLayout( parent, 0, 0 );      // parent, margin, spacing
     YUI_CHECK_NEW( vbox );
-    vbox->addSpacing( BUTTON_BOX_TOP_MARGIN );
 
     QHBoxLayout * hbox = new QHBoxLayout( vbox, 0 );           // parent, spacing
     YUI_CHECK_NEW( hbox );
@@ -796,19 +518,6 @@ void YQWizard::layoutSideBarButtonBox( QWidget * parent, QPushButton * button )
     hbox->addStretch( 99 );
     hbox->addWidget( button );
     hbox->addStretch( 99 );
-
-    vbox->addSpacing( WORK_AREA_BOTTOM_MARGIN );
-
-    // For whatever strange reason, parent->sizeHint() does not return anything
-    // meaningful yet - not even after vbox->activate() or parent->adjustSize()
-    int height = button->sizeHint().height() + BUTTON_BOX_TOP_MARGIN + WORK_AREA_BOTTOM_MARGIN;
-
-#if ENABLE_GRADIENTS
-    if ( ! _bottomGradientPixmap.isNull() )
-       setBottomCroppedGradient( parent, _bottomGradientPixmap, height );
-#endif
-
-    parent->setFixedHeight( height );
 }
 
 
@@ -819,9 +528,6 @@ void YQWizard::layoutTreePanel()
     YUI_CHECK_NEW( _treePanel );
     _sideBar->addWidget( _treePanel );
 
-    // Left margin (with gradients)
-    addGradientColumn( _treePanel );
-
     Q3VBox * vbox = new Q3VBox( _treePanel );
     YUI_CHECK_NEW( vbox );
 
@@ -870,9 +576,6 @@ void YQWizard::layoutTreePanel()
     connect( button, SIGNAL( clicked() ),
             this,   SLOT  ( showHelp() ) );
 
-
-    // Right margin (with gradients)
-    addGradientColumn( _treePanel );
 }
 
 
@@ -987,100 +690,53 @@ string YQWizard::currentTreeSelection()
 
 
 
-void YQWizard::layoutWorkArea( QFrame * parentHBox )
+QLayout *YQWizard::layoutWorkArea( QFrame * parent )
 {
-    Q3VBox * workAreaVBox = new Q3VBox( parentHBox );
-    YUI_CHECK_NEW( workAreaVBox );
-
-    // An extra QVBox inside the workAreaVBox is needed for frame and margin
-
-    Q3VBox * workArea = new Q3VBox( workAreaVBox );
-    YUI_CHECK_NEW( workArea );
-
-#if ENABLE_GRADIENTS
-    workArea->setFrameStyle( QFrame::Box | QFrame::Plain );
-    workArea->setMargin( 4 );
-#else
-    workArea->setFrameStyle( QFrame::Box | QFrame::Sunken );
-    // workArea->setFrameStyle( QFrame::TabWidgetPanel | QFrame::Sunken );
-#endif
-
-
-    //
-    // Menu bar
-    //
-
-    // Placed directly inside workArea the menu bar positions itself at (0,0)
-    // and so obscures any kind of frame there might be.
-    _menuBarBox = new Q3VBox( workArea );
-    YUI_CHECK_NEW( _menuBarBox );
+    QVBoxLayout *vbox = new QVBoxLayout();
 
-    _menuBar = new QMenuBar( _menuBarBox );
+    _menuBar = new QMenuBar( parent );
     YUI_CHECK_NEW( _menuBar );
 
-    _menuBarBox->hide(); // will be made visible when menus are added
-
+    _menuBar->hide(); // will be made visible when menus are added
+    vbox->addWidget( _menuBar );
 
     //
     // Dialog icon and heading
     //
 
-    Q3HBox * headingHBox = new Q3HBox( workArea );
+    QHBoxLayout * headingHBox = new QHBoxLayout();
     YUI_CHECK_NEW( headingHBox );
-    headingHBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
-
-    addHSpacing( headingHBox, SEPARATOR_MARGIN );
+    //headingHBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
+    vbox->addLayout( headingHBox );
 
-    _dialogIcon = new QLabel( headingHBox );
+    _dialogIcon = new QLabel( parent );
     YUI_CHECK_NEW( _dialogIcon );
+    headingHBox->addWidget( _dialogIcon );
     _dialogIcon->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert
+    _dialogIcon->setObjectName( "DialogIcon" );
 
-    addHSpacing( headingHBox );
-
-    _dialogHeading = new QLabel( headingHBox );
+    _dialogHeading = new QLabel( parent );
     YUI_CHECK_NEW( _dialogHeading );
-    _dialogHeading->setFont( YQUI::yqApp()->headingFont() );
+    headingHBox->addWidget( _dialogHeading );
     _dialogHeading->setAlignment( Qt::AlignLeft | Qt::WordBreak );
     _dialogHeading->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
-
-#if 0
-    addHStretch( headingHBox );
-#endif
-    addVSpacing( workArea );
-
-#if USE_SEPARATOR
-
-    Q3HBox * hbox = new Q3HBox( workArea );
-
-    addHSpacing( hbox, SEPARATOR_MARGIN );
-
-    QFrame * separator = new QFrame( hbox );
-    YUI_CHECK_NEW( separator );
-    separator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
-
-    addHSpacing( hbox, SEPARATOR_MARGIN );
-    addVSpacing( workArea );
-#endif
+    _dialogHeading->setObjectName( "DialogHeading" );
 
     //
     // Client area (the part that belongs to the YCP application)
     //
 
-    layoutClientArea( workArea );
-
+    layoutClientArea( parent );
+    vbox->addWidget( _clientArea );
 
     //
     // Button box
     //
 
-    layoutButtonBox( workAreaVBox );
-
-
-    //
-    // Spacer (purely decorative) at the right of the client area
-    //
+    QLayout *bb = layoutButtonBox( parent );
+    vbox->addLayout( bb );
 
-    addGradientColumn( parentHBox, WORK_AREA_RIGHT_MARGIN );
+    return vbox;
 }
 
 
@@ -1089,12 +745,7 @@ void YQWizard::layoutClientArea( QWidget * parent )
 {
     _clientArea = new Q3VBox( parent );
     YUI_CHECK_NEW( _clientArea );
-    _clientArea->setMargin( 4 );
-
-#if 0
-    _clientArea->setPaletteBackgroundColor( QColor( 0x60, 0x60, 0x60 ) );
-#endif
-
+    _clientArea->layout()->setMargin( 4 );
 
     //
     // HVCenter for wizard contents
@@ -1108,7 +759,6 @@ void YQWizard::layoutClientArea( QWidget * parent )
     _contents->installEventFilter( this );
     _contents->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); // hor/vert
 
-
     //
     // Replace point for wizard contents
     //
@@ -1121,293 +771,92 @@ void YQWizard::layoutClientArea( QWidget * parent )
 
     YUI::widgetFactory()->createEmpty( _contentsReplacePoint );
     _contentsReplacePoint->showChild();
+
 }
 
 
 
-void YQWizard::layoutButtonBox( QWidget * parent )
+QLayout *YQWizard::layoutButtonBox( QWidget * parent )
 {
-    //
-    // Button box and layout
-    //
-
-    QWidget * buttonBox = new QWidget( parent );
-    YUI_CHECK_NEW( buttonBox );
-
-    // Using old-style layouts to enable a seamless background with the
-    // gradient pixmap: Any sub-widgets (Q3VBox, QHBox) would have to get yet
-    // another portion of that gradient as their backround pixmap, and it would
-    // be very hard to cover all cases - resizing, hiding individual buttons, etc.
-
-    QVBoxLayout * vbox = new QVBoxLayout( buttonBox, 0, 0 );   // parent, margin, spacing
-    YUI_CHECK_NEW( vbox );
-
-    vbox->addSpacing( BUTTON_BOX_TOP_MARGIN );
-
-
     //
     // QHBoxLayout for the buttons
     //
 
-    QHBoxLayout * hbox = new QHBoxLayout( vbox, 2 );           // parent, spacing
+    QHBoxLayout * hbox = new QHBoxLayout();            // parent, spacing
     YUI_CHECK_NEW( hbox );
 
+    hbox->setSpacing( 5 );
+    hbox->setMargin( 5 );
 
-    //
-    // "Back" button
-    //
-
-    _backButton         = new YQWizardButton( this, buttonBox, _backButtonLabel );
-    YUI_CHECK_NEW( _backButton );
-
-    hbox->addWidget( (QWidget *) _backButton->widgetRep() );
-    connect( _backButton,      SIGNAL( clicked()               ),
-            this,              SLOT  ( slotBackClicked()       ) );
 
-    _backButtonSpacer = new QSpacerItem( 0, 0,                         // width, height
-                                        QSizePolicy::Expanding,        // horizontal
-                                        QSizePolicy::Minimum );        // vertical
-    YUI_CHECK_NEW( _backButtonSpacer );
-    hbox->addItem( _backButtonSpacer );
+    // Help button - intentionally without keyboard shortcut
+    _helpButton = new QPushButton( _( "Help" ), parent );
+    YUI_CHECK_NEW( _helpButton );
 
+    connect( _helpButton, SIGNAL( clicked()  ),
+            this,       SLOT  ( showHelp() ) );
 
-    if ( _backButton->text().isEmpty() )
-    {
-       _backButton->hide();
+#if USE_ICON_ON_HELP_BUTTON
+    QPixmap pixmap = QPixmap( PIXMAP_DIR "help-button.png" );
 
-       // Minimize _backButtonSpacer
-       _backButtonSpacer->changeSize( 0, 0,                            // width, height
-                                      QSizePolicy::Minimum,            // horizontal
-                                      QSizePolicy::Minimum );          // vertical
-    }
+    if ( ! pixmap.isNull() )
+       _helpButton->setPixmap( pixmap );
+#endif
+    hbox->addWidget( _helpButton );
 
+    hbox->addStretch( 10 );
 
     //
     // "Abort" button
     //
 
-    _abortButton = new YQWizardButton( this, buttonBox, _abortButtonLabel );
+    _abortButton = new YQWizardButton( this, parent, _abortButtonLabel );
     YUI_CHECK_NEW( _abortButton );
 
     hbox->addWidget( (QWidget *) _abortButton->widgetRep() );
     connect( _abortButton,     SIGNAL( clicked()               ),
             this,              SLOT  ( slotAbortClicked()      ) );
 
+    hbox->addSpacing( 10 );
 
-    // Using spacer rather than addSpacing() since the default stretchability
-    // of a QSpacerItem is undefined, i.e. centering the middle button could
-    // not be guaranteed.
+    //
+    // "Back" button
+    //
 
-    QSpacerItem * spacer = new QSpacerItem( 0, 0,                      // width, height
-                                           QSizePolicy::Expanding,     // horizontal
-                                           QSizePolicy::Minimum );     // vertical
-    YUI_CHECK_NEW( spacer );
-    hbox->addItem( spacer );
+    _backButton         = new YQWizardButton( this, parent, _backButtonLabel );
+    YUI_CHECK_NEW( _backButton );
+
+    hbox->addWidget( (QWidget *) _backButton->widgetRep() );
+    connect( _backButton,      SIGNAL( clicked()               ),
+            this,              SLOT  ( slotBackClicked()       ) );
 
+    if ( _backButton->text().isEmpty() )
+       _backButton->hide();
 
     //
     // "Next" button
     //
 
-    _nextButton         = new YQWizardButton( this, buttonBox, _nextButtonLabel );
+    _nextButton         = new YQWizardButton( this, parent, _nextButtonLabel );
     YUI_CHECK_NEW( _nextButton );
 
     hbox->addWidget( (QWidget *) _nextButton->widgetRep() );
     connect( _nextButton,      SIGNAL( clicked()               ),
             this,              SLOT  ( slotNextClicked()       ) );
 
-
-    //
-    // Bottom margin and gradient
-    //
-
-    vbox->addSpacing( WORK_AREA_BOTTOM_MARGIN );
-
-#if ENABLE_GRADIENTS
-    setBottomCroppedGradient( buttonBox, _bottomGradientPixmap, buttonBox->sizeHint().height() );
-#endif
-
-    buttonBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) ); // hor/vert
-}
-
-
-
-void YQWizard::loadGradientPixmaps()
-{
-#if ENABLE_GRADIENTS
-    if ( highColorDisplay() )
-    {
-       _topGradientPixmap      = QPixmap( PIXMAP_DIR "top-gradient.png"        );
-       _bottomGradientPixmap   = QPixmap( PIXMAP_DIR "bottom-gradient.png"     );
-       _titleBarGradientPixmap = QPixmap( PIXMAP_DIR "title-bar-gradient.png"  );
-       _gradientCenterColor    = pixelColor( _bottomGradientPixmap, 0, 0, paletteBackgroundColor() );
-       _gradientTopColor       = pixelColor( _topGradientPixmap, 0, 0 , paletteBackgroundColor() );
-    }
-    else // 8 bit display or worse - don't use gradients
-    {
-       // Gradient pixmaps remain empty. The respecive widgets will retain the
-       // default widget background (grey, depending on the widget theme).
-
-       // Use deault widget background (some shade of grey) for the center
-       // stretchable part of the side bar.
-       _gradientCenterColor = paletteBackgroundColor();
-       _gradientTopColor = paletteBackgroundColor();
-    }
-#endif
-}
-
-
-void YQWizard::loadStepsIcons()
-{
-    _stepCurrentIcon   = YQIconPool::stepCurrent();
-    _stepToDoIcon      = YQIconPool::stepToDo();
-    _stepDoneIcon      = YQIconPool::stepDone();
-
-    if ( highColorDisplay() )
-    {
-       _stepCurrentColor       = pixelColor( QPixmap( PIXMAP_DIR "color-step-current.png" ), 0, 0, paletteForegroundColor() );
-       _stepToDoColor          = pixelColor( QPixmap( PIXMAP_DIR "color-step-todo.png"    ), 0, 0, paletteForegroundColor() );
-       _stepDoneColor          = pixelColor( QPixmap( PIXMAP_DIR "color-step-done.png"    ), 0, 0, paletteForegroundColor() );
-    }
-    else
-    {
-       _stepCurrentColor       = paletteForegroundColor();
-       _stepToDoColor          = paletteForegroundColor();
-       _stepDoneColor          = paletteForegroundColor();
-    }
-}
-
-
-
-void YQWizard::setGradient( QWidget * widget, const QPixmap & pixmap )
-{
-#if ENABLE_GRADIENTS
-    if ( widget && ! pixmap.isNull() )
-    {
-       widget->setFixedHeight( pixmap.height() );
-       widget->setPaletteBackgroundPixmap( pixmap );
-    }
-#endif
-}
-
-
-
-void YQWizard::setBottomCroppedGradient( QWidget * widget, const QPixmap & pixmap, int croppedHeight )
-{
-#if ENABLE_GRADIENTS
-    setGradient( widget, bottomCropPixmap( pixmap, croppedHeight ) );
-#endif
-}
-
-
-
-QPixmap YQWizard::bottomCropPixmap( const QPixmap & full, int croppedHeight )
-{
-    QPixmap pixmap;
-
-#if ENABLE_GRADIENTS
-
-    if ( full.height() > croppedHeight )
-    {
-       pixmap = QPixmap( full.width(), croppedHeight );
-
-       bitBlt( &pixmap, 0, 0,                                  // dest, dest_x, dest_y
-               &full,   0, full.height() - croppedHeight - 1,  // src, src_x, src_y
-               full.width(), croppedHeight );                  // src_width, src_height
-    }
-    else
-    {
-       pixmap = full;
-    }
-#endif
-
-    return pixmap;
-}
-
-
-
-QColor YQWizard::pixelColor( const QPixmap & pixmap, int x, int y, const QColor & defaultColor )
-{
-    if ( pixmap.isNull() )
-       return defaultColor;
-
-    // QPixmap doesn't allow direct access to pixel values (which makes some
-    // sense since this requires a round-trip to the X server - pixmaps are X
-    // server resources), so we need to convert the QPixmap to a QImage to get
-    // that information. But since this conversion is expensive, we might save
-    // some performance if we only convert the part we really need - so let's
-    // cut out a tiny portion of the original pixmap and convert only that tiny
-    // portion.
-
-
-    QPixmap tiny( 1, 1 );
-
-    bitBlt( &tiny, 0, 0,       // dest, dest_x, dest_y
-           &pixmap, x, y,      // src, src_x, src_y
-           1, 1 );             // src_width, src_height
-
-    QImage image = tiny.convertToImage();
-
-
-    return QColor( image.pixel( 0, 0 ) );
-}
-
-
-
-void YQWizard::addGradientColumn( QWidget * parent, int width )
-{
-    if ( ! parent )
-       return;
-
-    Q3VBox * vbox = new Q3VBox( parent );
-    YUI_CHECK_NEW( vbox );
-
-#if ENABLE_GRADIENTS
-    QWidget * topGradient = addHSpacing( vbox, width );
-    YUI_CHECK_NEW( topGradient );
-    setGradient( topGradient, _topGradientPixmap );
-
-    QWidget * centerStretch = new QWidget( vbox );
-    YUI_CHECK_NEW( centerStretch );
-    centerStretch->setPaletteBackgroundColor( _gradientCenterColor );
-
-
-    QWidget * bottomGradient = new QWidget( vbox );
-    YUI_CHECK_NEW( bottomGradient );
-    setGradient( bottomGradient, _bottomGradientPixmap );
-#else
-    vbox->setFixedWidth( width );
-#endif
-
+    return hbox;
 }
 
-
 void YQWizard::destroyButtons()
 {
-    if ( _backButton  )
-    {
-       delete _backButton;
-       _backButton = 0;
-    }
-
-    if ( _abortButton )
-    {
-       delete _abortButton;
-       _abortButton = 0;
-    }
+    delete _backButton;
+    _backButton = 0;
 
-    if ( _nextButton  )
-    {
-       delete _nextButton;
-       _nextButton = 0;
-    }
-}
+    delete _abortButton;
+    _abortButton = 0;
 
-
-
-bool YQWizard::highColorDisplay() const
-{
-    return depth() > 8;
+    delete _nextButton;
+    _nextButton = 0;
 }
 
 
@@ -1488,17 +937,8 @@ string YQWizard::debugLabel()
 
 void YQWizard::setHelpText( const string & helpText )
 {
-    if ( _helpBrowser )
-    {
-       if ( ! helpText.empty() )
-       {
-           QString qHelpText = fromUTF8( helpText );
-           qHelpText.replace( "&product;", YQUI::ui()->productName() );
-           _helpBrowser->setText( qHelpText );
-       }
-       else
-           _helpBrowser->clear();
-    }
+    _qHelpText = fromUTF8( helpText );
+    _qHelpText.replace( "&product;", YQUI::ui()->productName() );
 }
 
 
@@ -1535,10 +975,11 @@ void YQWizard::slotNextClicked()
 
 void YQWizard::showHelp()
 {
-    if ( _sideBar && _helpPanel )
-    {
-       _sideBar->raiseWidget( _helpPanel );
-    }
+    QDialog helpDlg( this );
+    Ui_QHelpDialog ui;
+    ui.setupUi( &helpDlg );
+    ui.textBrowser->setText( _qHelpText );
+    helpDlg.exec();
 }
 
 
@@ -1587,11 +1028,7 @@ void YQWizard::addMenu( const string & text,
        connect( menu, SIGNAL( activated    ( int ) ),
                 this, SLOT  ( sendMenuEvent( int ) ) );
 
-       if ( _menuBarBox && _menuBarBox->isHidden() )
-       {
-           _menuBarBox->show();
-           _menuBarBox->setFixedHeight( _menuBar->sizeHint().height() + MENU_BAR_MARGIN );
-       }
+        _menuBar->show();
     }
 }
 
@@ -1658,7 +1095,7 @@ void YQWizard::deleteMenus()
 {
     if ( _menuBar )
     {
-       _menuBarBox->hide();
+       _menuBar->hide();
        _menuBar->clear();
        _menuIDs.clear();
        _menuEntryIDs.clear();
@@ -1707,7 +1144,7 @@ void YQWizard::setSize( int newWidth, int newHeight )
 
 void YQWizard::resizeClientArea()
 {
-    // y2debug( "resizing client area" );
+    y2debug( "resizing client area" );
     QRect contentsRect = _clientArea->contentsRect();
     _contents->setSize( contentsRect.width(), contentsRect.height() );
 }
@@ -1734,34 +1171,7 @@ void YQWizard::setButtonLabel( YPushButton * button, const string & newLabel )
     YQWizardButton * wizardButton = dynamic_cast<YQWizardButton *> (button);
 
     if ( wizardButton )
-    {
-       if ( newLabel.empty() )
-       {
-           wizardButton->hide();
-
-           if ( wizardButton == _backButton && _backButtonSpacer )
-           {
-               // Minimize _backButtonSpacer
-
-               _backButtonSpacer->changeSize( 0, 0,                            // width, height
-                                              QSizePolicy::Minimum,            // horizontal
-                                              QSizePolicy::Minimum );          // vertical
-           }
-       }
-       else
-       {
-           wizardButton->show();
-
-           if ( button == _backButton && _backButtonSpacer )
-           {
-               // Restore _backButtonSpacer to normal size
-
-               _backButtonSpacer->changeSize( 0, 0,                            // width, height
-                                              QSizePolicy::Expanding,          // horizontal
-                                              QSizePolicy::Minimum );          // vertical
-           }
-       }
-    }
+        wizardButton->setVisible( !newLabel.empty() );
 }
 
 
@@ -1771,7 +1181,7 @@ void YQWizard::showReleaseNotesButton( const string & label, const string & id )
     {
        y2error( "NULL Release Notes button" );
 
-       if ( ! _stepsBox )
+       if ( ! _stepsPanel )
            y2error( "This works only if there is a \"steps\" panel!" );
 
        return;
@@ -1781,9 +1191,7 @@ void YQWizard::showReleaseNotesButton( const string & label, const string & id )
     _releaseNotesButton->setText( fromUTF8( YShortcut::cleanShortcutString( label ) ) );
     _releaseNotesButtonId = id;
 
-    if ( _releaseNotesButton->isHidden() )
-       _releaseNotesButton->show();
-
+    _releaseNotesButton->show();
 }
 
 
@@ -1811,4 +1219,23 @@ void YQWizard::retranslateInternalButtons()
        _treeButton->setText( _( "Tree" ) );
 }
 
+void YQWizard::Step::setStatus( Status s )
+{
+    if ( !_statusLabel || _status == s )
+        return;
+
+    _status = s;
+
+    if ( s == Todo )
+        _statusLabel->setProperty( "class", "todo-step QLabel" );
+
+    if ( s == Done )
+        _statusLabel->setProperty( "class", "done-step QLabel" );
+
+    if ( s == Current )
+        _statusLabel->setProperty( "class", "current-step QLabel" );
+
+    qApp->style()->polish( _statusLabel );
+}
+
 #include "YQWizard.moc"
index 5468c6b..addef4e 100644 (file)
@@ -391,35 +391,6 @@ public slots:
      **/
     void showTree();
 
-    /**
-     * Set a widget's background pixmap to a gradient pixmap and set the
-     * widget's height (fixed) to that pixmap's height.
-     **/
-    static void setGradient( QWidget * widget, const QPixmap & pixmap );
-
-    /**
-     * Set a widget's background to the lower portion (the bottom
-     * 'croppedHeight' pixels) of a pixmap and set the widget's height (fixed)
-     * to that 'croppedHeight'.
-     **/
-    static void setBottomCroppedGradient( QWidget * widget,
-                                         const QPixmap & pixmap,
-                                         int croppedHeight );
-
-    /**
-     * Bottom-crop a pixmap: Return a pixmap with the bottom 'croppedHeight'
-     * pixels.
-     **/
-    static QPixmap bottomCropPixmap( const QPixmap & pixmap, int croppedHeight );
-
-    /**
-     * Return the color of pixel( x, y ) of a pixmap.
-     * If pixmap is null defaultColor is returned.
-     * This is a _very_ expensive operation!
-     **/
-    static QColor pixelColor( const QPixmap & pixmap, int x, int y, const QColor & defaultColor );
-
-
 protected slots:
 
     /**
@@ -470,25 +441,14 @@ protected:
     // Layout functions
 
     void layoutTitleBar                ( QWidget * parent );
-    void layoutSideBar         ( QWidget * parent );
+    QLayout *layoutSideBar             ( QWidget * parent );
     void layoutSideBarButtonBox        ( QWidget * parent, QPushButton * button );
     void layoutStepsPanel();
     void layoutHelpPanel();
     void layoutTreePanel();
-    void layoutWorkArea        ( QFrame * parentHBox );
+    QLayout *layoutWorkArea    ( QFrame * parentHBox );
     void layoutClientArea( QWidget * parent );
-    void layoutButtonBox( QWidget * parent );
-
-
-    /**
-     * Load gradient pixmaps
-     **/
-    void loadGradientPixmaps();
-
-    /**
-     * Load step status icons
-     **/
-    void loadStepsIcons();
+    QLayout *layoutButtonBox( QWidget * parent );
 
     /**
      * Destroy the button box's buttons
@@ -500,27 +460,11 @@ protected:
      **/
     void updateStepStates();
 
-    /**
-     * Add a (left or right) margin of the specified width to a widget,
-     * consisting of a fixed height top gradient , a flexible center part (in
-     * the gradient center color) and a fixed height bottom gradient.
-     *
-     * The bottom gradient widget is returned as a reference for other
-     * background pixmaps.
-     **/
-    void addGradientColumn( QWidget * parent, int width = 8 );
-
     /**
      * Send a wizard event with the specified ID.
      **/
     void sendEvent( const string & id );
 
-    /**
-     * Returns 'true' if the application is running on a high-color display,
-     * i.e., on an X visual with more than 8 bit depth.
-     **/
-    bool highColorDisplay() const;
-
     /**
      * Notification that a signal is being connected.
      *
@@ -550,11 +494,6 @@ protected:
      **/
     void setButtonFocus( YQWizardButton * button );
 
-    /**
-     * Set text color and status icon for one wizard step
-     **/
-    void setStepStatus( YQWizard::Step * step, const QPixmap & icon, const QColor & color );
-
     /**
      * Find a step with the specified ID. Returns 0 if there is no such step.
      **/
@@ -583,45 +522,26 @@ protected:
     bool       _sendButtonEvents;
     Direction  _direction;
 
-    QPixmap    _titleBarGradientPixmap;
-    QPixmap    _topGradientPixmap;
-    QColor     _gradientCenterColor;
-    QColor     _gradientTopColor;
-    QPixmap    _bottomGradientPixmap;
-
-    QPixmap    _stepCurrentIcon;
-    QPixmap    _stepToDoIcon;
-    QPixmap    _stepDoneIcon;
-
-    QColor     _stepCurrentColor;
-    QColor     _stepToDoColor;
-    QColor     _stepDoneColor;
-
     QString    _currentStepID;
+    QString     _qHelpText;
 
 
     Q3WidgetStack *    _sideBar;
-    Q3VBox *               _stepsPanel;
-    Q3VBox *                   _stepsBox;
-    QGridLayout *                  _stepsGrid;
-    QPushButton *              _releaseNotesButton;
-    string                         _releaseNotesButtonId;
-    QPushButton *              _helpButton;
-    Q3HBox *               _helpPanel;
-    Q3TextBrowser *            _helpBrowser;
+    QWidget     *       _stepsPanel;
+    QPushButton *      _releaseNotesButton;
+    string              _releaseNotesButtonId;
+    QPushButton *      _helpButton;
     QPushButton *              _stepsButton;
     QPushButton *              _treeButton;
     Q3HBox *               _treePanel;
     QY2ListView *              _tree;
 
-    Q3VBox *           _clientArea;
-    QWidget *              _menuBarBox;
+    QWidget *          _clientArea;
     QMenuBar *                 _menuBar;
     QLabel *               _dialogIcon;
     QLabel *               _dialogHeading;
     YQAlignment *          _contents;
     YQWizardButton *       _backButton;
-    QSpacerItem *          _backButtonSpacer;
     YQWizardButton *       _abortButton;
     YQWizardButton *       _nextButton;
     YReplacePoint *    _contentsReplacePoint;
@@ -648,6 +568,7 @@ protected:
            , _nameLabel(0)
            , _enabled( true )
            , _idList( id )
+           , _status( Unset )
        {}
 
        /**
@@ -657,6 +578,8 @@ protected:
 
        virtual bool isHeading() const { return false; }
 
+       enum Status { Unset, Todo, Current, Done };
+
        QString  name()         const { return _name;           }
        QLabel * statusLabel()  const { return _statusLabel;    }
        QLabel * nameLabel()    const { return _nameLabel;      }
@@ -668,6 +591,11 @@ protected:
        void setStatusLabel( QLabel * label )   { _statusLabel = label; }
        void setNameLabel  ( QLabel * label )   { _nameLabel   = label; }
        void setEnabled( bool enabled )         { _enabled = enabled; }
+       
+       /**
+        * Set text color and status icon for one wizard step
+        **/
+       void setStatus( Status s );
 
     protected:
 
@@ -676,6 +604,7 @@ protected:
        QLabel *        _nameLabel;
        bool            _enabled;
        QStringList     _idList;
+       Status          _status;
     };
 
 
diff --git a/theme/background-1024x768.png b/theme/background-1024x768.png
new file mode 100644 (file)
index 0000000..e84f999
Binary files /dev/null and b/theme/background-1024x768.png differ
diff --git a/theme/bottom-gradient.png b/theme/bottom-gradient.png
new file mode 100644 (file)
index 0000000..9e5cb17
Binary files /dev/null and b/theme/bottom-gradient.png differ
diff --git a/theme/step-current.png b/theme/step-current.png
new file mode 100644 (file)
index 0000000..f1eb78e
Binary files /dev/null and b/theme/step-current.png differ
diff --git a/theme/step-done.png b/theme/step-done.png
new file mode 100644 (file)
index 0000000..89935b2
Binary files /dev/null and b/theme/step-done.png differ
diff --git a/theme/step-todo.png b/theme/step-todo.png
new file mode 100644 (file)
index 0000000..96228ab
Binary files /dev/null and b/theme/step-todo.png differ
diff --git a/theme/steps-button.png b/theme/steps-button.png
new file mode 100644 (file)
index 0000000..101162f
Binary files /dev/null and b/theme/steps-button.png differ
diff --git a/theme/style.qss b/theme/style.qss
new file mode 100644 (file)
index 0000000..5ea953e
--- /dev/null
@@ -0,0 +1,69 @@
+/* Hintergrund: background-$RESULTION */
+
+.YQWizard {
+   pbackground-image: url(bottom-gradient.png);  
+   background-image: url(background-1024x768.png);
+   background-position: bottom;
+   background-repeat: repeat-x;
+}
+
+QDWidget { border-style: solid; border-width: 5px;  } 
+
+QWidget { color: white; }
+
+/* We provide a min-width and min-height for push buttons
+   so that they look elegant regardless of the width of the text. */
+QPushButton {
+    padding: 3px;
+    margin-left: 20px;
+    min-width: 9ex;
+    min-height: 2.5ex;
+    color: black;
+}
+
+QTextBrowser {
+    color: black;
+}
+
+/* Increase the padding, so the text is shifted when the button is
+   pressed. */
+QPushButton:pressed {
+    padding-left: 5px;
+    padding-top: 5px;
+    background-color: #d0d67c;
+}
+
+/* Nice to have the background color change when hovered. */
+QRadioButton:hover, QCheckBox:hover {
+    background-color: wheat;
+}
+
+.todo {
+   qproperty-pixmap: url(step-todo.png);
+   max-width: 14px;
+   min-width: 14px;
+}
+
+.done {
+   qproperty-pixmap: url(step-done.png);
+   max-width: 14px;
+   min-width: 14px;
+}
+
+.current {
+   qproperty-pixmap: url(step-current.png);
+   max-width: 14px;
+   min-width: 14px;
+}
+
+.steps_heading {
+   font: bold;  
+   font-size: 14pt;
+}
+
+#DialogIcon {}
+#DialogHeading { 
+  font-size: 20px; 
+  padding: 12pt;
+}
+