Play button changes according to its function
This commit is contained in:
		| @@ -96,8 +96,10 @@ class Controller(object): | |||||||
|  |  | ||||||
| 	def on_play_pause(self, *args, **kwargs): | 	def on_play_pause(self, *args, **kwargs): | ||||||
| 		if player.player.player.is_playing() == 1: | 		if player.player.player.is_playing() == 1: | ||||||
|  | 			self.window.play.SetLabel(_("Play")) | ||||||
| 			return player.player.pause() | 			return player.player.pause() | ||||||
| 		else: | 		else: | ||||||
|  | 			self.window.play.SetLabel(_("Pause")) | ||||||
| 			return player.player.player.play() | 			return player.player.player.play() | ||||||
|  |  | ||||||
| 	def on_next(self, *args, **kwargs): | 	def on_next(self, *args, **kwargs): | ||||||
| @@ -109,10 +111,12 @@ class Controller(object): | |||||||
| 	def on_play(self, *args, **kwargs): | 	def on_play(self, *args, **kwargs): | ||||||
| 		items = self.results[::] | 		items = self.results[::] | ||||||
| 		playing_item = self.window.get_item() | 		playing_item = self.window.get_item() | ||||||
|  | 		self.window.play.SetLabel(_("Pause")) | ||||||
| 		return utils.call_threaded(player.player.play_all, items, playing=playing_item, shuffle=self.window.player_shuffle.IsChecked()) | 		return utils.call_threaded(player.player.play_all, items, playing=playing_item, shuffle=self.window.player_shuffle.IsChecked()) | ||||||
|  |  | ||||||
| 	def on_stop(self, *args, **kwargs): | 	def on_stop(self, *args, **kwargs): | ||||||
| 		player.player.stop() | 		player.player.stop() | ||||||
|  | 		self.window.play.SetLabel(_("Play")) | ||||||
|  |  | ||||||
| 	def on_volume_down(self, *args, **kwargs): | 	def on_volume_down(self, *args, **kwargs): | ||||||
| 		self.window.vol_slider.SetValue(self.window.vol_slider.GetValue()-5) | 		self.window.vol_slider.SetValue(self.window.vol_slider.GetValue()-5) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user