Subversion Repositories Scribus

Rev

Rev 823 | Rev 1065 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
788 fschmid 1
#include "tabtypography.h"
2
#include "tabtypography.moc"
3
#include <qlayout.h>
4
#include <qgroupbox.h>
5
#include <qlabel.h>
6
#include <qtooltip.h>
7
#include <qspinbox.h>
8
#include "mspinbox.h"
838 cbradney 9
#include "scribusstructs.h"
788 fschmid 10
 
823 fschmid 11
TabTypograpy::TabTypograpy( QWidget* parent, struct typoStruct *prefsData, double unitBase, QString unit) : QWidget( parent, "tabtypo", 0 )
788 fschmid 12
{
13
        tabTypoLayout = new QGridLayout( this, 1, 1, 11, 6, "tabTypoLayout");
14
        groupBox1a = new QGroupBox( this, "groupBox1a" );
15
        groupBox1a->setColumnLayout(0, Qt::Vertical );
16
        groupBox1a->layout()->setSpacing( 6 );
17
        groupBox1a->layout()->setMargin( 11 );
18
        groupBox1a->setTitle( tr( "Subscript" ) );
19
        groupBox1aLayout = new QGridLayout( groupBox1a->layout() );
20
        groupBox1aLayout->setAlignment( Qt::AlignTop );
21
        subDisplacement = new QSpinBox( groupBox1a, "subDisplacement" );
22
        subDisplacement->setMaxValue( 100 );
823 fschmid 23
        subDisplacement->setValue( prefsData->valueSubScript );
788 fschmid 24
        subDisplacement->setSuffix( tr( " %" ) );
25
        groupBox1aLayout->addWidget( subDisplacement, 0, 1, Qt::AlignLeft );
26
        textLabel1a = new QLabel(subDisplacement, tr( "&Displacement:" ), groupBox1a, "textLabel1a" );
27
        groupBox1aLayout->addWidget( textLabel1a, 0, 0 );
28
        subScaling = new QSpinBox( groupBox1a, "subScaling" );
29
        subScaling->setMaxValue( 100 );
30
        subScaling->setMinValue( 1 );
823 fschmid 31
        subScaling->setValue( prefsData->scalingSubScript );
788 fschmid 32
        subScaling->setSuffix( tr( " %" ) );
33
        groupBox1aLayout->addWidget( subScaling, 0, 3, Qt::AlignLeft );
34
        textLabel2a = new QLabel(subScaling, tr( "&Scaling:" ), groupBox1a, "textLabel2a" );
35
        groupBox1aLayout->addWidget( textLabel2a, 0, 2 );
36
        tabTypoLayout->addWidget( groupBox1a, 0, 0 );
37
        groupBox2a = new QGroupBox( this, "groupBox2a" );
38
        groupBox2a->setColumnLayout(0, Qt::Vertical );
39
        groupBox2a->layout()->setSpacing( 6 );
40
        groupBox2a->layout()->setMargin( 11 );
41
        groupBox2a->setTitle( tr( "Superscript" ) );
42
        groupBox2aLayout = new QGridLayout( groupBox2a->layout() );
43
        groupBox2aLayout->setAlignment( Qt::AlignTop );
44
        superDisplacement = new QSpinBox( groupBox2a, "superDisplacement" );
45
        superDisplacement->setMaxValue( 100 );
823 fschmid 46
        superDisplacement->setValue( prefsData->valueSuperScript );
788 fschmid 47
        superDisplacement->setSuffix( tr( " %" ) );
48
        groupBox2aLayout->addWidget( superDisplacement, 0, 1, Qt::AlignLeft );
49
        textLabel3a = new QLabel(superDisplacement, tr( "D&isplacement:" ), groupBox2a, "textLabel3a" );
50
        groupBox2aLayout->addWidget( textLabel3a, 0, 0 );
51
        superScaling = new QSpinBox( groupBox2a, "superScaling" );
52
        superScaling->setMaxValue( 100 );
53
        superScaling->setMinValue( 1 );
823 fschmid 54
        superScaling->setValue( prefsData->scalingSuperScript );
788 fschmid 55
        superScaling->setSuffix( tr( " %" ) );
56
        groupBox2aLayout->addWidget( superScaling, 0, 3, Qt::AlignLeft );
57
        textLabel4a = new QLabel(superScaling, tr( "S&caling:" ), groupBox2a, "textLabel4a" );
58
        groupBox2aLayout->addWidget( textLabel4a, 0, 2 );
59
        tabTypoLayout->addWidget( groupBox2a, 1, 0 );
60
        groupBox3a = new QGroupBox( this, "groupBox3a" );
61
        groupBox3a->setColumnLayout(0, Qt::Vertical );
62
        groupBox3a->layout()->setSpacing( 6 );
63
        groupBox3a->layout()->setMargin( 11 );
64
        groupBox3a->setTitle( tr( "Small Caps" ) );
65
        groupBox3aLayout = new QGridLayout( groupBox3a->layout() );
66
        groupBox3aLayout->setAlignment( Qt::AlignTop );
67
        capsScaling = new QSpinBox( groupBox3a, "capsScaling" );
68
        capsScaling->setMaxValue( 100 );
69
        capsScaling->setMinValue( 1 );
823 fschmid 70
        capsScaling->setValue( prefsData->valueSmallCaps );
788 fschmid 71
        capsScaling->setSuffix( tr( " %" ) );
72
        groupBox3aLayout->addWidget( capsScaling, 0, 1, Qt::AlignLeft );
73
        textLabel5a = new QLabel(capsScaling, tr( "Sc&aling:" ), groupBox3a, "textLabel5a" );
74
        groupBox3aLayout->addWidget( textLabel5a, 0, 0 );
75
        tabTypoLayout->addWidget( groupBox3a, 2, 0 );
76
        groupBox4a = new QGroupBox( this, "groupBox4a" );
77
        groupBox4a->setColumnLayout(0, Qt::Vertical );
78
        groupBox4a->layout()->setSpacing( 6 );
79
        groupBox4a->layout()->setMargin( 11 );
80
        groupBox4a->setTitle( tr( "Other" ) );
81
        groupBox4aLayout = new QGridLayout( groupBox4a->layout() );
82
        groupBox4aLayout->setAlignment( Qt::AlignTop );
83
        baseGrid = new MSpinBox( 1, 1000, groupBox4a, 1 );
84
        baseGrid->setSuffix( unit );
823 fschmid 85
        baseGrid->setValue(prefsData->valueBaseGrid * unitBase);
788 fschmid 86
        groupBox4aLayout->addWidget( baseGrid, 0, 1, Qt::AlignLeft );
87
        textLabel6a = new QLabel(baseGrid, tr( "Baseline &Grid:" ),groupBox4a, "textLabel6a" );
88
        groupBox4aLayout->addWidget( textLabel6a, 0, 0 );
89
        baseOffset = new MSpinBox( 0, 1000, groupBox4a, 1 );
90
        baseOffset->setSuffix( unit );
823 fschmid 91
        baseOffset->setValue(prefsData->offsetBaseGrid * unitBase);
788 fschmid 92
        groupBox4aLayout->addWidget( baseOffset, 1, 1, Qt::AlignLeft );
93
        textLabel7a = new QLabel(baseOffset, tr( "Baseline &Offset:" ),groupBox4a, "textLabel7a" );
94
        groupBox4aLayout->addWidget( textLabel7a, 1, 0 );
95
        autoLine = new QSpinBox( groupBox4a, "autoLine" );
96
        autoLine->setMaxValue( 100 );
97
        autoLine->setMinValue( 1 );
823 fschmid 98
        autoLine->setValue( prefsData->autoLineSpacing );
788 fschmid 99
        autoLine->setSuffix( tr( " %" ) );
100
        groupBox4aLayout->addWidget( autoLine, 2, 1, Qt::AlignLeft );
101
        textLabel8a = new QLabel( autoLine, tr( "Automatic &Line Spacing:" ), groupBox4a, "textLabel8a" );
102
        groupBox4aLayout->addWidget( textLabel8a, 2, 0 );
103
        tabTypoLayout->addWidget( groupBox4a, 3, 0 );
104
        QToolTip::add( superDisplacement, tr( "Displacement above the baseline of the font on a line" ) );
105
        QToolTip::add( superScaling, tr( "Relative size of the superscript compared to the normal font" ) );
106
        QToolTip::add( subDisplacement, tr( "Displacement below the baseline of the normal font on a line" ) );
107
        QToolTip::add( subScaling, tr( "Relative size of the subscript compared to the normal font" ) );
108
        QToolTip::add( capsScaling, tr( "Relative size of the small caps font compared to the normal font" ) );
109
        QToolTip::add( autoLine, tr( "Percentage increase over the font size for the line spacing" ) );
110
}