fossfreedom / coverart-browser

Browse your cover-art albums in Rhythmbox v2.96 - 3.0+
http://xpressubuntu.wordpress.com/
GNU General Public License v3.0
74 stars 19 forks source link

View options list is shrinked when positioned bottom left #111

Closed jrbastien closed 11 years ago

jrbastien commented 11 years ago

This one is weird. If you position the toolbar to the bottom left, by default, it shows the library view. Clicking on it once, will display the list of options skrinked to only scrolling arrows. If you click a second time, the list expands by a row. Clicking a third time will expand it by a another row. You can do this until you get a full list.

The genre and sort options list does not have this problem.

Unfortunately, Ubuntu does not allow me to take a screenshot when the list is displayed.

asermax commented 11 years ago

Lol, it happens to me too. Anyway, I don't think we can fix that, it seems like a GTK issue.

jrbastien commented 11 years ago

But what is different with this context menu vs the others?

fossfreedom commented 11 years ago

its no different from the others - just GTK.

I've found this article describing the placement of the menu.

Maybe with a bit of calculation - if the toolbar is near the bottom of the screen - try forcing the position of the popup to be above rather than below.

I'll see later if this is the issue.

EDIT:

alternatively - look to see if we can force the toolbar to be at the top of the left/right hand pane instead of the bottom

on_toolbar_pos
self.shell.add_widget(self.sidebar,
                        RB.ShellUILocation.SIDEBAR,
                        expand=False,
                        fill=False)
jrbastien commented 11 years ago

Or just move the buttons up the search box. That might fix the problem.

fossfreedom commented 11 years ago

@asermax

well the following is a hack - it sort of works - but its a rubbish workaround IMHO - thoughts?

basically - if the popup is trying to open near the bottom of the screen, place the popup a bit further up so that the menu opens fully.

.... in PopupButton
def show_popup(self):
        '''
        show the current popup menu
        '''
        def pos(menu, icon):
            (a, x, y)=self.get_window().get_origin()
            x += self.get_allocation().x
            y += self.get_allocation().y - (self.get_allocation().height)

            from gi.repository import Gdk
            s = Gdk.Screen.get_default()

            if y > (s.get_height() - 180):
                y = s.get_height() - 180
            return (x,y,False)
        self._popup_menu.popup(None, None, pos, None, 0,
            Gtk.get_current_event_time())
asermax commented 11 years ago

If there's no other way, I think that patch would be ok for now. We can look at it more carefully when we remodel the toolbar.

jrbastien commented 11 years ago

I don't know if you are waiting for my feedback to close this or want to implement a cleaner solution but it is now working very well in the spritesheet branch I'm testing.

fossfreedom commented 11 years ago

@jrbastien - thats the feedback I needed. Cheers.

I'm going to close this - everything should now (hopefully) be merged in the master branch.