00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "ds_appearance.h"
00012
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qlabel.h>
00016 #include <qgroupbox.h>
00017 #include <qcheckbox.h>
00018 #include <qframe.h>
00019 #include <knuminput.h>
00020 #include <kfontcombo.h>
00021 #include <kcolorbutton.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025
00026
00027
00028
00029
00030 AppearancePage::AppearancePage( QWidget* parent, const char* name, WFlags fl )
00031 : QWidget( parent, name, fl )
00032 {
00033 if ( !name )
00034 setName( "AppearancePage" );
00035 AppearancePageLayout = new QVBoxLayout( this, 11, 6, "AppearancePageLayout");
00036
00037 labelHeader = new QLabel( this, "labelHeader" );
00038 labelHeader->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, labelHeader->sizePolicy().hasHeightForWidth() ) );
00039 labelHeader->setPaletteForegroundColor( QColor( 0, 0, 90 ) );
00040 labelHeader->setPaletteBackgroundColor( QColor( 255, 170, 127 ) );
00041 QFont labelHeader_font( labelHeader->font() );
00042 labelHeader_font.setBold( TRUE );
00043 labelHeader->setFont( labelHeader_font );
00044 labelHeader->setFrameShape( QLabel::Panel );
00045 labelHeader->setFrameShadow( QLabel::Sunken );
00046 labelHeader->setScaledContents( FALSE );
00047 labelHeader->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );
00048 AppearancePageLayout->addWidget( labelHeader );
00049
00050 gbFont = new QGroupBox( this, "gbFont" );
00051 gbFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)3, 0, 0, gbFont->sizePolicy().hasHeightForWidth() ) );
00052 gbFont->setColumnLayout(0, Qt::Vertical );
00053 gbFont->layout()->setSpacing( 6 );
00054 gbFont->layout()->setMargin( 11 );
00055 gbFontLayout = new QVBoxLayout( gbFont->layout() );
00056 gbFontLayout->setAlignment( Qt::AlignTop );
00057
00058 cbStandardFonts = new QCheckBox( gbFont, "cbStandardFonts" );
00059 cbStandardFonts->setChecked( TRUE );
00060 gbFontLayout->addWidget( cbStandardFonts );
00061
00062 frameFonts = new QFrame( gbFont, "frameFonts" );
00063 frameFonts->setEnabled( FALSE );
00064 frameFonts->setFrameShape( QFrame::NoFrame );
00065 frameFonts->setFrameShadow( QFrame::Plain );
00066 frameFontsLayout = new QGridLayout( frameFonts, 1, 1, 11, 6, "frameFontsLayout");
00067
00068 labelDetailsFont = new QLabel( frameFonts, "labelDetailsFont" );
00069 labelDetailsFont->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00070
00071 frameFontsLayout->addWidget( labelDetailsFont, 3, 0 );
00072
00073 labelDetailsFontSize = new QLabel( frameFonts, "labelDetailsFontSize" );
00074 labelDetailsFontSize->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00075
00076 frameFontsLayout->addWidget( labelDetailsFontSize, 3, 2 );
00077
00078 labelBodyFont = new QLabel( frameFonts, "labelBodyFont" );
00079 labelBodyFont->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00080
00081 frameFontsLayout->addWidget( labelBodyFont, 2, 0 );
00082
00083 labelFixedFontSize = new QLabel( frameFonts, "labelFixedFontSize" );
00084 labelFixedFontSize->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00085
00086 frameFontsLayout->addWidget( labelFixedFontSize, 4, 2 );
00087
00088 labelFixed = new QLabel( frameFonts, "labelFixed" );
00089 labelFixed->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00090
00091 frameFontsLayout->addWidget( labelFixed, 4, 0 );
00092
00093 kisbDetailsFontSize = new KIntSpinBox( frameFonts, "kisbDetailsFontSize" );
00094
00095 frameFontsLayout->addWidget( kisbDetailsFontSize, 3, 3 );
00096
00097 kisbFixedFontSize = new KIntSpinBox( frameFonts, "kisbFixedFontSize" );
00098
00099 frameFontsLayout->addWidget( kisbFixedFontSize, 4, 3 );
00100
00101 labelBodyFontSize = new QLabel( frameFonts, "labelBodyFontSize" );
00102 labelBodyFontSize->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00103
00104 frameFontsLayout->addWidget( labelBodyFontSize, 2, 2 );
00105
00106 kfcBodyFont = new KFontCombo( frameFonts, "kfcBodyFont" );
00107 kfcBodyFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, kfcBodyFont->sizePolicy().hasHeightForWidth() ) );
00108
00109 frameFontsLayout->addWidget( kfcBodyFont, 2, 1 );
00110
00111 kfcDetailsFont = new KFontCombo( frameFonts, "kfcDetailsFont" );
00112 kfcDetailsFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, kfcDetailsFont->sizePolicy().hasHeightForWidth() ) );
00113
00114 frameFontsLayout->addWidget( kfcDetailsFont, 3, 1 );
00115
00116 kfcFixedFont = new KFontCombo( frameFonts, "kfcFixedFont" );
00117
00118 frameFontsLayout->addWidget( kfcFixedFont, 4, 1 );
00119
00120 labelHeaderFont = new QLabel( frameFonts, "labelHeaderFont" );
00121 labelHeaderFont->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00122
00123 frameFontsLayout->addWidget( labelHeaderFont, 0, 0 );
00124
00125 kfcHeaderFont = new KFontCombo( frameFonts, "kfcHeaderFont" );
00126 kfcHeaderFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, kfcHeaderFont->sizePolicy().hasHeightForWidth() ) );
00127
00128 frameFontsLayout->addWidget( kfcHeaderFont, 0, 1 );
00129
00130 kfcHeadlineFont = new KFontCombo( frameFonts, "kfcHeadlineFont" );
00131
00132 frameFontsLayout->addWidget( kfcHeadlineFont, 1, 1 );
00133
00134 labelHeaderFontSize = new QLabel( frameFonts, "labelHeaderFontSize" );
00135 labelHeaderFontSize->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00136
00137 frameFontsLayout->addWidget( labelHeaderFontSize, 0, 2 );
00138
00139 labelHeaderFontSize_2 = new QLabel( frameFonts, "labelHeaderFontSize_2" );
00140 labelHeaderFontSize_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00141
00142 frameFontsLayout->addWidget( labelHeaderFontSize_2, 1, 2 );
00143
00144 kisbBodyFontSize = new KIntSpinBox( frameFonts, "kisbBodyFontSize" );
00145
00146 frameFontsLayout->addWidget( kisbBodyFontSize, 2, 3 );
00147
00148 labelHeadlines = new QLabel( frameFonts, "labelHeadlines" );
00149 labelHeadlines->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00150
00151 frameFontsLayout->addWidget( labelHeadlines, 1, 0 );
00152
00153 kisbHeaderFontSize = new KIntSpinBox( frameFonts, "kisbHeaderFontSize" );
00154
00155 frameFontsLayout->addWidget( kisbHeaderFontSize, 0, 3 );
00156
00157 kisbHeadlineFontSize = new KIntSpinBox( frameFonts, "kisbHeadlineFontSize" );
00158
00159 frameFontsLayout->addWidget( kisbHeadlineFontSize, 1, 3 );
00160 gbFontLayout->addWidget( frameFonts );
00161 AppearancePageLayout->addWidget( gbFont );
00162
00163 gbHeadline = new QGroupBox( this, "gbHeadline" );
00164 gbHeadline->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, gbHeadline->sizePolicy().hasHeightForWidth() ) );
00165 gbHeadline->setColumnLayout(0, Qt::Vertical );
00166 gbHeadline->layout()->setSpacing( 6 );
00167 gbHeadline->layout()->setMargin( 11 );
00168 gbHeadlineLayout = new QVBoxLayout( gbHeadline->layout() );
00169 gbHeadlineLayout->setAlignment( Qt::AlignTop );
00170
00171 cbBackgroundColor = new QCheckBox( gbHeadline, "cbBackgroundColor" );
00172 cbBackgroundColor->setChecked( TRUE );
00173 gbHeadlineLayout->addWidget( cbBackgroundColor );
00174
00175 frameBGColor = new QFrame( gbHeadline, "frameBGColor" );
00176 frameBGColor->setFrameShape( QFrame::NoFrame );
00177 frameBGColor->setFrameShadow( QFrame::Plain );
00178 frameBGColorLayout = new QGridLayout( frameBGColor, 1, 1, 11, 6, "frameBGColorLayout");
00179
00180 kcbHeaderBGColor = new KColorButton( frameBGColor, "kcbHeaderBGColor" );
00181 kcbHeaderBGColor->setEnabled( TRUE );
00182 kcbHeaderBGColor->setColor( QColor( 0, 0, 0 ) );
00183
00184 frameBGColorLayout->addWidget( kcbHeaderBGColor, 0, 1 );
00185
00186 tlBackgroundColor = new QLabel( frameBGColor, "tlBackgroundColor" );
00187 tlBackgroundColor->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00188
00189 frameBGColorLayout->addWidget( tlBackgroundColor, 0, 0 );
00190
00191 tlHeaderColor = new QLabel( frameBGColor, "tlHeaderColor" );
00192 tlHeaderColor->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00193
00194 frameBGColorLayout->addWidget( tlHeaderColor, 1, 0 );
00195
00196 kcbHeaderTextColor = new KColorButton( frameBGColor, "kcbHeaderTextColor" );
00197 kcbHeaderTextColor->setEnabled( TRUE );
00198 kcbHeaderTextColor->setColor( QColor( 255, 255, 255 ) );
00199
00200 frameBGColorLayout->addWidget( kcbHeaderTextColor, 1, 1 );
00201 Spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00202 frameBGColorLayout->addItem( Spacer3, 0, 2 );
00203 gbHeadlineLayout->addWidget( frameBGColor );
00204 AppearancePageLayout->addWidget( gbHeadline );
00205 Spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
00206 AppearancePageLayout->addItem( Spacer4 );
00207 languageChange();
00208 resize( QSize(597, 437).expandedTo(minimumSizeHint()) );
00209 clearWState( WState_Polished );
00210
00211
00212 connect( cbBackgroundColor, SIGNAL( toggled(bool) ), frameBGColor, SLOT( setEnabled(bool) ) );
00213 connect( cbStandardFonts, SIGNAL( toggled(bool) ), frameFonts, SLOT( setDisabled(bool) ) );
00214 }
00215
00216
00217
00218
00219 AppearancePage::~AppearancePage()
00220 {
00221
00222 }
00223
00224
00225
00226
00227
00228 void AppearancePage::languageChange()
00229 {
00230 setCaption( tr2i18n( "Appearance Page" ) );
00231 labelHeader->setText( tr2i18n( "Detailed Print Style - Appearance" ) );
00232 gbFont->setTitle( tr2i18n( "Font Settings" ) );
00233 cbStandardFonts->setText( tr2i18n( "Use standard KDE fonts" ) );
00234 labelDetailsFont->setText( tr2i18n( "Details font:" ) );
00235 labelDetailsFontSize->setText( tr2i18n( "Size:" ) );
00236 labelBodyFont->setText( tr2i18n( "Body font:" ) );
00237 labelFixedFontSize->setText( tr2i18n( "Size:" ) );
00238 labelFixed->setText( tr2i18n( "Fixed font:" ) );
00239 labelBodyFontSize->setText( tr2i18n( "Size:" ) );
00240 labelHeaderFont->setText( tr2i18n( "Contact header font:" ) );
00241 labelHeaderFontSize->setText( tr2i18n( "Size:" ) );
00242 labelHeaderFontSize_2->setText( tr2i18n( "Size:" ) );
00243 labelHeadlines->setText( tr2i18n( "Headlines:" ) );
00244 gbHeadline->setTitle( tr2i18n( "Contact Headers" ) );
00245 cbBackgroundColor->setText( tr2i18n( "Use colored contact headers" ) );
00246 kcbHeaderBGColor->setText( QString::null );
00247 tlBackgroundColor->setText( tr2i18n( "Headline background color:" ) );
00248 tlHeaderColor->setText( tr2i18n( "Headline text color:" ) );
00249 kcbHeaderTextColor->setText( QString::null );
00250 }
00251
00252 #include "ds_appearance.moc"