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

List:       kde-devel
Subject:    Re: okteta text color
From:       "Friedrich W. H. Kossebau" <kossebau () kde ! org>
Date:       2008-07-03 10:47:24
Message-ID: 200807031247.25220.kossebau () kde ! org
[Download RAW message or body]

Hi Matthew,

Am Mittwoch, 30. April 2008, um 03:46 Uhr, schrieb Matthew Woehlke:
> Luciano Montanaro wrote:
> > On Monday 28 April 2008 09:44:47 Friedrich W. H. Kossebau wrote:
> >> Hi Carlo,
> >>
> >> thanks for the report.
> >> Still, please try to use bugs.kde.org to make sure I really see your
> >> reports :)
> >>
> >> Am Montag, 28. April 2008, um 01:29 Uhr, schrieb Carlo:
> >>> Hi,
> >>> I've just tried okteta and since I use a dark color scheme(obsidian
> >>> coast) the text is unreadable
> >>> http://uploadgeek.nl/files/gqh2c7tdl228qb8rrtdx.png
> >>> so I think that either the background color should be forced to be
> >>> white, or the text should use colors from the actual colorscheme
> >>
> >> Two (or such) colors are still hardcoded, as there are no entries in the
> >> colorscheme with proper semantics. On my Todo list for too long, true,
> >> will hopefully soon be tackled.
> >>
> >> Forcing the backround to white is a good idea, will fallback to that if
> >> I miss to fix the coloring in time for the 4.1 release.
> >
> > I don't think so -- no color should be hardcoded.
> > Can't you reuse some other color role, for now?
>
> What Luciano said ;-), both about forcing a color (don't do that!) and
> using some color roles.
>
> The names of the color roles are really meant to be *suggestions*, not
> rules. That is, if you need a color that fits into one of the suggested
> roles, you should use the appropriate color for consistency. Otherwise,
> if you just need "colors", you're pretty much free to pick whatever
> makes the most sense, or even what seems most aesthetically pleasing in
> most instances (see for example how kwrite uses the color roles).
>
> Those that followed Olaf's original proposal will know this, but
> originally the roles didn't even have names, just 'extra roles 1-7'. The
> names are a matter of looking nicer and suggesting common use cases for
> consistency, *not* usage requirements.
>
> Maybe I need to try to make this more explicit in the documentation?

No, I don't think so, at least I got the intentions, well done. Plus, for 
consistency I would even make a name semantics matching usage a requirement, 
where it is possible. Because if I set NegativeText to red I want to also see 
red for all texts with negative meanings, not green or yellow.

But what might help me and others would be some example code snippets in the 
apidox how the class is intended to be used. To find out how to use it was 
what needed me the most time

> Friedrich: If you can tell me the meaning of the colors currently used,
> I can offer suggestions. It looks like you have normal text (um,
> NormalText??), non-printable text, and text being edited. For
> non-printable, there is InactiveText, or if you don't like that look,
> NeutralText. For text being edited, ActiveText would be most strictly
> appropriate, though some feel that tends to be suboptimal in many color
> schemes (it is, really, but that has a lot to do with that being the
> hardest color to assign in my experience, and I would welcome
> suggestions for improvement of the shipped schemes). You might also use
> PositiveText for editing, and either color could use any combination of
> LinkText and VisitedText (unless okteta actually has clickable links,
> that is).

Thanks for the proposal. I for now went with this:

static inline KColorScheme::ForegroundRole foregroundRoleForChar( const 
KHECore::KChar byteChar )
{
  return byteChar.isUndefined() ? KColorScheme::NegativeText :
         byteChar.isPunct() ?     KColorScheme::InactiveText :
         byteChar.isPrint() ?     KColorScheme::NormalText :
         /*others, like <32*/     KColorScheme::ActiveText;
}

And to highlight bookmarks I use
colorScheme.background(KColorScheme::LinkBackground)

Any suggestions for improvements? :)

Cheers
Friedrich

-- 
Okteta - KDE Hex Editor, coming to you with KDE 4.1
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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