Closed
Bug 415810
Opened 17 years ago
Closed 17 years ago
Respect the user's settings of icons in menus
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9beta4
People
(Reporter: ventnor.bugzilla, Assigned: ventnor.bugzilla)
References
(Depends on 1 open bug)
Details
Attachments
(1 file, 5 obsolete files)
8.29 KB,
patch
|
enndeakin
:
review+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
Currently we display icons in menus no matter what. GTK does have a setting as to whether to display icons on menuitems or not, and we should honour that since "light" WM's like Fluxbox don't have icons in their menus.
Attachment #301558 -
Flags: superreview?(roc)
Attachment #301558 -
Flags: review?(roc)
How about getting this metric via gtk2drawing.c? Then we don't have to create any new widgets.
Assignee | ||
Comment 2•17 years ago
|
||
Assignee: nobody → ventnor.bugzilla
Attachment #301558 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #301764 -
Flags: superreview?(roc)
Attachment #301764 -
Flags: review?(roc)
Attachment #301558 -
Flags: superreview?(roc)
Attachment #301558 -
Flags: review?(roc)
Comment on attachment 301764 [details] [diff] [review]
Patch 2
+ aMetric = (moz_gtk_images_in_menus() ? 1 : 0);
Just return moz_gtk_images_in_menus() directly
Attachment #301764 -
Flags: superreview?(roc)
Attachment #301764 -
Flags: superreview+
Attachment #301764 -
Flags: review?(roc)
Attachment #301764 -
Flags: review+
Assignee | ||
Comment 4•17 years ago
|
||
This patch will allow further integration with the user's interface preferences without adding much risk at all.
Attachment #301764 -
Attachment is obsolete: true
Attachment #301769 -
Flags: approval1.9?
Updated•17 years ago
|
Version: unspecified → Trunk
Comment 5•17 years ago
|
||
Comment on attachment 301769 [details] [diff] [review]
Patch 3
a1.9+=damons
Attachment #301769 -
Flags: approval1.9? → approval1.9+
Updated•17 years ago
|
Keywords: checkin-needed
Comment 6•17 years ago
|
||
|visibility: hidden| means that all images will still be loaded and processed. Instead, we shouldn't even use the menuitem-iconic binding in that case.
Assignee | ||
Comment 7•17 years ago
|
||
Dao, I tried that but I think it still ended up using the iconic binding.
Either way, this method allows us to hide any and all icons on all menuitems and submenus, while still allowing proper margins.
Comment 8•17 years ago
|
||
(In reply to comment #7)
> Dao, I tried that but I think it still ended up using the iconic binding.
You think? :) Any chance to get that verified?
It's waste to load all icons for nothing.
> Either way, this method allows us to hide any and all icons on all menuitems
> and submenus, while still allowing proper margins.
The non-iconic binding should have proper margins, too. Otherwise that would be a bug.
Assignee | ||
Comment 9•17 years ago
|
||
I'll probably file a follow-up bug on that, but this method ensures no icons get displayed on any menuitem. I can't seem to find a way from within CSS to remove every use of the iconic binding, just the ones I had set in Gnomestripe.
Comment 10•17 years ago
|
||
menuitem {
-moz-binding: url(chrome://global/content/bindings/menu.xml#menuitem) !important;
}
menu.menu-iconic {
-moz-binding: url(chrome://global/content/bindings/menu.xml#menu) !important;
}
Comment 11•17 years ago
|
||
Also, if you put it in xul.css with the appropriate ifdef, it would work for non-default themes.
Comment 12•17 years ago
|
||
Should I not land this due to Dão's comments?
Assignee | ||
Comment 13•17 years ago
|
||
Land it now so users can get the benefit now, I'll file a followup bug for perf.
Comment 14•17 years ago
|
||
Sorry, but sayrer questions me on an almost daily basis about gtk/Linux perf issues, so if there's a known perf problem with this patch, I'd rather wait until there's a correct patch that fixes the problem and won't hurt perf. Don't want to be the bad guy here, but we don't need any more perf regressions.
Keywords: checkin-needed
Comment 15•17 years ago
|
||
(In reply to comment #13)
> Land it now so users can get the benefit now, I'll file a followup bug for
> perf.
>
No...
Assignee | ||
Comment 16•17 years ago
|
||
I dunno, this approach seems a little messy in xul.css, unless I misunderstood what everyone wanted...
Attachment #301769 -
Attachment is obsolete: true
Attachment #302385 -
Flags: superreview?(roc)
Attachment #302385 -
Flags: review?(roc)
Updated•17 years ago
|
Attachment #302385 -
Flags: review?(gavin.sharp)
Comment 17•17 years ago
|
||
(In reply to comment #14)
> Sorry, but sayrer questions me on an almost daily basis about gtk/Linux perf
> issues,
This isn't a performance regression so a followup bug would be fine here. In fact, the newest patch could be one (although very negligible), as it adds more complexity to xul.css
Updated•17 years ago
|
Keywords: checkin-needed
Comment 18•17 years ago
|
||
Comment on attachment 302385 [details] [diff] [review]
Patch 4
If you use something along the lines of comment 10 in xul.css (with more intelligent selectors, of course), you shouldn't need to patch gnomestripe at all, and no third-party theme would need to be updated.
Comment 19•17 years ago
|
||
e.g.:
> %ifdef MOZ_WIDGET_GTK2
> menuitem:not([type]):not(:-moz-system-metric(images-in-menus)) {
> -moz-binding: url(chrome://global/content/bindings/menu.xml#menuitem) !important;
> }
> menu.menu-iconic:not(:-moz-system-metric(images-in-menus)) {
> -moz-binding: url(chrome://global/content/bindings/menu.xml#menu) !important;
> }
> %endif
This is untested and not necessarily complete.
We should take patch 3. It's not going to hurt perf at all, in fact it will help perf a little bit for the small number of users it will affect. The performance "issue" is only that patch 3 might not help perf as much as it could ... but again, it's only going to affect a small minority of users so we shouldn't care much either way.
Comment 21•17 years ago
|
||
(In reply to comment #20)
> It's not going to hurt perf at all, in fact it will
> help perf a little bit for the small number of users it will affect.
The perf win, if existing, would be near to nothing compared to what could be won if you just don't load the icons, wouldn't it?
Also, I don't see why this should be fixed within gnomestripe. This is filed as a Core bug to start with. Should every single theme explicitly support this?
Assignee | ||
Comment 22•17 years ago
|
||
Actually, IIRC display:none doesn't load its content. I think I now know of a rule to use thos.
Assignee | ||
Comment 23•17 years ago
|
||
Hmm, turns out the images are also used for alignment due to their defined sizes, so that didn't work.
Assignee | ||
Comment 24•17 years ago
|
||
The backend stuff has already gotten review from roc and it hasn't changed, so I'll just ask gavin to review the xul.css stuff.
Attachment #302385 -
Attachment is obsolete: true
Attachment #302472 -
Flags: review?(gavin.sharp)
Attachment #302385 -
Flags: superreview?(roc)
Attachment #302385 -
Flags: review?(roc)
Attachment #302385 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 25•17 years ago
|
||
I think this is the approach gavin wanted.
Attachment #302472 -
Attachment is obsolete: true
Attachment #302697 -
Flags: review?(gavin.sharp)
Attachment #302472 -
Flags: review?(gavin.sharp)
Updated•17 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 26•17 years ago
|
||
Comment on attachment 302697 [details] [diff] [review]
Patch 6
Neil, can you take a look at this?
Attachment #302697 -
Flags: review?(gavin.sharp) → review?(enndeakin)
Updated•17 years ago
|
Attachment #302697 -
Flags: review?(enndeakin) → review+
Updated•17 years ago
|
Attachment #302697 -
Flags: approval1.9?
Comment 27•17 years ago
|
||
Comment on attachment 302697 [details] [diff] [review]
Patch 6
>Index: toolkit/content/xul.css
What if I want to write a theme that has no intention of ever following OS settings? (OK, so Modern uses the OS font setting, but nothing else.)
Assignee | ||
Comment 28•17 years ago
|
||
(In reply to comment #27)
> (From update of attachment 302697 [details] [diff] [review])
> >Index: toolkit/content/xul.css
> What if I want to write a theme that has no intention of ever following OS
> settings? (OK, so Modern uses the OS font setting, but nothing else.)
>
(In reply to comment #18)
> (From update of attachment 302385 [details] [diff] [review])
> If you use something along the lines of comment 10 in xul.css (with more
> intelligent selectors, of course), you shouldn't need to patch gnomestripe at
> all, and no third-party theme would need to be updated.
>
Something has to give...
Comment 29•17 years ago
|
||
(In reply to comment #27)
> (From update of attachment 302697 [details] [diff] [review])
> >Index: toolkit/content/xul.css
> What if I want to write a theme that has no intention of ever following OS
> settings?
You override these rules.
Respecting the user's settings should be the default, not the other way around.
Comment 30•17 years ago
|
||
Never mind me. Modern also respects OS scrollbar styles.
Comment 31•17 years ago
|
||
Sorry for spamming, but what about menulists, e.g. in the helper app prefs?
Updated•17 years ago
|
Attachment #302697 -
Flags: approval1.9? → approval1.9+
Updated•17 years ago
|
Keywords: checkin-needed
Comment 32•17 years ago
|
||
Checking in widget/src/gtk2/gtk2drawing.c;
/cvsroot/mozilla/widget/src/gtk2/gtk2drawing.c,v <-- gtk2drawing.c
new revision: 1.80; previous revision: 1.79
done
Checking in widget/src/gtk2/gtkdrawing.h;
/cvsroot/mozilla/widget/src/gtk2/gtkdrawing.h,v <-- gtkdrawing.h
new revision: 1.54; previous revision: 1.53
done
Checking in widget/src/gtk2/nsLookAndFeel.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsLookAndFeel.cpp,v <-- nsLookAndFeel.cpp
new revision: 1.37; previous revision: 1.36
done
Checking in widget/public/nsILookAndFeel.h;
/cvsroot/mozilla/widget/public/nsILookAndFeel.h,v <-- nsILookAndFeel.h
new revision: 1.63; previous revision: 1.62
done
Checking in layout/style/nsCSSRuleProcessor.cpp;
/cvsroot/mozilla/layout/style/nsCSSRuleProcessor.cpp,v <-- nsCSSRuleProcessor.cpp
new revision: 1.24; previous revision: 1.23
done
Checking in toolkit/content/xul.css;
/cvsroot/mozilla/toolkit/content/xul.css,v <-- xul.css
new revision: 1.115; previous revision: 1.114
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
You need to log in
before you can comment on or make changes to this bug.
Description
•