Subversion Repositories Scribus

Rev

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