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

List:       koffice-devel
Subject:    Precision "display mode" for KoRuler
From:       "Aron Stansvik" <elvstone () gmail ! com>
Date:       2007-11-02 21:23:58
Message-ID: 751a4f870711021423q4df11d5cu627cf4f9c18ca81b () mail ! gmail ! com
[Download RAW message or body]

Hello folks, I've found a JJ for myself :)

I would like to take a shot at implementing an alternate display mode
for the ruler during Shift-dragging of indents, when the indents are
moved without snapping. Something similar, or even identical, to what
Microsoft Word has (see attached screenshot).

First obvious question; any objections to this?

Since the KOffice code base is so nice and elegant nowadays
(especially the libs) I don't want to uglify it with a bad solution.
Therefore I'll post here some questions and thoughs regarding the
implementation before diving in. This feature is a small potato for
you experienced Qt/C++ nutheads, but for someone like me it would be
nice to have the design somewhat OKed before starting.

The current KoRuler is built to only show just that, a ruler. The
(temporary) display mode I'd like to implement will have none of the
visual elements of the traditional ruler. So should I:

1) Just have a flag in KoRuler that indicates "normal" vs.
"my-new-mode", and then something like this in KoRuler::paintEvent():

if (d->normalMode) {
    // Current code here
} else {
    // My code here
}

This flag would be changed on Shift+LMB press on the indent markers
and reset on release.

2) Do it more elegantly using strategies. Thomas, you recently
strategized the painting of KoRuler with regard to the orientation of
the ruler. This would then be a more general strategization, as the
virtuals PaintingStrategy::drawTabs() et.c. don't make much sense for
my "display mode". Any ideas on this? Over designing?

Good ideas welcome if you guys (Thomas, Casper?) are not too busy!

Regards,
Aron

["msword.png" (image/png)]

_______________________________________________
koffice-devel mailing list
koffice-devel@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