Author: coolo
Date: Thu Nov 29 09:33:13 2007
New Revision: 42493
URL: http://svn.opensuse.org/viewcvs/yast?rev=42493&view=rev
Log:
reworking the wizard almost from ground up
Added:
branches/tmp/coolo/wizard-rework/theme/
branches/tmp/coolo/wizard-rework/theme/bottom-gradient.png (with props)
branches/tmp/coolo/wizard-rework/theme/step-current.png (with props)
branches/tmp/coolo/wizard-rework/theme/step-done.png (with props)
branches/tmp/coolo/wizard-rework/theme/step-todo.png (with props)
branches/tmp/coolo/wizard-rework/theme/steps-button.png (with props)
branches/tmp/coolo/wizard-rework/theme/style.qss
Modified:
branches/tmp/coolo/wizard-rework/src/CMakeLists.txt
branches/tmp/coolo/wizard-rework/src/YQUI.h
branches/tmp/coolo/wizard-rework/src/YQUI_core.cc
branches/tmp/coolo/wizard-rework/src/YQWizard.cc
branches/tmp/coolo/wizard-rework/src/YQWizard.h
Modified: branches/tmp/coolo/wizard-rework/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/src/CMakeLists.txt?rev=42493&r1=42492&r2=42493&view=diff
==============================================================================
--- branches/tmp/coolo/wizard-rework/src/CMakeLists.txt (original)
+++ branches/tmp/coolo/wizard-rework/src/CMakeLists.txt Thu Nov 29 09:33:13 2007
@@ -48,7 +48,7 @@
INSTALL(TARGETS py2qt4 LIBRARY DESTINATION ${YAST_PLUGIN_DIR} )
-ADD_SUBDIRECTORY(pkg)
+#ADD_SUBDIRECTORY(pkg)
#SET_TARGET_PROPERTIES( y2lang_qt4 PROPERTIES PREFIX "" )
Modified: branches/tmp/coolo/wizard-rework/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/src/YQUI.h?rev=42493&r1=42492&r2=42493&view=diff
==============================================================================
--- branches/tmp/coolo/wizard-rework/src/YQUI.h (original)
+++ branches/tmp/coolo/wizard-rework/src/YQUI.h Thu Nov 29 09:33:13 2007
@@ -571,7 +571,7 @@
* 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.
Modified: branches/tmp/coolo/wizard-rework/src/YQUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/src/YQUI_core.cc?rev=42493&r1=42492&r2=42493&view=diff
==============================================================================
--- branches/tmp/coolo/wizard-rework/src/YQUI_core.cc (original)
+++ branches/tmp/coolo/wizard-rework/src/YQUI_core.cc Thu Nov 29 09:33:13 2007
@@ -26,6 +26,7 @@
#include <QStackedWidget>
#include <QDesktopWidget>
#include <QThread>
+#include <QVBoxLayout>
#include
#include
@@ -135,13 +136,17 @@
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
Modified: branches/tmp/coolo/wizard-rework/src/YQWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/src/YQWizard.cc?rev=42493&r1=42492&r2=42493&view=diff
==============================================================================
--- branches/tmp/coolo/wizard-rework/src/YQWizard.cc (original)
+++ branches/tmp/coolo/wizard-rework/src/YQWizard.cc Thu Nov 29 09:33:13 2007
@@ -80,33 +80,6 @@
#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
@@ -125,10 +98,9 @@
, _abortButtonLabel( abortButtonLabel )
, _nextButtonLabel( nextButtonLabel )
{
- QVBoxLayout* layout = new QVBoxLayout( this );
+ QHBoxLayout* layout = new QHBoxLayout( this );
layout->setSpacing( 0 );
layout->setMargin( 0 );
- setLayout( layout );
setWidgetRep( this );
@@ -140,8 +112,6 @@
_sideBar = 0;
_stepsPanel = 0;
- _stepsBox = 0;
- _stepsGrid = 0;
_helpButton = 0;
_stepsButton = 0;
_treeButton = 0;
@@ -151,13 +121,11 @@
_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;
@@ -168,46 +136,10 @@
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 ) );
}
@@ -221,22 +153,9 @@
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
//
@@ -282,7 +201,7 @@
-void YQWizard::layoutSideBar( QWidget * parent )
+QLayout *YQWizard::layoutSideBar( QWidget * parent )
{
_sideBar = new Q3WidgetStack( parent );
YUI_CHECK_NEW( _sideBar );
@@ -290,6 +209,8 @@
_sideBar->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) ); // hor/vert
_sideBar->setMargin( 0 );
+ QVBoxLayout *vbox = new QVBoxLayout( );
+ vbox->addWidget( _sideBar );
layoutHelpPanel();
@@ -303,101 +224,29 @@
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
}
@@ -446,65 +295,25 @@
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 Q3GridLayout( stepsParent, // parent
- _stepsList.count(), 4, // rows, cols
- 0, STEPS_SPACING ); // margin, 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
//
@@ -515,38 +324,14 @@
{
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,
@@ -559,27 +344,21 @@
// 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 );
}
@@ -588,8 +367,13 @@
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;
}
@@ -605,8 +389,7 @@
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"
@@ -614,7 +397,7 @@
while ( step && step != currentStep )
{
- setStepStatus( step, _stepDoneIcon, _stepDoneColor );
+ step->setStatus( Step::Done );
step = _stepsList.next();
}
@@ -630,25 +413,11 @@
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 );
@@ -678,12 +447,9 @@
YUI_CHECK_NEW( _helpPanel );
_sideBar->addWidget( _helpPanel );
- addGradientColumn( _helpPanel );
-
Q3VBox * vbox = new Q3VBox( _helpPanel );
YUI_CHECK_NEW( vbox );
-
// Help browser
_helpBrowser = new Q3TextBrowser( vbox );
@@ -695,30 +461,10 @@
_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 );
YUI_CHECK_NEW( buttonBox );
@@ -732,9 +478,7 @@
YUI_CHECK_NEW( button );
_treeButton = button;
-#if USE_ICON_ON_HELP_BUTTON
pixmap = QPixmap( PIXMAP_DIR "tree-button.png" );
-#endif
}
else
if ( _stepsEnabled )
@@ -744,9 +488,7 @@
YUI_CHECK_NEW( button );
_stepsButton = button;
-#if USE_ICON_ON_HELP_BUTTON
pixmap = QPixmap( PIXMAP_DIR "steps-button.png" );
-#endif
}
else
{
@@ -756,8 +498,10 @@
}
+#if USE_ICON_ON_HELP_BUTTON
if ( ! pixmap.isNull() )
button->setPixmap( pixmap );
+#endif
layoutSideBarButtonBox( buttonBox, button );
@@ -776,8 +520,6 @@
// Hide the dummy button - the button box height is fixed now.
button->hide();
}
-
- addGradientColumn( _helpPanel );
}
@@ -786,7 +528,6 @@
{
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 );
@@ -794,19 +535,6 @@
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 );
}
@@ -817,9 +545,6 @@
YUI_CHECK_NEW( _treePanel );
_sideBar->addWidget( _treePanel );
- // Left margin (with gradients)
- addGradientColumn( _treePanel );
-
Q3VBox * vbox = new Q3VBox( _treePanel );
YUI_CHECK_NEW( vbox );
@@ -866,9 +591,6 @@
connect( button, SIGNAL( clicked() ),
this, SLOT ( showHelp() ) );
-
- // Right margin (with gradients)
- addGradientColumn( _treePanel );
}
@@ -983,100 +705,53 @@
-void YQWizard::layoutWorkArea( QFrame * parentHBox )
+QLayout *YQWizard::layoutWorkArea( QFrame * parent )
{
- Q3VBox * workAreaVBox = new Q3VBox( parentHBox );
- YUI_CHECK_NEW( workAreaVBox );
+ QVBoxLayout *vbox = new QVBoxLayout();
- // 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 );
-
- _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
+ //headingHBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
+ vbox->addLayout( headingHBox );
- addHSpacing( headingHBox, SEPARATOR_MARGIN );
-
- _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 );
-
+ QLayout *bb = layoutButtonBox( parent );
+ vbox->addLayout( bb );
- //
- // Spacer (purely decorative) at the right of the client area
- //
-
- addGradientColumn( parentHBox, WORK_AREA_RIGHT_MARGIN );
+ return vbox;
}
@@ -1085,12 +760,7 @@
{
_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
@@ -1104,7 +774,6 @@
_contents->installEventFilter( this );
_contents->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); // hor/vert
-
//
// Replace point for wizard contents
//
@@ -1117,293 +786,92 @@
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.
-
- QSpacerItem * spacer = new QSpacerItem( 0, 0, // width, height
- QSizePolicy::Expanding, // horizontal
- QSizePolicy::Minimum ); // vertical
- YUI_CHECK_NEW( spacer );
- hbox->addItem( spacer );
+ //
+ // "Back" button
+ //
+ _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
+ return hbox;
}
-
-
-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
-
-}
-
-
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;
}
@@ -1583,11 +1051,7 @@
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();
}
}
@@ -1654,7 +1118,7 @@
{
if ( _menuBar )
{
- _menuBarBox->hide();
+ _menuBar->hide();
_menuBar->clear();
_menuIDs.clear();
_menuEntryIDs.clear();
@@ -1703,7 +1167,7 @@
void YQWizard::resizeClientArea()
{
- // y2debug( "resizing client area" );
+ y2debug( "resizing client area" );
QRect contentsRect = _clientArea->contentsRect();
_contents->setSize( contentsRect.width(), contentsRect.height() );
}
@@ -1730,34 +1194,7 @@
YQWizardButton * wizardButton = dynamic_cast (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() );
}
@@ -1767,7 +1204,7 @@
{
y2error( "NULL Release Notes button" );
- if ( ! _stepsBox )
+ if ( ! _stepsPanel )
y2error( "This works only if there is a \"steps\" panel!" );
return;
@@ -1777,9 +1214,7 @@
_releaseNotesButton->setText( fromUTF8( YShortcut::cleanShortcutString( label ) ) );
_releaseNotesButtonId = id;
- if ( _releaseNotesButton->isHidden() )
- _releaseNotesButton->show();
-
+ _releaseNotesButton->show();
}
@@ -1807,4 +1242,23 @@
_treeButton->setText( _( "Tree" ) );
}
+void YQWizard::Step::setStatus( Status s )
+{
+ if ( !_statusLabel || _status == s )
+ return;
+
+ _status = s;
+
+ if ( s == Todo )
+ _statusLabel->setProperty( "class", "todo Step" );
+
+ if ( s == Done )
+ _statusLabel->setProperty( "class", "done Step" );
+
+ if ( s == Current )
+ _statusLabel->setProperty( "class", "current Step" );
+
+ qApp->style()->polish( _statusLabel );
+}
+
#include "YQWizard.moc"
Modified: branches/tmp/coolo/wizard-rework/src/YQWizard.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/src/YQWizard.h?rev=42493&r1=42492&r2=42493&view=diff
==============================================================================
--- branches/tmp/coolo/wizard-rework/src/YQWizard.h (original)
+++ branches/tmp/coolo/wizard-rework/src/YQWizard.h Thu Nov 29 09:33:13 2007
@@ -27,7 +27,6 @@
#include
#include "QY2ListView.h"
//Added by qt3to4:
-#include
#include
#include
#include
@@ -37,7 +36,7 @@
#include <string>
#include <vector>
-class Q3GridLayout;
+class QGridLayout;
class QFrame;
class QLabel;
class QMenuBar;
@@ -390,35 +389,6 @@
**/
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:
/**
@@ -469,25 +439,14 @@
// 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 +459,11 @@
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.
*
* Reimplemented from QObject.
@@ -550,11 +493,6 @@
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.
**/
YQWizard::Step * findStep( const QString & id );
@@ -582,30 +520,14 @@
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;
Q3WidgetStack * _sideBar;
- Q3VBox * _stepsPanel;
- Q3VBox * _stepsBox;
- Q3GridLayout * _stepsGrid;
- QPushButton * _releaseNotesButton;
- string _releaseNotesButtonId;
- QPushButton * _helpButton;
+ QWidget * _stepsPanel;
+ QPushButton * _releaseNotesButton;
+ string _releaseNotesButtonId;
+ QPushButton * _helpButton;
Q3HBox * _helpPanel;
Q3TextBrowser * _helpBrowser;
QPushButton * _stepsButton;
@@ -613,14 +535,12 @@
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;
@@ -647,6 +567,7 @@
, _nameLabel(0)
, _enabled( true )
, _idList( id )
+ , _status( Unset )
{}
/**
@@ -656,6 +577,8 @@
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; }
@@ -667,6 +590,11 @@
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:
@@ -675,6 +603,7 @@
QLabel * _nameLabel;
bool _enabled;
QStringList _idList;
+ Status _status;
};
Added: branches/tmp/coolo/wizard-rework/theme/bottom-gradient.png
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/theme/bottom-gradient.png?rev=42493&view=auto
==============================================================================
Binary file - no diff available.
Added: branches/tmp/coolo/wizard-rework/theme/step-current.png
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/theme/step-current.png?rev=42493&view=auto
==============================================================================
Binary file - no diff available.
Added: branches/tmp/coolo/wizard-rework/theme/step-done.png
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/theme/step-done.png?rev=42493&view=auto
==============================================================================
Binary file - no diff available.
Added: branches/tmp/coolo/wizard-rework/theme/step-todo.png
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/theme/step-todo.png?rev=42493&view=auto
==============================================================================
Binary file - no diff available.
Added: branches/tmp/coolo/wizard-rework/theme/steps-button.png
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/theme/steps-button.png?rev=42493&view=auto
==============================================================================
Binary file - no diff available.
Added: branches/tmp/coolo/wizard-rework/theme/style.qss
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/wizard-rework/theme/style.qss?rev=42493&view=auto
==============================================================================
--- branches/tmp/coolo/wizard-rework/theme/style.qss (added)
+++ branches/tmp/coolo/wizard-rework/theme/style.qss Thu Nov 29 09:33:13 2007
@@ -0,0 +1,65 @@
+.YQWizard {
+ background-image: url(bottom-gradient.png);
+ background-position: bottom;
+ background-repeat: repeat-x;
+}
+
+/* We provide a min-width and min-height for push buttons
+ so that they look elegant regardless of the width of the text. */
+QPushButton {
+ background-color: palegoldenrod;
+ border-width: 2px;
+ border-color: darkkhaki;
+ border-style: solid;
+ border-radius: 5;
+ padding: 3px;
+ min-width: 9ex;
+ min-height: 2.5ex;
+}
+
+QPushButton:hover {
+ background-color: khaki;
+}
+
+/* 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: 14px;
+}
+
+#DialogIcon {}
+#DialogHeading {
+ font-size: 20px;
+ padding: 12px;
+}
+
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org