Merge lp:~samuel-buffet/entertainer/clutter-0-8 into lp:entertainer

Proposed by Samuel Buffet
Status: Merged
Merged at revision: not available
Proposed branch: lp:~samuel-buffet/entertainer/clutter-0-8
Merge into: lp:entertainer
To merge this branch: bzr merge lp:~samuel-buffet/entertainer/clutter-0-8
Reviewer Review Type Date Requested Status
Matt Layman Approve
Joshua Scotton Approve
Review via email: mp+1710@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Samuel Buffet (samuel-buffet) wrote :

The idea of this proposal is to have a trunk compatible with Clutter 0.8.

With this branch, Entertainer *is working*, the API changes which had spectacular effects are fixed.

Now there's probably a lot of polishing to do but I think that can be done in common step by step.

Revision history for this message
Samuel Buffet (samuel-buffet) wrote :
Download full text (179.0 KiB)

The diff.

=== modified file 'entertainerlib/frontend/gui/screens/artist_screen.py'
--- entertainerlib/frontend/gui/screens/artist_screen.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/screens/artist_screen.py 2008-11-13 21:50:07 +0000
@@ -69,7 +69,6 @@

         # Activate albums tab when screen is opened
         self.current_tab = "albums"
- self.albums_tab.show()

         self.show()

@@ -99,6 +98,7 @@
         Create a list of tracks
         """
         self.tracks_tab = clutter.Group()
+ self.tracks_tab.hide()
         self.tracks_menu = TextMenu(self.theme, self.config.show_effects())
         self.tracks_menu.set_item_size(self.ui.x(0.2928), self.ui.y(0.0781))
         cursor = clutter.Rectangle()

=== modified file 'entertainerlib/frontend/gui/screens/audio_play_screen.py'
--- entertainerlib/frontend/gui/screens/audio_play_screen.py 2008-11-04 00:16:49 +0000
+++ entertainerlib/frontend/gui/screens/audio_play_screen.py 2008-11-13 22:01:15 +0000
@@ -182,6 +182,7 @@
             lyrics_tab.add(throbber)
             self.track.fetch_lyrics(self._lyrics_search_callback)

+ lyrics_tab.hide_tab()
         return lyrics_tab

     def _lyrics_search_callback(self, lyrics_text):
@@ -212,6 +213,8 @@
         Create a tab that displays tracks on current playlist.
         """
         playlist_tab = Tab(self.ui, _("Current playlist"))
+
+ playlist_tab.hide_tab()
         return playlist_tab

     def update(self, track):

=== modified file 'entertainerlib/frontend/gui/screens/music_screen.py'
--- entertainerlib/frontend/gui/screens/music_screen.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/screens/music_screen.py 2008-11-13 21:07:03 +0000
@@ -298,6 +298,7 @@
             "album_tracks")
         albums_tab.add(album_tracks)

+ albums_tab.hide_tab()
         return albums_tab

     def _create_playlists_tab(self):
@@ -335,6 +336,7 @@

             playlists_tab.add(self.playlist_menu)

+ playlists_tab.hide_tab()
         return playlists_tab

     def _update_album_info(self, album):

=== modified file 'entertainerlib/frontend/gui/screens/screen.py'
--- entertainerlib/frontend/gui/screens/screen.py 2008-10-07 22:59:41 +0000
+++ entertainerlib/frontend/gui/screens/screen.py 2008-10-26 20:39:25 +0000
@@ -33,6 +33,7 @@
         rect.set_size(
             self.config.get_stage_width(),
             self.config.get_stage_height())
+ rect.hide()
         self.add(rect)

     def update(self):

=== modified file 'entertainerlib/frontend/gui/tabs/series_tab.py'
--- entertainerlib/frontend/gui/tabs/series_tab.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/tabs/series_tab.py 2008-11-13 21:12:10 +0000
@@ -45,6 +45,8 @@
         else:
             self._create_series_menu()

+ self.hide_tab()
+
     def can_activate(self):
         """
         Allow if we have some TV-series indexed.

=== modified file 'entertainerlib/frontend/gui/tabs/video_clips_tab.py'
--- entertainerlib/frontend/gui/tabs/video_clips_tab.py 2008-11-05 17:38:30 +0000
+++ entertainerlib/frontend/gui/tabs/video_clips_tab.py 2008-11-13 21:15:17 +0000
@@ -45,6 +45,8 @@
        ...

Revision history for this message
Matt Layman (mblayman) wrote :

Samuel, just a couple of comments:

`make check` fails because of a call to pygst.require. I think it's okay to get rid of the require command since that is something that we can be sure to enforce through a package dependency.

Would it be possible to make MenuOverlay be a subclass of our Texture widget instead of clutter.Texture? I'd like to minimize how much we directly call clutter when we've created special widgets (like Texture) just for the purpose of wrapping up the clutter equivalent. I recognize that most of the advantage of creating a Texture widget is now largely defeated since the new clutter Texture can take a filename, but there is still some positioning logic in the Texture widget that will help us in the future.

In the media_player.py file, where import order is important, can you add a comment indicating that the order is important (because it defies our normal convention of list imports in alphabetical order)?

Otherwise, aside from visible regressions that obviously aren't your fault, I think that this is a good start so that we can be productive again.

review: Needs Fixing
310. By Samuel Buffet

pygst.require is removed as it breaks *make check*
We will handle that through package dependency

311. By Samuel Buffet

a comment is added to warn about Clutter's import directives order wich is now important

312. By Samuel Buffet

MenuOverlay inherits from Texture widget now

313. By Samuel Buffet

an encoding is setup to this file because of special characters present in the previously added comment from pyclutter 0.8 README

314. By Samuel Buffet

small updates to make pylint happy

Revision history for this message
Samuel Buffet (samuel-buffet) wrote :
Download full text (180.3 KiB)

that's fixed Matt.

Here is the new diff :

=== modified file 'entertainerlib/frontend/gui/screens/artist_screen.py'
--- entertainerlib/frontend/gui/screens/artist_screen.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/screens/artist_screen.py 2008-11-13 21:50:07 +0000
@@ -69,7 +69,6 @@

         # Activate albums tab when screen is opened
         self.current_tab = "albums"
- self.albums_tab.show()

         self.show()

@@ -99,6 +98,7 @@
         Create a list of tracks
         """
         self.tracks_tab = clutter.Group()
+ self.tracks_tab.hide()
         self.tracks_menu = TextMenu(self.theme, self.config.show_effects())
         self.tracks_menu.set_item_size(self.ui.x(0.2928), self.ui.y(0.0781))
         cursor = clutter.Rectangle()

=== modified file 'entertainerlib/frontend/gui/screens/audio_play_screen.py'
--- entertainerlib/frontend/gui/screens/audio_play_screen.py 2008-11-04 00:16:49 +0000
+++ entertainerlib/frontend/gui/screens/audio_play_screen.py 2008-11-13 22:01:15 +0000
@@ -182,6 +182,7 @@
             lyrics_tab.add(throbber)
             self.track.fetch_lyrics(self._lyrics_search_callback)

+ lyrics_tab.hide_tab()
         return lyrics_tab

     def _lyrics_search_callback(self, lyrics_text):
@@ -212,6 +213,8 @@
         Create a tab that displays tracks on current playlist.
         """
         playlist_tab = Tab(self.ui, _("Current playlist"))
+
+ playlist_tab.hide_tab()
         return playlist_tab

     def update(self, track):

=== modified file 'entertainerlib/frontend/gui/screens/music_screen.py'
--- entertainerlib/frontend/gui/screens/music_screen.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/screens/music_screen.py 2008-11-13 21:07:03 +0000
@@ -298,6 +298,7 @@
             "album_tracks")
         albums_tab.add(album_tracks)

+ albums_tab.hide_tab()
         return albums_tab

     def _create_playlists_tab(self):
@@ -335,6 +336,7 @@

             playlists_tab.add(self.playlist_menu)

+ playlists_tab.hide_tab()
         return playlists_tab

     def _update_album_info(self, album):

=== modified file 'entertainerlib/frontend/gui/screens/screen.py'
--- entertainerlib/frontend/gui/screens/screen.py 2008-10-07 22:59:41 +0000
+++ entertainerlib/frontend/gui/screens/screen.py 2008-10-26 20:39:25 +0000
@@ -33,6 +33,7 @@
         rect.set_size(
             self.config.get_stage_width(),
             self.config.get_stage_height())
+ rect.hide()
         self.add(rect)

     def update(self):

=== modified file 'entertainerlib/frontend/gui/tabs/series_tab.py'
--- entertainerlib/frontend/gui/tabs/series_tab.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/tabs/series_tab.py 2008-11-13 21:12:10 +0000
@@ -45,6 +45,8 @@
         else:
             self._create_series_menu()

+ self.hide_tab()
+
     def can_activate(self):
         """
         Allow if we have some TV-series indexed.

=== modified file 'entertainerlib/frontend/gui/tabs/video_clips_tab.py'
--- entertainerlib/frontend/gui/tabs/video_clips_tab.py 2008-11-05 17:38:30 +0000
+++ entertainerlib/frontend/gui/tabs/video_clips_tab.py 2008-11-13 21:15:17...

315. By Samuel Buffet

remove the border width on the rectangle used as cursor on image_menu widgets as it was not wisible previously with clutter 0.6

316. By Samuel Buffet

delete a .show() in image_menu_item.py because Actors are now shown on creation

317. By Samuel Buffet

the texture is now correctly sized on ImageMenuItem created in video_clips_tab.py

318. By Samuel Buffet

delete a menu_overlay.show() in user_interface.py because Actors are now shown on creation

319. By Samuel Buffet

delete clips_menu.show() in video_clips_tab.py because Actors are now shown on creation

320. By Samuel Buffet

delete some .show() in photographs_screen.py because Actors are now shown on creation

321. By Samuel Buffet

delete some .show() in question_dialog.py because Actors are now shown on creation

322. By Samuel Buffet

delete some .show() in feed_screen.py because Actors are now shown on creation

323. By Samuel Buffet

delete some .show() in rss_screen.py because Actors are now shown on creation

324. By Samuel Buffet

delete some .show() in artist_screen.py because Actors are now shown on creation

325. By Samuel Buffet

delete some .show() in main_screen.py because Actors are now shown on creation

326. By Samuel Buffet

delete some .show() in video_screen.py because Actors are now shown on creation

327. By Samuel Buffet

delete some .show() in album_screen.py because Actors are now shown on creation

328. By Samuel Buffet

delete some self.show() in weather_screen.py because Actors are now shown on creation

329. By Samuel Buffet

delete some .show() in disc_screen.py because Actors are now shown on creation

330. By Samuel Buffet

delete self.show() in feed_entry_screen.py because Actors are now shown on creation

331. By Samuel Buffet

delete some .show() in audio_play_screen.py because Actors are now shown on creation

332. By Samuel Buffet

delete some .show() in photo_screen.py because Actors are now shown on creation

333. By Samuel Buffet

delete some .show() in music_screen.py because Actors are now shown on creation

334. By Samuel Buffet

delete some .show() in movie_screen.py because Actors are now shown on creation

335. By Samuel Buffet

delete some .show() in tv_serie_screen.py because Actors are now shown on creation

336. By Samuel Buffet

delete some .show() in tv_serie_episodes_screen.py because Actors are now shown on creation

337. By Samuel Buffet

delete some .show() in photoalbums_screen.py because Actors are now shown on creation

338. By Samuel Buffet

delete some .show() in question_screen.py because Actors are now shown on creation

339. By Samuel Buffet

delete some .show() in grid_menu.py because Actors are now shown on creation

340. By Samuel Buffet

delete actor.show() in scroll_menu.py because Actors are now shown on creation

341. By Samuel Buffet

delete some .show() in list_indicator.py because Actors are now shown on creation

342. By Samuel Buffet

delete some .show() in eyecandy_texture.py because Actors are now shown on creation

343. By Samuel Buffet

delete self.show() in scroll_area.py because Actors are now shown on creation

344. By Samuel Buffet

delete rect.show() in tab_group.py because Actors are now shown on creation

345. By Samuel Buffet

delete some .show() in progress_bar.py because Actors are now shown on creation

346. By Samuel Buffet

delete self.show() in texture.py because Actors are now shown on creation

347. By Samuel Buffet

delete self.show() in label.py because Actors are now shown on creation

348. By Samuel Buffet

delete some .show() in menu.py because Actors are now shown on creation

Revision history for this message
Samuel Buffet (samuel-buffet) wrote :
Download full text (209.1 KiB)

Matt,

I've fixe some other things + removed a lot of useless .show on Actors so here is the new diff :

Entertainer looks quite nice now except the Pango issues you've seen yesterday.

=== modified file 'entertainerlib/frontend/gui/screens/album_screen.py'
--- entertainerlib/frontend/gui/screens/album_screen.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/screens/album_screen.py 2008-11-17 20:55:55 +0000
@@ -56,13 +56,10 @@
         self.li.set_position(self.ui.STAGE_WIDTH - self.li.get_width() - \
             self.ui.x(0.066), self.ui.STAGE_HEIGHT - self.ui.y(0.11))
         self.li.set_delimiter(" | ")
- self.li.show()
         self.li.set_maximum(self.track_menu.get_number_of_items())
         self.li.set_current(1)
         self.add(self.li)

- self.show()
-
     def _create_album_cover_texture(self):
         """
         Create a texture that is displayed next to track list. This texture
@@ -76,7 +73,6 @@
                 self.theme.getImage("default_album_art"))
         self.art = EyeCandyTexture(pixbuf, self.ui.x(0.3148), self.ui.y(0.5599))
         self.art.set_position(self.ui.x(0.1), self.ui.y(0.13))
- self.art.show()
         self.art.set_rotation(clutter.Y_AXIS, 25, 0, 0, 0)
         self.add(self.art)

@@ -101,7 +97,6 @@
             num_of_tracks_text, font_weight="bold")
         self.add(num_of_tracks)

-
     def _create_track_menu(self):
         """
         Create track menu. This menu contains list of all tracks on album.
@@ -121,7 +116,6 @@
             item.set_userdata(track)
             self.track_menu.add_actor(item)

- self.track_menu.show()
         self.track_menu.set_active(True)
         self.add(self.track_menu)

=== modified file 'entertainerlib/frontend/gui/screens/artist_screen.py'
--- entertainerlib/frontend/gui/screens/artist_screen.py 2008-10-13 20:18:52 +0000
+++ entertainerlib/frontend/gui/screens/artist_screen.py 2008-11-17 20:45:36 +0000
@@ -69,9 +69,6 @@

         # Activate albums tab when screen is opened
         self.current_tab = "albums"
- self.albums_tab.show()
-
- self.show()

     def _create_tabs(self):
         """
@@ -91,7 +88,7 @@

         self.tabs.set_position(self.ui.x(0.2804), self.ui.y(0.05208))
         self.tabs.set_active(True)
- self.tabs.show()
+
         self.add(self.tabs)

     def _create_tracks_tab(self):
@@ -99,6 +96,7 @@
         Create a list of tracks
         """
         self.tracks_tab = clutter.Group()
+ self.tracks_tab.hide()
         self.tracks_menu = TextMenu(self.theme, self.config.show_effects())
         self.tracks_menu.set_item_size(self.ui.x(0.2928), self.ui.y(0.0781))
         cursor = clutter.Rectangle()
@@ -117,7 +115,6 @@

         self.tracks_menu.set_position(self.ui.x(0.0586), self.ui.y(0.2083))
         self.tracks_menu.set_active(False)
- self.tracks_menu.show()

         if self.config.show_effects():
             self.tracks_menu.set_animate(True)
@@ -144,7 +141,6 @@
         self.track_li.set_delimiter(" | ")
         self.track_li.set_maximum(self.tracks_menu.get_number_of_items())
         self.track_li.set_current(1)
- self.track_li.show()
 ...

Revision history for this message
Joshua Scotton (joshuascotton) wrote :

Although this code does not fix all the problems that using 0.8 brought us, it is an essential step on the way.
I can't find anything wrong with it at present and I think when laymanterms is ok with it we can merge into trunk
Screen showed up and buttons appeared, we can build on this to get entertainer looking better than ever! :D

review: Approve
Revision history for this message
Matt Layman (mblayman) wrote :

Samuel, nice addition of getting rid of all the extra show calls. :)

Some comments:

photoalbums_screen.py: Please remove extra rect altogether. It's clearly not doing anything since it's never added to the group, and since Lauri is probably the only person who might remember why it was there initially, I think we can safely remove it.

video_clips_tab.py: Please revert the change. The method x() and y() in the ui object will go away eventually. I calculated the ratio for the images based on the dimensions that Lauri had initially written (based on percentages of height and width from his original static screen size). If you want to add a comment about what the ratio is (9/16), feel free, but I don't think that we should be calculating it from the object that I'm trying to eventually remove from the screens. Remember that ui.x(.25) and ui.y(.233) will have very different results for monitors of different aspect ratios, but 9/16 will always be 9/16. :)

image_menu.py: Why did you remove?:
        c.set_border_width(5)
        c.set_border_color((255, 255, 255, 255))

media_player.py: Please change to a simple one line comment (and be sure to remove the encoding line at the top of the file). If you want a simple English sentence, I would recommend the following:
# import order is important here, see the pyclutter README for details

`make check` fails with a couple of test failures in Texture_test. I looked at both of the failing tests. Since they have to do with checking pixbufs, I think you can delete both of the tests (testGoodPixbuf and testBadPixbuf). Deleting those tests will also create an unused import of Pixbuf. Please remember to run `make check`, it's really helpful, I promise.

I'm assuming your glade changes are correct.

Thanks for your effort.

review: Needs Fixing
349. By Samuel Buffet

forgotten int Types added

350. By Samuel Buffet

useless rect removed in photoalbums_screen.py

351. By Samuel Buffet

removed the dynamic w/h ratio for ImageMenuItem in video_clips_tab.py

352. By Samuel Buffet

the import order warning message has bee, shorten in media_player.py

353. By Samuel Buffet

testGoodPixbuf & testBadPixbuf removed from Texture_test.py

Revision history for this message
Samuel Buffet (samuel-buffet) wrote :

Matt,

>photoalbums_screen.py: Please remove extra rect altogether. It's clearly not doing anything since it's never added to >the group, and since Lauri is probably the only person who might remember why it was there initially, I think we can >safely remove it.
removed

>video_clips_tab.py: Please revert the change. The method x() and y() in the ui object will go away eventually. I calculated >the ratio for the images based on the dimensions that Lauri had initially written (based on percentages of height and >width from his original static screen size). If you want to add a comment about what the ratio is (9/16), feel free, but I >don't think that we should be calculating it from the object that I'm trying to eventually remove from the screens. >Remember that ui.x(.25) and ui.y(.233) will have very different results for monitors of different aspect ratios, but 9/16 >will always be 9/16. :)
reverted to be quick, but I don't really understant why we must have an hardcoded ratio ?
Forcing the w/h ratio to 9/16 when we create the rounded cairo textures of ImageMenuItems make the textures not to fill the complete ImageMenu Cells. Do you have other informations on where does that 9/16 comes from.

>image_menu.py: Why did you remove?:
> c.set_border_width(5)
> c.set_border_color((255, 255, 255, 255))
because it creates a borde rwith of 5 pix on the cursor. Yeah, that's clearly the goal of the code but that border was not there with 0.6 and I am still wondering why ? I'll revert that if everyone want that to be back but that was a *visual* regression.

>media_player.py: Please change to a simple one line comment (and be sure to remove the encoding line at the top of >the file). If you want a simple English sentence, I would recommend the following:
># import order is important here, see the pyclutter README for details
changed to your shorter version

>`make check` fails with a couple of test failures in Texture_test. I looked at both of the failing tests. Since they have to >do with checking pixbufs, I think you can delete both of the tests (testGoodPixbuf and testBadPixbuf). Deleting those >tests will also create an unused import of Pixbuf. Please remember to run `make check`, it's really helpful, I promise.
removed. I run *make check* Matt. But when doing make check I always have a bunch of errors always take a look to what's related to my modifications. I guess I'll need to take a closer look to that as it seems you don't have those errors.

Samuel,

Revision history for this message
Matt Layman (mblayman) wrote :
Download full text (5.4 KiB)

Samuel,

>photoalbums_screen.py: Please remove extra rect altogether. It's clearly not doing anything since it's never added to >the group, and since Lauri is probably the only person who might remember why it was there initially, I think we can >safely remove it.
removed

Thanks.

>video_clips_tab.py: Please revert the change. The method x() and y() in the ui object will go away eventually. I calculated >the ratio for the images based on the dimensions that Lauri had initially written (based on percentages of height and >width from his original static screen size). If you want to add a comment about what the ratio is (9/16), feel free, but I >don't think that we should be calculating it from the object that I'm trying to eventually remove from the screens. >Remember that ui.x(.25) and ui.y(.233) will have very different results for monitors of different aspect ratios, but 9/16 >will always be 9/16. :)
reverted to be quick, but I don't really understant why we must have an hardcoded ratio ?

I believe that we have a hardcoded ratio in this case because the images that are downloaded conform to that ratio.

If you're asking for the more general reason of why we use ratios of ImageMenuItems, then here is the answer. ImageMenuItems used to take two parameters, an x value and a y value. These two parameters were calculated using ui.x() and ui.y(). The x() and y() methods generate absolute values by doing a calculation like "result = screen_width * percent" for x(percent) and "result = screen_height * percent" for y(percent). The problem with this method is that monitors of different aspect ratios will produce wildly different results.

Let's pick a very contrived example. Assume you're working on a square monitor of 1000 x 1000. To make a square ImageMenuItem, all you would need in the old method is something like "ImageMenuItem(ui.x(.5), ui.y(.5))". However, a different user might be on a display with a different aspect ratio, let's choose 2000 x 1000. Now the same code that is above will not produce a square, but will instead produce a rectangle. With the new syntax, we can just say ImageMenuItem(.5, 1) and it will produce a square for either monitor because y is calculated relative to x. This is the reason that I chose to use hardcoded ratios. Hopefully, this is a satisfactory answer for what you were asking.

>Forcing the w/h ratio to 9/16 when we create the rounded cairo textures of ImageMenuItems make the textures not to fill the complete ImageMenu Cells.

If this is true, it is a bug that should be fixed with the ImageMenu cells. I really need to find some movie material because I'm not able to see what you're testing.

Do you have other informations on where does that 9/16 comes from.

9/16 comes from a reverse engineering of the code that Lauri orginally wrote. Lauri originally used a screen resolution of 1366 x 768. This value pair was hardcoded into the UI object and all sizes (calls to ui.x() and ui.y()) in the interface were percentages based on the pair. When I came to the image menu item code, I calculated the absolute sizes of the images that he intended to get the width and height. I then divided the two values to get the ratio. ...

Read more...

review: Approve
Revision history for this message
Samuel Buffet (samuel-buffet) wrote :

>I believe that we have a hardcoded ratio in this case because the images that are downloaded conform to that ratio.

>If you're asking for the more general reason of why we use ratios of ImageMenuItems, then here is the answer.
>ImageMenuItems used to take two parameters, an x value and a y value. These two parameters were calculated using
>ui.x() and ui.y(). The x() and y() methods generate absolute values by doing a calculation like "result = screen_width *
>percent" for x(percent) and "result = screen_height * percent" for y(percent). The problem with this method is that
>monitors of different aspect ratios will produce wildly different results.

>Let's pick a very contrived example. Assume you're working on a square monitor of 1000 x 1000. To make a square
>ImageMenuItem, all you would need in the old method is something like "ImageMenuItem(ui.x(.5), ui.y(.5))". However, a
>different user might be on a display with a different aspect ratio, let's choose 2000 x 1000. Now the same code that is
>above will not produce a square, but will instead produce a rectangle. With the new syntax, we can just say
>ImageMenuItem(.5, 1) and it will produce a square for either monitor because y is calculated relative to x. This is the
>reason that I chose to use hardcoded ratios. Hopefully, this is a satisfactory answer for what you were asking.

>>Forcing the w/h ratio to 9/16 when we create the rounded cairo textures of ImageMenuItems make the textures not to
>fill the complete ImageMenu Cells.

>If this is true, it is a bug that should be fixed with the ImageMenu cells. I really need to find some movie material
>because I'm not able to see what you're testing.

>Do you have other informations on where does that 9/16 comes from.

>9/16 comes from a reverse engineering of the code that Lauri orginally wrote. Lauri originally used a screen resolution
>of 1366 x 768. This value pair was hardcoded into the UI object and all sizes (calls to ui.x() and ui.y()) in the interface
>were percentages based on the pair. When I came to the image menu item code, I calculated the absolute sizes of the
>images that he intended to get the width and height. I then divided the two values to get the ratio. I can only assume
>that he either a) choose the ratio because it looked nice or b) the ratio was dictated by the dimensions of the images
>we download from imdb.

Hmm, that make sens. So a correct fix could be to use the same logic with the set_item_size() function of the GridMenu Class so that GridMenu Cells and ImageMenuItems will have the same size.

Revision history for this message
Matt Layman (mblayman) wrote :

That's probably correct. The GridMenu class might be the biggest damn mess in the whole project. All 723 lines of that file are in need of some serious lovin' and test cases. If I had been a really good developer, I probably would have started with GridMenu with my widget refactoring, but I wasn't ready to commit to that effort at the time. It will be a very good day when we clean up that file completely.

Subscribers

People subscribed via source and target branches