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