GNOME Bugzilla – Bug 609777
fallback icons cause items in alt-tab to be the wrong size
Last modified: 2010-02-17 09:53:35 UTC
When an app doesn't have a high res icon it seems like we fall back to a small one. I'm guessing this is the window icon or something. Not much we can do about that but what we can do is ensure that the "box" that results from this in the alt-tab switcher stays the same size as the normal items. Right now it results in a smaller rectangular item instead of the normal sized square one.
Created attachment 153657 [details] screenshot
Created attachment 153755 [details] [review] [AppSwitcher] Make sure that fallback icons have correct box sizes This patch should fix that.
Comment on attachment 153755 [details] [review] [AppSwitcher] Make sure that fallback icons have correct box sizes SwitcherList has a "squareItems" flag, which is true for AppSwitcher and false for ThumbnailList, which is supposed to deal with this. It looks like the problem is that in AppSwitcher._allocate(), we allocate each child its preferred_height though, rather than allocating them all the height we used in our own _getPreferredHeight. (OTOH, if we were going to fix the problem the way you do in this patch, then all the "squareItems" stuff should go away. In fact, it's possible that SwitcherList could just be an St.BoxLayout in that case...)
(In reply to comment #3) > (From update of attachment 153755 [details] [review]) > SwitcherList has a "squareItems" flag, which is true for AppSwitcher and false > for ThumbnailList, which is supposed to deal with this. It looks like the > problem is that in AppSwitcher._allocate(), we allocate each child its > preferred_height though, rather than allocating them all the height we used in > our own _getPreferredHeight. OK > (OTOH, if we were going to fix the problem the way you do in this patch, then > all the "squareItems" stuff should go away. In fact, it's possible that > SwitcherList could just be an St.BoxLayout in that case...) Do we want that? That would make it easier to predict the width for the icon scaling issue. (https://bugzilla.gnome.org/show_bug.cgi?id=59803)
i don't remember why i didn't do it that way originally, which makes me worry that something is going to go wrong when you try, but it does seem like it would make more sense that way
(In reply to comment #5) > i don't remember why i didn't do it that way originally, which makes me worry > that something is going to go wrong when you try, but it does seem like it > would make more sense that way OK, I tried it the only problem that I run into is that I have no idea how to bypass the padding and add the arrows at the bottom of the switcher. Any ideas?
StBoxLayout will let you manually position some children. so if you include { x: 0, y: 0 } in the attributes when adding the arrows, that will cause them to not be laid out with the rest of the box, and then you can move them all around to the correct positions manually after the box is allocated, it should work.
Created attachment 153797 [details] [review] [AppSwitcher] Use St.BoxLayout for SwitcherList Here is a work in progress patch. OK, got the arrows to work there is still an issue with bunch of St-WARNING **: st_widget_get_theme_node called on a widget not in a stage messages, but I have no idea where they come from. Separators still don't have bottom padding.
(In reply to comment #7) > StBoxLayout will let you manually position some children. so if you include { > x: 0, y: 0 } in the attributes when adding the arrows, that will cause them to > not be laid out with the rest of the box, and then you can move them all around > to the correct positions manually after the box is allocated, it should work. OK, this might be easier than the hacks I used.
Created attachment 153842 [details] [review] [AppSwitcher] Make sure that fallback icons have correct box sizes Just fix the bug for now. Remove the squareItems flag too. Note: this results into the items not being actual squares, because the label isn't taken into account for the width of the icons. This is easy to fix though (one extra line), just not sure if we want that.
Created attachment 153843 [details] [review] [AppSwitcher] Make sure that fallback icons have correct box sizes Attach the correct patch, not the old one.
Created attachment 153958 [details] screenshot with patch applied With this patch the fallback item uses the same size selection box. However, it seems like the selection box is no longer square.
Created attachment 153961 [details] [review] Make sure that fallback icons have correct box sizes Make AppIcons square.
Comment on attachment 153961 [details] [review] Make sure that fallback icons have correct box sizes produces lots of (mutter:8007): St-WARNING **: st_widget_get_theme_node called on a widget not in a stage because in order to do get_height on the label, it has to know what font to use, etc OK, sorry, I guess we want to keep the squareItems flag after all. So basically, I guess your first patch was more-or-less right.
Comment on attachment 153755 [details] [review] [AppSwitcher] Make sure that fallback icons have correct box sizes pushed as 6aa02c5