[haiku-bugs] Re: [Haiku] #8555: [AboutSystem] underline links on mouse over (easy)

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Wed, 04 Feb 2015 07:10:06 -0000

#8555: [AboutSystem] underline links on mouse over (easy)
----------------------------------------+----------------------------
   Reporter:  diver                     |      Owner:  stpere
       Type:  bug                       |     Status:  assigned
   Priority:  normal                    |  Milestone:  R1
  Component:  Applications/AboutSystem  |    Version:  R1/Development
 Resolution:                            |   Keywords:
 Blocked By:                            |   Blocking:
Has a Patch:  1                         |   Platform:  All
----------------------------------------+----------------------------

Comment (by pulkomandy):

 This looks good so far (didn't test it yet). There are some possible
 improvements however:

 {{{ const ActionInfo*   _ActionInfoAt(const BPoint& where) const; }}}
 should be declared in the "methods" part of the class (next to
 {{{_ActionAt}}}, currently you have it in the "fields" part of the class.

 {{{view->SetFontAndColor(startOffset, endOffset, &font);}}} in both
 MouseOver and MouseAway, you can use the "mask" parameter of
 SetFontAndColor to only change the face. This makes the code simpler:
 {{{
 BFont font;
 font.SetFace(B_ITALICS_FACE);
 view->SetFontAndColor(startOffset, endOffset, &font, B_FONT_FACE);
 }}}

 It makes sure nothing other than the face is changed, so the size, family,
 etc. are preserved.

--
Ticket URL: <https://dev.haiku-os.org/ticket/8555#comment:21>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: