[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Bug 76757 : modification of style manager
From:       p.stirnweiss_koffice () bluewin ! ch
Date:       2004-07-26 11:39:16
Message-ID: 40F7A9ED0003BBB7 () mssbzhb-int ! msg ! bluewin ! ch
[Download RAW message or body]

>-- Message original --
>From: Nicolas Goutte <nicolasg@snafu.de>
>To: For developer's discussion about KOffice <koffice-devel@mail.kde.org>
>Date: Sun, 25 Jul 2004 15:54:46 +0200
>Subject: Re: Bug 76757 : modification of style manager
>Reply-To: For developer's discussion about KOffice <koffice-devel@mail.kde.org>
>
>
>On Sunday 25 July 2004 15:41, p.stirnweiss_koffice@bluewin.ch wrote:
>> >-- Message original --
>>
>> From: Nicolas Goutte <nicolasg@snafu.de>
>>
>> >To: For developer's discussion about KOffice <koffice-devel@mail.kde.org>
>> >Date: Sun, 25 Jul 2004 14:52:42 +0200
>> >Subject: Re: Bug 76757 : modification of style manager
>> >Reply-To: For developer's discussion about KOffice
>> > <koffice-devel@mail.kde.org>
>> >
>> >On Sunday 25 July 2004 10:50, p.stirnweiss_koffice@bluewin.ch wrote:
>> >> >-- Message original --
>> >>
>> >> From: Nicolas Goutte <nicolasg@snafu.de>
>> >>
>> >> >To: For developer's discussion about KOffice
>> >> > <koffice-devel@mail.kde.org> Date: Sat, 24 Jul 2004 23:36:52 +0200
>> >> >Subject: Re: Bug 76757 : modification of style manager
>> >> >Reply-To: For developer's discussion about KOffice
>> >> > <koffice-devel@mail.kde.org>
>> >> >
>> >> >On Saturday 24 July 2004 19:07, p.stirnweiss_koffice@bluewin.ch wrote:
>> >> >> Hi, I am starting to have a look at this one.
>> >> >> I would like to change some stuff in the way the style manager is
>> >> >> organised. Let me know your opinions on these ideas (I personaly
>find
>> >>
>> >> them
>> >>
>> >> >> more logical, but it may not look the same to everybody):
>> >> >
>> >> >The problem of splitting dialogs is that it is only good if it is
not
>> >
>> >done
>> >
>> >> >only in the stylist but also in each of the individual dialogs.
>> >> > (Especially
>> >> >
>> >> >for the points 2 and 3 below.)
>> >
>> >I want to add to my comment here, that it is also important, as KWord
>is
>> >
>> >supposed to get character styles soon and possibly the stylist dialog
>> > should
>> >
>> >be modified having this idea in mind too.
>>
>> Wow, this seems to evolve way beyond my current level of understanding.
>I
>> am not sure it is Junior level anymore :).
>
>Well, I had always doubts about marking this bug as Junior Job due to the
>
>Stylist, but I did anyway. :-)
>
>To be serious again: I do not mean that you need to do it. I just want to
>tell 
>that layout (paragraph formatting) and character formatting have to be kept
>
>separated due to this. (Image layout dialogs being greyed out for character
>
>styles.)
>
>> Anyway, I have a patch that only move the Font position to the Font effect
>> tab. This solve the Format/Font dialog in 800x600 all together. And make
>> the Style manager just a bit to big (height wise) but the buttons
>> (OK,Cancel...) are now reachable. I do not know if this patch is
>> interesting if the whole thing is going to have a face lift anyway.
>
>Fix the bug first. (As we have not too much developers, it always possible
>
>that the changes would be for after KOffice 1.4.)

OK. Here is a patch (bug76757...dif) that transfers the Font position to
the font effect tab. This reduces the height of the style manager. It is
still a bit too big, but the buttons are reachable in 800x600 with the panel
normal size. It also fixes the format/font dialog. In order to reduce the
height of this dialog more, there are two tabs that need work : font effect
(a bit) and mainly Indent and spacing.
The format/paragraph is about the same (usable but a little bit big), this
is also due to indent and spacing.
Configure autocorrect seems allright to me, as well as configure Kword.

So the bug is not entirely fixed but at least the dialog boxes are now usable.

Once again, this is my second piece of programming so please make sure I
have not broken anything. The software compiles, and the functionality seems
to work OK (both in style manager and in individual format font dialog).


>
>>
>(...)
>> >> >> 2. Create a "Paragraph flow" tab (better name welcome) that would
>> >> >> group
>> >> >>
>> >> >> General/Next style (perhaps renamed to Style of next paragraph),
>> >> >> Font/Font Effect/Language and Hyphenation.
>> >> >
>> >> >No!
>> >> >
>> >> >General/Next style is at layout level (layout == paragraph formating)
>> >> >
>> >> >But font effect, language and hypenation are charcter properties.
>> >>
>> >> I did not want to move font effect, just the langage and hyphenation
>(I
>> >> was indicating the path, but I see now that it was not very clear)
and
>> >
>> >the
>> >
>> >> next style.
>> >>
>> >>
>> >> I agree that langages are not always used at the whole paragraph and
>can
>> >> be used at a word level. However, I don't agree it is a character
>> >> property. The minimum item you will give a langage property is a word
>> >> and most of the time it is set for paragraphs. In order to set it for
>an
>> >> individual word we might need to add a langage sub-menu in the format
>> >> menu. I would definitly not expect to find the langage setting in Fonts.
>> >
>> >But it is a character property. If you want it word-wise you cannot have
>> >it
>> >paragraph-wise. A property can be at paragraph level or at character
>> > level.
>> >
>> >That is all. (That perhaps "font" is a bad title is perhaps another
>> > problem.)
>>
>> OK. I understand the problem now. (Sorry to be a bit slow but I just
>> started to have a look at Koffice and programming in general). I will
give
>> a thorough thinking (yes, with the proper fuel, I can do this :) ). I
still
>> think that there is a way to accomodate the programming constraints and
>> still have something logical on the user perspective.
>
>Yes, of course, I suppose that the user interface could be improved. I just
>
>wanted to tell that we have constraints so that we cannot mix the properties
>
>freely (because otherwise users would not understand anymore what is only
>paragraph-level only and what can be done at character-level too.)
>
>>
>(...)
>> >
>> >> >> Pierre
>> >
>> >Have a nice day!
>(...)
>

The second patch is to have a longer sentence (that uses more than two lines)
to show the indent and spacing of the style. If we need something more serious,
let me know. I would also like to display a paragraph in front of it with
standard formating and one after with the "next style" applied but there
is a problem with the bullet/number preview.


>_______________________________________________
>koffice-devel mailing list
>koffice-devel@mail.kde.org
>https://mail.kde.org/mailman/listinfo/koffice-devel


["Patch stylist_longer_preview_phrase.diff" (text/x-diff)]

Index: koStylist.cc
===================================================================
RCS file: /home/kdecvs/kde/koffice/lib/kotext/koStylist.cc,v
retrieving revision 1.56
diff -u -3 -p -u -p -r1.56 koStylist.cc
--- koStylist.cc	23 Jul 2004 15:15:51 -0000	1.56
+++ koStylist.cc	26 Jul 2004 09:50:03 -0000
@@ -227,7 +227,7 @@ void KoStyleManager::addGeneralTab( int 
         d->cbIncludeInTOC = 0;
     }
 
-    d->preview = new KoStylePreview( i18n( "Preview" ), i18n( "The quick brown fox \
jumps over the lazy dog" ), tab, "stylepreview" ); +    d->preview = new \
KoStylePreview( i18n( "Preview" ), i18n( "The quick brown fox jumps over the lazy \
dog. And, what about the cat, one may ask? Well, the cat is playing cards with the \
mouse, the bird and the fish. It is, to say the least a hell of a party!" ), tab, \
"stylepreview" );  
     tabLayout->addMultiCellWidget( d->preview, row, row, 0, 1 );
 


["bug76757_stylemgr+font.diff" (text/x-diff)]

Index: koFontDia.cc
===================================================================
RCS file: /home/kdecvs/kde/koffice/lib/kotext/koFontDia.cc,v
retrieving revision 1.54
diff -u -3 -p -u -p -r1.54 koFontDia.cc
--- koFontDia.cc	9 May 2004 17:16:59 -0000	1.54
+++ koFontDia.cc	26 Jul 2004 09:50:03 -0000
@@ -350,8 +350,8 @@ KoFontChooser::KoFontChooser( QWidget* p
     : QTabWidget( parent, name )
 {
     d = new KoFontChooserPrivate;
-    setupTab1(_withSubSuperScript, fontListCriteria );
-    setupTab2();
+    setupTab1( fontListCriteria );
+    setupTab2( _withSubSuperScript );
     // More modular solution: one widget per tab....
     d->m_shadowWidget = new KoTextShadowWidget( this );
     connect( d->m_shadowWidget, SIGNAL(changed()), this, SLOT(slotShadowChanged()) \
); @@ -369,7 +369,7 @@ QColor KoFontChooser::color() const
     return d->m_textColor;
 }
 
-void KoFontChooser::setupTab1(bool _withSubSuperScript, uint fontListCriteria )
+void KoFontChooser::setupTab1( uint fontListCriteria )
 {
     QWidget *page = new QWidget( this );
     addTab( page, i18n( "&Fonts" ) );
@@ -379,51 +379,6 @@ void KoFontChooser::setupTab1(bool _with
     m_chooseFont = new KFontChooser(page, "FontList", false, list);
     lay1->addWidget(m_chooseFont);
 
-    QVGroupBox *grp = new QVGroupBox(i18n("Position"), page);
-    lay1->addWidget(grp);
-    QWidget* grpBox = new QWidget( grp ); // container for the grid - laid out \
                inside the QVGroupBox
-    QGridLayout *grid = new QGridLayout( grpBox, 2, 3, 0, KDialog::spacingHint() );
-    grid->setColStretch( 1, 1 ); // better stretch labels than spinboxes.
-
-    // superscript/subscript need to be checkboxes, not radiobuttons.
-    // otherwise it's not possible to disable both, and there's no room for a 3rd \
                one like 'none'
-    m_superScript = new QCheckBox(i18n("Su&perscript"),grpBox);
-    grid->addWidget(m_superScript,0,0);
-
-    m_subScript = new QCheckBox(i18n("Su&bscript"),grpBox);
-    grid->addWidget(m_subScript,1,0);
-
-    d->m_lRelativeSize = new QLabel ( i18n("Relative &size:"), grpBox);
-    d->m_lRelativeSize->setAlignment( Qt::AlignRight );
-    grid->addWidget(d->m_lRelativeSize,0,1);
-
-    // ## How to make this widget smaller? Sounds like the [minimum]sizeHint for \
                KIntNumInput is big...
-    d->m_relativeSize = new KIntNumInput( grpBox );
-    d->m_lRelativeSize->setBuddy( d->m_relativeSize );
-    grid->addWidget(d->m_relativeSize,0,2);
-
-    d->m_relativeSize-> setRange(1, 100, 1,false);
-    d->m_relativeSize->setSuffix("%");
-
-    QLabel *lab = new QLabel ( i18n("Offse&t from baseline:"), grpBox);
-    lab->setAlignment( Qt::AlignRight );
-    grid->addWidget(lab,1,1);
-
-    d->m_offsetBaseLine= new KIntNumInput( grpBox );
-    lab->setBuddy( d->m_offsetBaseLine );
-    grid->addWidget(d->m_offsetBaseLine,1,2);
-
-    d->m_offsetBaseLine->setRange(-9, 9, 1,false);
-    d->m_offsetBaseLine->setSuffix("pt");
-
-    if(!_withSubSuperScript)
-    {
-        m_subScript->setEnabled(false);
-        m_superScript->setEnabled(false);
-        d->m_relativeSize->setEnabled( false );
-        d->m_lRelativeSize->setEnabled( false );
-    }
-
     QHGroupBox* colorsGrp = new QHGroupBox(i18n("Colors"), page);
     lay1->addWidget(colorsGrp);
     //grid = new QGridLayout( colorsGrp, 2, 2, KDialog::marginHint(), \
KDialog::spacingHint() ); @@ -433,8 +388,6 @@ void KoFontChooser::setupTab1(bool \
                _with
     m_backGroundColorButton = new QPushButton( i18n( "Change Bac&kground Color..." \
), colorsGrp );  //grid->addWidget(m_backGroundColorButton,0,1);
 
-    connect( m_subScript, SIGNAL(clicked()), this, SLOT( slotSubScriptClicked() ) );
-    connect( m_superScript, SIGNAL(clicked()), this, SLOT( slotSuperScriptClicked() \
                ) );
     connect( m_colorButton, SIGNAL(clicked()), this, SLOT( slotChangeColor() ) );
 
     connect( m_backGroundColorButton,  SIGNAL(clicked()), this, SLOT( \
slotChangeBackGroundColor() ) ); @@ -442,14 +395,9 @@ void \
KoFontChooser::setupTab1(bool _with  connect( m_chooseFont, SIGNAL( fontSelected( \
const QFont & )),  this, SLOT( slotFontChanged(const QFont &) ) );
 
-    connect( d->m_relativeSize, SIGNAL( valueChanged(int) ), this, SLOT( \
                slotRelativeSizeChanged( int )));
-    connect( d->m_offsetBaseLine, SIGNAL( valueChanged(int) ), this, SLOT( \
                slotOffsetFromBaseLineChanged( int )));
-
-    updatePositionButton();
-
 }
 
-void KoFontChooser::setupTab2()
+void KoFontChooser::setupTab2( bool _withSubSuperScript )
 {
     QWidget *page = new QWidget( this );
     addTab( page, i18n( "Font &Effects" ) );
@@ -493,7 +441,53 @@ void KoFontChooser::setupTab2()
     m_strikeOutType->insertStringList( KoTextFormat::strikeOutStyleList() );
 
     d->m_wordByWord = new QCheckBox( i18n("&Word by word"), grp);
-    grid->addWidget( d->m_wordByWord, 5, 0);
+    grid->addWidget( d->m_wordByWord, 4, 0);
+       
+    QVGroupBox *grp1 = new QVGroupBox(i18n("Position"), page);
+    grid->addMultiCellWidget( grp1, 5, 5, 0, grid->numCols()-1 );
+    QWidget* grpBox = new QWidget( grp1 ); // container for the grid - laid out \
inside the QVGroupBox +    QGridLayout *grid1 = new QGridLayout( grpBox, 2, 3, 0, \
KDialog::spacingHint() ); +    grid1->setColStretch( 1, 1 ); // better stretch labels \
than spinboxes. +
+    // superscript/subscript need to be checkboxes, not radiobuttons.
+    // otherwise it's not possible to disable both, and there's no room for a 3rd \
one like 'none' +    m_superScript = new QCheckBox(i18n("Su&perscript"),grpBox);
+    grid1->addWidget(m_superScript,0,0);
+
+    m_subScript = new QCheckBox(i18n("Su&bscript"),grpBox);
+    grid1->addWidget(m_subScript,1,0);
+
+    d->m_lRelativeSize = new QLabel ( i18n("Relative &size:"), grpBox);
+    d->m_lRelativeSize->setAlignment( Qt::AlignRight );
+    grid1->addWidget(d->m_lRelativeSize,0,1);
+
+    // ## How to make this widget smaller? Sounds like the [minimum]sizeHint for \
KIntNumInput is big... +    d->m_relativeSize = new KIntNumInput( grpBox );
+    d->m_lRelativeSize->setBuddy( d->m_relativeSize );
+    grid1->addWidget(d->m_relativeSize,0,2);
+
+    d->m_relativeSize-> setRange(1, 100, 1,false);
+    d->m_relativeSize->setSuffix("%");
+
+    QLabel *lab5 = new QLabel ( i18n("Offse&t from baseline:"), grpBox);
+    lab5->setAlignment( Qt::AlignRight );
+    grid1->addWidget(lab5,1,1);
+
+    d->m_offsetBaseLine= new KIntNumInput( grpBox );
+    lab5->setBuddy( d->m_offsetBaseLine );
+    grid1->addWidget(d->m_offsetBaseLine,1,2);
+
+    d->m_offsetBaseLine->setRange(-9, 9, 1,false);
+    d->m_offsetBaseLine->setSuffix("pt");
+
+    if(!_withSubSuperScript)
+    {
+        m_subScript->setEnabled(false);
+        m_superScript->setEnabled(false);
+        d->m_relativeSize->setEnabled( false );
+        d->m_lRelativeSize->setEnabled( false );
+    }
+    
 
 #ifdef ATTRCOMBO
     QLabel * lab3 = new QLabel( i18n("A&ttribute:"), grp);
@@ -538,6 +532,14 @@ void KoFontChooser::setupTab2()
     connect( d->m_wordByWord, SIGNAL(clicked()), this, SLOT( slotWordByWordClicked() \
                ) );
     connect( d->m_language,  SIGNAL( activated ( int  ) ), this, SLOT( \
                slotChangeLanguage( int )));
     connect( d->m_hyphenation, SIGNAL( clicked()), this, SLOT( \
slotHyphenationClicked())); +    connect( m_subScript, SIGNAL(clicked()), this, SLOT( \
slotSubScriptClicked() ) ); +    connect( m_superScript, SIGNAL(clicked()), this, \
SLOT( slotSuperScriptClicked() ) ); +    connect( d->m_relativeSize, SIGNAL( \
valueChanged(int) ), this, SLOT( slotRelativeSizeChanged( int ))); +    connect( \
d->m_offsetBaseLine, SIGNAL( valueChanged(int) ), this, SLOT( \
slotOffsetFromBaseLineChanged( int ))); +
+    updatePositionButton();
+
+
 }
 
 void KoFontChooser::updatePositionButton()
Index: koFontDia.h
===================================================================
RCS file: /home/kdecvs/kde/koffice/lib/kotext/koFontDia.h,v
retrieving revision 1.25
diff -u -3 -p -u -p -r1.25 koFontDia.h
--- koFontDia.h	18 Mar 2004 16:44:30 -0000	1.25
+++ koFontDia.h	26 Jul 2004 09:50:03 -0000
@@ -108,8 +108,8 @@ protected:
     int offsetFromBaseLine() const;
     void setOffsetFromBaseLine(int _offset);
 
-    void setupTab1(bool _withSubSuperScript, uint fontListCriteria );
-    void setupTab2();
+    void setupTab1( uint fontListCriteria );
+    void setupTab2( bool _withSubSuperScript );
     void updatePositionButton();
 
 protected slots:



_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic