Skip to content

Commit

Permalink
Gtk UI: Resizable shownotes view in main window
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Mar 5, 2013
1 parent 1699e8c commit 7de1a3e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gpodder/config.py
Expand Up @@ -117,6 +117,7 @@
'x': -1, 'y': -1, 'maximized': False,

'paned_position': 200,
'episode_list_size': 200,
},
'episode_selector': {
'width': 600,
Expand Down Expand Up @@ -211,7 +212,6 @@
'auto_remove_unplayed_episodes': 'auto.cleanup.unplayed',
'max_episodes_per_feed': 'limit.episodes',
'show_toolbar': 'ui.gtk.toolbar',
'paned_position': 'ui.gtk.state.main_window.paned_position',
'episode_list_descriptions': 'ui.gtk.episode_list.descriptions',
'podcast_list_view_all': 'ui.gtk.podcast_list.all_episodes',
'podcast_list_sections': 'ui.gtk.podcast_list.sections',
Expand Down
20 changes: 18 additions & 2 deletions src/gpodder/gtkui/main.py
Expand Up @@ -128,7 +128,7 @@ def new(self):

self.config.connect_gtk_window(self.main_window, 'main_window')

self.config.connect_gtk_paned('paned_position', self.channelPaned)
self.config.connect_gtk_paned('ui.gtk.state.main_window.paned_position', self.channelPaned)

self.main_window.show()

Expand All @@ -142,7 +142,23 @@ def new(self):
self.sw_shownotes = gtk.ScrolledWindow()
self.sw_shownotes.set_shadow_type(gtk.SHADOW_IN)
self.sw_shownotes.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.vbox_episode_list.add(self.sw_shownotes)

# Vertical paned for the episode list and shownotes
self.vpaned = gtk.VPaned()
paned = self.vbox_episode_list.get_parent()
self.vbox_episode_list.reparent(self.vpaned)
self.vpaned.child_set_property(self.vbox_episode_list, 'resize', True)
self.vpaned.child_set_property(self.vbox_episode_list, 'shrink', False)
self.vpaned.pack2(self.sw_shownotes, resize=False, shrink=False)
self.vpaned.show()

# Minimum height for both episode list and shownotes
self.vbox_episode_list.set_size_request(-1, 100)
self.sw_shownotes.set_size_request(-1, 100)

self.config.connect_gtk_paned('ui.gtk.state.main_window.episode_list_size',
self.vpaned)
paned.add2(self.vpaned)

if self.config.enable_html_shownotes and shownotes.have_webkit:
self.shownotes_object = shownotes.gPodderShownotesHTML(self.sw_shownotes)
Expand Down

0 comments on commit 7de1a3e

Please sign in to comment.