Opened 13 years ago
Closed 3 years ago
#8555 closed bug (fixed)
[AboutSystem] underline links on mouse over
Reported by: | diver | Owned by: | stpere |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta4 |
Component: | Applications/AboutSystem | Version: | R1/Development |
Keywords: | Cc: | adam.s.hartford@… | |
Blocked By: | #11822 | Blocking: | |
Platform: | All |
Description
Attachments (5)
Change History (35)
by , 13 years ago
Attachment: | ital_actions.patch added |
---|
comment:1 by , 13 years ago
patch: | 0 → 1 |
---|
follow-up: 6 comment:2 by , 13 years ago
I don't believe underlining is supported in Haiku right now. Instead, I have created a patch to italicize links on mouse over, which I think looks nice enough. From here it will be a simple change to underline them when it's supported, if desired.
comment:3 by , 13 years ago
Cc: | added |
---|
comment:4 by , 13 years ago
Cc: | removed |
---|
comment:5 by , 13 years ago
Cc: | added |
---|
follow-up: 7 comment:6 by , 13 years ago
Replying to ahartford:
I don't believe underlining is supported in Haiku right now.
Haven't tried your patch yet, but would underlined be the constant B_UNDERSCORE_FACE?
comment:7 by , 13 years ago
Replying to humdinger:
Haven't tried your patch yet, but would underlined be the constant B_UNDERSCORE_FACE?
I had tried B_UNDERSCORE_FACE, but it didn't work. Then I noticed there is no underlining in StyledEdit and saw a comment from axeld in ticket #4689 mentioning that underlining is not supported in Haiku, which seems to still be true. I figured it might be appropriate to start with italics since it would just be a constant change once underlining works.
comment:8 by , 12 years ago
Indeed, that's a missing feature we inherited from BeOS. If we wanted to have underlined links, one would have to manually draw the lines by overriding BTextView::Draw(). Or just implement it, although it might not be easy to implement it correctly for all cases (for example, Java does not support it either).
comment:9 by , 12 years ago
I've reworked the first patch to underline links instead of italicize them. Per axeld's suggestion, the lines are drawn manually in BTextView::Draw().
comment:10 by , 12 years ago
There's are unneeded curly brackets in the if-statement on line 102 in the patch.
More complicated to fix is the fact that this solution apparently doesn't account for localization. Change the Locale prefs to something with a completely different font to easily spot the translated license names, e.g. Japanese or Chinese. Look for example to AntiGrain Geometry, the "BSD 3-clause". If the number of characters differ (I guess) those links aren't "mouse-overed".
I'm afraid it's back to the drawing board...
Also, maybe kDarkGrey could be a bit darker to distinguish those links from the normal text even when the mouse doesn't hover over them.
follow-up: 12 comment:11 by , 12 years ago
From what I can see, it is expected that the translated "BSD (3-clause)" is not a hyperlink, and is unrelated to any mouse tracking. AboutSystem is trying to link the licenses to files, and there is only a "BSD (3-clause)" file in /boot/system/data/licenses, so it doesn't find a link to a localized filename and decides not to display the license as a hyperlink. It seems there needs to be a change such that the localized license links still try to point to unlocalized filenames. That, or don't translate the license names (it seems that not all of them are, currently). Such a change may warrant a new ticket.
The patch needs to be updated to draw multiple underlines when the link text wraps. I've made local changes to draw the correct number of lines, but need to figure out how to get them to start/stop at the correct character positions.
by , 12 years ago
Attachment: | ticket_8555.patch added |
---|
Patch updated to draw underlines correctly when link text wraps.
follow-up: 13 comment:12 by , 12 years ago
comment:13 by , 12 years ago
comment:16 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
As mentioned when talking with stpere, the same effect for visually stressing a clickable URL should be the same in People (#3825) and in AboutSystem.
comment:18 by , 11 years ago
I've had a go at applying this, but some of the lines aren't drawn correctly. There are several cases where the lines are either too short or too long. It also doesn't handle spaces in line-wrapped instances well either (the trailing space shouldn't be underlined for instance).
It may only be a few pixels either way, but it just doesn't look nice.
comment:20 by , 10 years ago
I would prever if we implemented B_UNDERSCORE_FACE rather than using ad hoc code in all apps which need it. This way we can writeand debug the code only once.
by , 10 years ago
Attachment: | 0001-Ticket-8555-Underline-links-on-mouse-over.-B_UNDERSC.patch added |
---|
B_ITALIC_FACE has been used in place of B_UNDERSCORE_FACE
comment:21 by , 10 years ago
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.
by , 10 years ago
Attachment: | 0001-Ticket-8555-Underline-links-on-mouse-over.-B_UNDERSC.2.patch added |
---|
Underline links on mouse over. B_UNDERSCORE_FACE is not implemented so B_ITALIC_FACE has been used on mouse over
by , 10 years ago
Attachment: | 0001-Ticket-8555-Underline-links-on-mouse-over.-B_UNDERSC.3.patch added |
---|
Underline links on mouse over. B_UNDERSCORE_FACE is not implemented so B_ITALIC_FACE has been used on mouse over. Coding guidelines have been followed
comment:22 by , 10 years ago
Blocked By: | 11822 added |
---|
comment:24 by , 6 years ago
Yes, but we should use B_UNDERSCORE_FACE and implement it (it's ok to merge this before implementing it).
comment:27 by , 6 years ago
Hi, As you can see there is already a patch, but it needs the app_server (the software that draws everything to the screen) to handle B_UNDERSCORE_FACE and render the text with underline. This is maybe a little above "easy" level, but if you think you can get that part working, feel free to :)
comment:29 by , 5 years ago
Summary: | [AboutSystem] underline links on mouse over (easy) → [AboutSystem] underline links on mouse over |
---|
Removing "easy" from title because the easy part is already implemented (patch pending review). Now we need app_server to handle B_UNDERSCORE_FACE and that's a little more difficult.
comment:30 by , 3 years ago
Milestone: | R1 → R1/beta4 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in hrev55255.
Patch to italicize links on mouse over.