Closed Bug 402839 Opened 17 years ago Closed 17 years ago

Modal dialogs should use Linux's native icons

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: ventnor.bugzilla, Assigned: ventnor.bugzilla)

References

Details

Attachments

(2 files, 1 obsolete file)

In our efforts to feel more native on every platform, we should use as many features that the OS provides. GNOME on Linux provides main icons for almost any type of modal dialog. We should probably use those since the ones we have now are a bit too shiny to fit in. Patch coming up.
Attached patch Patch part A (obsolete) — Splinter Review
This is the C++ patch. The libpr0n part fixes an awful macro where it converts 8-bit integers to 16-bit integers then converts the result back to an 8-bit integer. This MAY also fix the case where dialog-sized stock icons are occasionally borked. It seems to from here.

The nsPromptService part provides a new class to allow us to use GNOME's authentication icon on the WWW-authenticate dialogs.
Attachment #287670 - Flags: superreview?(cbiesinger)
Attachment #287670 - Flags: review?(cbiesinger)
Attached patch Patch part BSplinter Review
This is the toolkit CSS part to use the icons. It had to be separate because Core doesn't let me do additional review...
Attachment #287671 - Flags: review?(mano)
Comment on attachment 287670 [details] [diff] [review]
Patch part A

Since I had to look up the arithmetic rules in C++ for the nsIconDecoder change, as well as write a test program, I really would prefer that you don't make that change.

Anyway, why would that possibly fix anything? Your code is equivalent to the original.

r=biesi on the promptservice change
Comment on attachment 287670 [details] [diff] [review]
Patch part A

I meant, r+sr=biesi on the promptservice change.
Attachment #287670 - Flags: superreview?(cbiesinger)
Attachment #287670 - Flags: superreview+
Attachment #287670 - Flags: review?(cbiesinger)
Attachment #287670 - Flags: review+
(In reply to comment #3)
> (From update of attachment 287670 [details] [diff] [review])
> Since I had to look up the arithmetic rules in C++ for the nsIconDecoder
> change, as well as write a test program, I really would prefer that you don't
> make that change.
> 
> Anyway, why would that possibly fix anything? Your code is equivalent to the
> original.

Its inefficient. Converting 8-bit integers to 16-bit integers then back to 8-bit integers. I don't know if its the placebo effect, but ever since that change I haven't had a problem with dialog-sized stock icons. Before they would rarely, and at random, return a corrupt image. It doesn't seem to happen now.
Comment on attachment 287671 [details] [diff] [review]
Patch part B

Hrm, why do we specify width & height here?
(In reply to comment #6)
> (From update of attachment 287671 [details] [diff] [review])
> Hrm, why do we specify width & height here?
> 

We did that on winstripe too. Its just that GNOME's icons are slightly larger. We need to specify those because without them the image height flexes with the text of the dialog, and we can't have that.
(In reply to comment #5)
> Its inefficient. Converting 8-bit integers to 16-bit integers then back to
> 8-bit integers. I don't know if its the placebo effect, but ever since that
> change I haven't had a problem with dialog-sized stock icons. Before they would
> rarely, and at random, return a corrupt image. It doesn't seem to happen now.

The conversion to a wider integer is needed for correctness, and in any case, per C++'s arithmetic rules, all integers smaller than "int" get converted to int before doing the calculation.
(and since *out is an 8-bit integer, you also need the conversion back to that, whether explicitly or implicitly)
Attachment #287670 - Attachment is obsolete: true
Comment on attachment 287671 [details] [diff] [review]
Patch part B

r=mano
Attachment #287671 - Flags: review?(mano) → review+
Attachment #287671 - Flags: approval1.9?
Attachment #288781 - Flags: approval1.9?
Attachment #287671 - Flags: approval1.9? → approval1.9+
Attachment #288781 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Part A:
Checking in embedding/components/windowwatcher/src/nsPromptService.cpp;
/cvsroot/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp,v  <--  nsPromptService.cpp
new revision: 1.38; previous revision: 1.37
done

Part B:
Checking in toolkit/themes/gnomestripe/global/global.css;
/cvsroot/mozilla/toolkit/themes/gnomestripe/global/global.css,v  <--  global.css
new revision: 1.9; previous revision: 1.8
done
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M10
Depends on: 426689
Depends on: 463938
(In reply to comment #7)
> (In reply to comment #6)
> > (From update of attachment 287671 [details] [diff] [review] [details])
> > Hrm, why do we specify width & height here?
> We did that on winstripe too. Its just that GNOME's icons are slightly larger.

Is there a reason 40x40 was chosen for the width & height here?

This size causes really gross-looking icons, scaled down from 48x48 to 40x40, on Ubuntu 8.10, 8.04 and presumably many other Linux OSes.  (see bug 463938 comment 5)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: