Closed
Bug 79200
Opened 24 years ago
Closed 24 years ago
unable to remove "fixed width font"
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
VERIFIED
FIXED
mozilla0.9.4
People
(Reporter: Brade, Assigned: cmanske)
Details
Attachments
(2 files)
1.13 KB,
patch
|
Details | Diff | Splinter Review | |
5.19 KB,
patch
|
Details | Diff | Splinter Review |
I am unable to remove the "fixed width" font setting as I expect.
* Create a new Composer document.
* type some text
* press accel-shift-T (or choose fixed width from Format | Font menu)
* type some more text
* press accel-shift-T or choose the fixed width menu item again to turn off
* type some more text
Notice that the most recent text is still fixed width.
I expect it to work like the bold and italic menu items.
Comment 1•24 years ago
|
||
moving to 1.0
Priority: -- → P3
Summary: unable to remove "fixed width font" → unable to remove "fixed width font"
Target Milestone: --- → mozilla1.0
Assignee | ||
Comment 2•24 years ago
|
||
Darn! It doesn't act like a toggle. This would be easy to fix, but is a lower
priority compared to other bugs.
The workaround is to use the keybinding to "Discontinue Text Styles", which is
accel+shift+T
Note that the keybinding for setting "fixed-width" font is now accel+T.
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•24 years ago
|
||
changing milestone to 0.9.4
Target Milestone: mozilla1.0 → mozilla0.9.4
Assignee | ||
Comment 4•24 years ago
|
||
The fix is to detect our current state and toggle the "TT" (fixed width)
inline style. There are two approaches to use for the new method:
1. Manipulate the command node:
function toggleFixedWidthFont()
{
var commandNode = document.getElementById("cmd_fontFace");
if (commandNode)
{
var state = commandNode.getAttribute("state");
commandNode.setAttribute("state", state == "tt" ? "" : "tt");
gContentWindow.focus();
goDoCommand("cmd_fontFace");
}
}
2. Use more direct editorShell methods:
function toggleFixedWidthFont()
{
var firstHas = new Object;
var anyHas = new Object;
var allHas = new Object;
allHas.value = false;
window.editorShell.GetTextProperty("tt", "", "", firstHas, anyHas, allHas);
if (allHas.value)
window.editorShell.RemoveTextProperty("tt", "");
else
window.editorShell.SetTextProperty("tt", "", "");
gContentWindow.focus();
goUpdateCommand("cmd_fontFace");
}
Which of these seems better?
Both work (or don't work) exactly the same. There's a problem with removing
the "TT" tag when selection spans 2 contiguous stretches of TT like this:
<tt>1111</tt><tt>2222</tt>
I'll investigate if this is a known problem and file bugs if needed.
Comment 5•24 years ago
|
||
We should fix this in a such a way that _if_ we added a 'TT' button to the
toolbar (like Bold, Italics), it would "just work", and reflect state. So neither
of the above approaches seem ideal.
Assignee | ||
Comment 6•24 years ago
|
||
We decided a long time ago that it was better UI to treat "TT" as a font and
not as a text style. But for "power users", availability of the old standard
Ctrl+T toggle keybinding for fixed width type seemed like a good idea.
Full support of this would involve duplicating the command code of other
text styles such as bold. I'm not sure if that's worth the effort, but if we
decide to do it it should be in 0.9.4.
I suggest using version '1' (using command nodes) as a fix for 0.9.4.
It seems easier to convert if we decide to add full support for TT as text
attribute.
Assignee | ||
Comment 7•24 years ago
|
||
Reporter | ||
Comment 8•24 years ago
|
||
I don't like that fix.
Assignee | ||
Comment 9•24 years ago
|
||
Assignee | ||
Comment 10•24 years ago
|
||
Note that with the 8/21/01 patch, a "cmd_tt" is implemented and the
"toggleFixedWidth()" method that already existed in editor.js is no longer
necessary, so I removed it.
Setting any text style via the menuitems doesn't work currently (has nothing to
do with this fix.) I'll find or file a bug on that issue.
Assignee | ||
Updated•24 years ago
|
Reporter | ||
Comment 11•24 years ago
|
||
r=brade
Whiteboard: FIX IN HAND need r=, sr= → FIX IN HAND need sr=
Comment 12•24 years ago
|
||
sr=sfraser
Assignee | ||
Comment 13•24 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 14•24 years ago
|
||
The 'Fixed width' menu item is permanently disabled for me, and some debug dumps
are showing 'No controller found for command cmd_tt'. This ain't right.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: FIX IN HAND, reviewed
Comment 15•24 years ago
|
||
it seems that you forgot to check in nsComposerController.cpp.
Assignee | ||
Comment 16•24 years ago
|
||
Oops! Missed checking in nsComposerController.cpp
Status: REOPENED → ASSIGNED
Whiteboard: FIX IN HAND
Comment 17•24 years ago
|
||
a=asa on behalf of drivers.
Assignee | ||
Comment 18•24 years ago
|
||
nsComposerController now checked in.
You need to log in
before you can comment on or make changes to this bug.
Description
•