summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 82d8931..1aa91bb 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -257,210 +257,211 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
{
QString name = (*it). left ((*it). find ( ".scheme" ));
QString pathstr = path;
pathstr.append( *it );
Config config ( pathstr, Config::File );
config. setGroup ( "Colors" );
m_color_list-> insertItem ( new ColorListItem ( name, config ));
}
m_color_list-> setCurrentItem ( 0 );
QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" );
tempButton->setText( tr( "Edit..." ) );
connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) );
gridLayout->addWidget( tempButton, 0, 1 );
QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) );
tempButton = new QPushButton( tab, "deleteSchemeButton" );
tempButton->setText( tr( "Delete" ) );
connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) );
gridLayout->addWidget( tempButton, 1, 1 );
QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) );
tempButton = new QPushButton( tab, "saveSchemeButton" );
tempButton->setText( tr( "Save" ) );
connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) );
gridLayout->addWidget( tempButton, 2, 1 );
QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) );
return tab;
}
QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
{
QWidget *tab = new QWidget ( parent );
QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
/*
* show scrollbars on the left?
*/
m_leftHand = new QCheckBox( tr("Show Scrollbars on the left"), tab );
m_leftHand->setChecked( cfg.readBoolEntry( "LeftHand", false ) );
QWhatsThis::add( m_leftHand, tr( "Click here to display scrollbars on the left side instead of the right." ) );
vertLayout->addWidget( m_leftHand );
QFrame *f = new QFrame ( tab );
f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
vertLayout-> addWidget ( f );
vertLayout-> addSpacing ( 3 );
QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1;
bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" );
QLabel* label = new QLabel( tr( "Tab style:" ), tab );
gridLayout-> addWidget ( label, 0, 0 );
QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" );
btngrp-> hide ( );
btngrp-> setExclusive ( true );
m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" );
m_tabstyle_list-> insertItem ( tr( "Tabs" ));
m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" ));
m_tabstyle_list-> insertItem ( tr( "Drop down list" ));
m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" ));
m_tabstyle_list-> setCurrentItem ( style );
gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" );
btngrp-> insert ( m_tabstyle_top );
gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) );
m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" );
btngrp-> insert ( m_tabstyle_bottom );
gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 );
QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) );
m_tabstyle_top-> setChecked ( tabtop );
m_tabstyle_bottom-> setChecked ( !tabtop );
m_original_tabstyle = style;
m_original_tabpos = tabtop;
vertLayout-> addSpacing ( 3 );
QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 );
QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab );
m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" );
- QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( );
m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" );
- QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 );
- QPixmap ccw1;
m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" );
- QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( );
QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" );
rotbtngrp-> hide ( );
rotbtngrp-> setExclusive ( true );
rotbtngrp-> insert ( m_rotdir_cw );
rotbtngrp-> insert ( m_rotdir_ccw );
rotbtngrp-> insert ( m_rotdir_flip );
- ccw1. convertFromImage( ccwImage );
- m_rotdir_cw-> setPixmap( cw1 );
- m_rotdir_ccw-> setPixmap( ccw1 );
- m_rotdir_flip-> setPixmap( flip1 );
+ QImage ccwImage = Resource::loadImage( "redo" );
+ QPixmap cw, ccw, flip;
+ cw.convertFromImage( ccwImage.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ ccw.convertFromImage( ccwImage.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ).mirror( 1, 0 ) );
+ flip.convertFromImage( Resource::loadImage( "pass" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+
+ m_rotdir_cw-> setPixmap( cw );
+ m_rotdir_ccw-> setPixmap( ccw );
+ m_rotdir_flip-> setPixmap( flip );
rotLay-> addWidget ( rotlabel, 0 );
rotLay-> addWidget ( m_rotdir_cw, 0 );
rotLay-> addWidget ( m_rotdir_ccw, 0 );
rotLay-> addWidget ( m_rotdir_flip, 0 );
int rotDirection = cfg.readNumEntry( "rotatedir" );
ODirection rot = CW;
if (rotDirection == -1)
{
rot = ODevice::inst ( )-> direction ( );
}
else
{
rot = (ODirection)rotDirection;
}
m_rotdir_cw-> setChecked ( rot == CW );
m_rotdir_ccw-> setChecked ( rot == CCW );
m_rotdir_flip-> setChecked ( rot == Flip );
/*
* add a spacing
*/
vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
return tab;
}
Appearance::Appearance( QWidget* parent, const char* name, WFlags )
: QDialog ( parent, name, true, WStyle_ContextHelp )
{
setCaption( tr( "Appearance Settings" ) );
Config config( "qpe" );
config.setGroup( "Appearance" );
QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 );
m_sample = new SampleWindow ( this );
m_sample-> setDecoration ( new DefaultWindowDecoration ( ) );
QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) );
OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
QWidget *styletab;
m_color_list = 0;
tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" ));
tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" ));
tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) );
tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) );
tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) );
top-> addWidget ( tw, 10 );
top-> addWidget ( m_sample, 1 );
tw-> setCurrentTab ( styletab );
connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*)));
m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false;
}
Appearance::~Appearance()
{}
void Appearance::tabChanged ( QWidget *w )
{
if ( w == m_advtab )
{
m_sample-> hide ( );
updateGeometry ( ); // shouldn't be necessary ...
}
else
m_sample-> show ( );
}
void Appearance::accept ( )
{
bool newtabpos = m_tabstyle_top-> isChecked ( );
int newtabstyle = m_tabstyle_list-> currentItem ( );
Config config ( "qpe" );
config. setGroup ( "Appearance" );
if ( m_style_changed )
{
StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
if ( item )
config.writeEntry( "Style", item-> key ( ));
}
if ( m_deco_changed )