Jump to content
Sign in to follow this  
Yalabi

Python - Barre de Chargement

Recommended Posts

 

Niveau requis Débutant

Temps estimé : Entre 5 et 10 minutes

 

Bonjour, je vous partage une petite modification plutôt esthétique qu'utile mais sans prétention ça change beaucoup.

 

Pré-requis

 

Introduction

 

Avant

Citation

191251gifchargementbad.gif

 

Apres

Citation

191319gifchargement.gif

 

Tutoriel

 

Citation

introloading.py :

# 1. Chercher :

			self.loadingGage.SetPercentage(2+98*p/100, 100)
			
# 2. Remplacer par :

			self.loadingGage.SetPercentage(p, 160)
		
# 3. Chercher :

		self.__SetProgress(0)
		
# 4. Ajouter juste au dessus :

		tmpLoadStepList = tuple(zip(*self.loadStepList))[0]
		for progress in range(tmpLoadStepList[0], tmpLoadStepList[-1] + 1):
			if progress not in tmpLoadStepList:
				self.loadStepList.append((progress, lambda: None))
		self.loadStepList.sort()

 

 

Je précise que cette modification serra effective sur n'importe quelle barre de chargement, même si vous la modifiez.

 

Src : M2Dev

 

Edited by Yalabi (see edit history)
  • Like 3

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.