Closed
Bug 66555
Opened 24 years ago
Closed 19 years ago
truncate image filename in context menu more cleanly
Categories
(SeaMonkey :: UI Design, defect)
SeaMonkey
UI Design
Tracking
(Not tracked)
RESOLVED
WONTFIX
Future
People
(Reporter: bugzilla, Assigned: doronr)
References
Details
(Keywords: testcase)
Attachments
(3 files)
(deleted),
image/gif
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
spun off from bug 21515. thx to dean for pointing this out.
if the image file has a long name, we currently truncate it as "Save Image
(long_long_long..." instead of "Save Image (long_long_lo...name.gif)". we should
do the latter.
Reporter | ||
Comment 1•24 years ago
|
||
doron, you wanna take this one...?
Assignee | ||
Comment 2•24 years ago
|
||
--> me.
i have a patch, just need to know, how much should we cut off? ns4 win98 does this:
[10]...[6].ext
Assignee: ben → doronr
Target Milestone: --- → mozilla0.8
Comment 3•24 years ago
|
||
Sounds OK to me.
Reporter | ||
Comment 4•24 years ago
|
||
actually, i rechecked stuff and what i'm seeing is (filename.gif)... where the
ellipses follow the whole filename. {eg, the banner on http://mozilla.org/]
would that be yet another bug? or does that pertain to this one?
Reporter | ||
Comment 5•24 years ago
|
||
argh, disregard my comment re: the ellipses. of course they should be there,
since a dialog would follow after selection. doh!
anyhow, i'm gonna attach a test image file with a long name.
Keywords: testcase
Reporter | ||
Comment 6•24 years ago
|
||
Comment 7•24 years ago
|
||
Doron, sorry, not trying to make this even more complicated, but... Instead of
a predetermined number of characters before and after the ellipsis, how hard
would it be to calculate the width of the characters to display, and always make
sure the name doesn't exceed a certain width? Though perhaps a minimum number
of characters should always be displayed no matter what.
Assignee | ||
Comment 8•24 years ago
|
||
Is it possible to determine the width of the context menu? Even then, we need a
maximum width.
I am going to play more around with ns4 and see what it does
Comment 10•24 years ago
|
||
A spec? For this? Hahahaha... ahem.
Doron, don't give any special treatment to the suffix -- a picture doesn't
necessarily have one. Just {up to 10 characters}...{up to 10 characters}.
Assignee | ||
Comment 11•24 years ago
|
||
yea, i currenty do [10]...[6]
a lot of capital letters will mess any more than that, since we are not using
unispace (um, where each character takes the same width, forgot how that is called).
Assignee | ||
Comment 12•24 years ago
|
||
i'll attach my patch tomorrow, still playing with the numbers.
Assignee | ||
Comment 13•24 years ago
|
||
[10]...[6] fails with image names containing a lot of capital letters, so this
is more complex.
Target Milestone: mozilla0.8 → mozilla0.9
Comment 14•24 years ago
|
||
Doron, this is why I suggested calculating the width and capping the filename
based on some sort of max width. Then it won't matter what kind of characters
are in the filename.
Comment 15•24 years ago
|
||
I think as long as the .extension is preserved and has a few letters before
that extension (up to like 6) and a few letters from the beginning of the word
(up to like 10) you should be fine. what do you mean by failing?
Assignee | ||
Comment 16•24 years ago
|
||
by failing i meant there is overflow and the last bit of the name becomes "...".
A image with just capital letters can overflow after 6 characters showing in
modern for example.
Probably a good idea is to have a loop until no overflow occurs and keepign
taking a character away from the center or such. If anyone has any idea how to
check if a menuitem overflows in js...
Assignee | ||
Comment 17•24 years ago
|
||
i have a evil temp fix - make the imagename lowercase!
/me ducks
Assignee | ||
Comment 18•24 years ago
|
||
-> 1.0
There is still some overflow issues, now only with classic and images with
capital letters (AWWWWWWWWWWW.jpg for example). So this is going to take more
time, especially since Ben says there is no simple js way to check for overflow
in a menuitem.
Target Milestone: mozilla0.9 → mozilla1.0
Assignee | ||
Comment 19•24 years ago
|
||
Assignee | ||
Comment 20•24 years ago
|
||
ok, i added a patch which will do it for most cases. The only case is the
aforementioned case of capital letters in the imagename. Also, this seems to
only happen in classic, modern's contextmenus are more flexible it seems.
So unless anyone knows of a way to check if a menuitem is overflowing, I suggest
this for a temp fix.
Keywords: patch
Comment 21•24 years ago
|
||
Looks good to me as a temp fix... r=bzbarsky@mit.edu
Comment 22•24 years ago
|
||
Is endBit long enough? For filenames with an 3-character extension, that's the
last character of the filename then .extension.
Assignee | ||
Comment 23•24 years ago
|
||
the last 5 chars are taken, so it would bee "x.foo" for example as endbit.
Comment 24•24 years ago
|
||
That's what I said, just not too clearly! I was just wondering if this was
enough info.
Assignee | ||
Comment 26•24 years ago
|
||
Comment 27•24 years ago
|
||
Yeah, I was going to mention that (!). r=dean_tessman@hotmail.com
Assignee | ||
Comment 28•24 years ago
|
||
cc: alecf for a possible sr=
I'm looking at to why modern handles this better (it lets the context menu grow)
while classic causes overflow pretty quickly.
Comment 29•24 years ago
|
||
so we don't know how classic does this? seems like they must set a maximum width
on the menu or something?
Anyway, I think this patch is hacky, I'd like further investigation on classic
first.
Assignee | ||
Comment 30•24 years ago
|
||
ok, i found the css that makes classic's menu less wide that modern.
http://lxr.mozilla.org/seamonkey/source/themes/classic/global/win/menu.css#66
Modern has
http://lxr.mozilla.org/seamonkey/source/themes/modern/global/menu.css#198
so we can change classic's max-width then. However, I still think we should
truncate the imagename. Any opinions?
Comment 31•24 years ago
|
||
Yes, no matter what we need to truncate. But if we change the max width then we
should be able to push this out to around 25 characters instead of 15.
Comment 32•24 years ago
|
||
I really think we should leave it up to the theme to decide when (or if) to
truncate.
Assignee | ||
Comment 33•24 years ago
|
||
hmm, the problem is, it won't truncate "neatly" (ie, cuts off at the end, not in
the middle). But that is anothing issue probably...
Assignee | ||
Comment 34•23 years ago
|
||
This is very ugly for very long imagenames, the context menu grows to almost hal
fo the screen width.
I think that we should increase the classic width to be like modern and then do
a name truncation after say 25. Any opinions?
Comment 35•23 years ago
|
||
For the truncating on the right instead of the middle, can the crop for menus be
set to center, similar to how it's (going to be?) done for the bookmarks window?
The cropping is handled in nsTextBoxFrame.cpp, so it should be possible for
this to take effect.
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla1.0 → Future
Comment 36•23 years ago
|
||
What should this bug's status be? I notice in the latest builds that the
filename is no longer displayed at all in the context menu. Is this
intentional, or just a temporary thing?
Comment 37•22 years ago
|
||
wyoung: the new context menus that landed just before 1.0 RC1 don't include the
image name in the context menu.
There is a working patch for this in bug 136110, but there doesn't seem to be
consensus that this feature is useful. If you would like it, please comment in
bug 136110 and/or vote for that bug.
Updated•20 years ago
|
Product: Core → Mozilla Application Suite
Assignee | ||
Comment 38•19 years ago
|
||
the imagename isn't needed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•