mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 22:56:40 +00:00 
			
		
		
		
	Merge remote-tracking branch 'graffy76/master' into next
This commit is contained in:
		
						commit
						1fd7d8ed2a
					
				
					 2 changed files with 73 additions and 3 deletions
				
			
		|  | @ -35,7 +35,7 @@ void CSVDoc::Operation::updateLabel (int threads) | |||
| CSVDoc::Operation::Operation (int type) : mType (type), mStalling (false) | ||||
| { | ||||
|     /// \todo Add a cancel button or a pop up menu with a cancel item
 | ||||
| 
 | ||||
|     setBarColor( type); | ||||
|     updateLabel(); | ||||
| 
 | ||||
|     /// \todo assign different progress bar colours to allow the user to distinguish easily between operation types
 | ||||
|  | @ -51,4 +51,70 @@ void CSVDoc::Operation::setProgress (int current, int max, int threads) | |||
| int CSVDoc::Operation::getType() const | ||||
| { | ||||
|     return mType; | ||||
| } | ||||
| } | ||||
| 
 | ||||
| void CSVDoc::Operation::setBarColor (int type) | ||||
| { | ||||
|     QString style ="QProgressBar {" | ||||
|             "text-align: center;" | ||||
|             "}" | ||||
|           "QProgressBar::chunk {" | ||||
|             "background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 %1, stop:.50 %2 stop: .51 %3 stop:1 %4);" | ||||
|             "text-align: center;" | ||||
|             "margin: 2px 1px 1p 2px;" | ||||
|           "}"; | ||||
| 
 | ||||
|     // "QProgressBar::chunk {background-color: %1;}";
 | ||||
| 
 | ||||
|     QString topColor = "#F2F6F8"; | ||||
|     QString bottomColor = "#E0EFF9"; | ||||
|     QString midTopColor = "#D8E1E7"; | ||||
|     QString midBottomColor = "#B5C6D0";  // default gray gloss
 | ||||
| 
 | ||||
|     // colors inspired by samples from:
 | ||||
|     // http://www.colorzilla.com/gradient-editor/
 | ||||
| 
 | ||||
|     switch (type) | ||||
|     { | ||||
|     case CSMDoc::State_Saving: | ||||
| 
 | ||||
|         topColor = "#FECCB1"; | ||||
|         midTopColor = "#F17432"; | ||||
|         midBottomColor = "#EA5507"; | ||||
|         bottomColor = "#FB955E";  // red gloss #2
 | ||||
|         //break;
 | ||||
| 
 | ||||
|     case CSMDoc::State_Searching: | ||||
| 
 | ||||
|         topColor = "#EBF1F6"; | ||||
|         midTopColor = "#ABD3EE"; | ||||
|         midBottomColor = "#89C3EB"; | ||||
|         bottomColor = "#D5EBFB"; //blue gloss #4
 | ||||
|         //break;
 | ||||
| 
 | ||||
|     case CSMDoc::State_Verifying: | ||||
| 
 | ||||
|         topColor = "#BFD255"; | ||||
|         midTopColor = "#8EB92A"; | ||||
|         midBottomColor = "#72AA00"; | ||||
|         bottomColor = "#9ECB2D";  //green gloss
 | ||||
|         //break;
 | ||||
| 
 | ||||
|     case CSMDoc::State_Compiling: | ||||
| 
 | ||||
|         topColor = "#F3E2C7"; | ||||
|         midTopColor = "#C19E67"; | ||||
|         midBottomColor = "#B68D4C"; | ||||
|         bottomColor = "#E9D4B3";  //l Brown 3D
 | ||||
|         //break;
 | ||||
| 
 | ||||
|     default: | ||||
| 
 | ||||
|         topColor = "#F2F6F8"; | ||||
|         bottomColor = "#E0EFF9"; | ||||
|         midTopColor = "#D8E1E7"; | ||||
|         midBottomColor = "#B5C6D0";  // gray gloss for undefined ops
 | ||||
|     } | ||||
| 
 | ||||
|     setStyleSheet(style.arg(topColor).arg(midTopColor).arg(midBottomColor).arg(bottomColor)); | ||||
| } | ||||
|  |  | |||
|  | @ -25,7 +25,11 @@ namespace CSVDoc | |||
|             void setProgress (int current, int max, int threads); | ||||
| 
 | ||||
|             int getType() const; | ||||
| 
 | ||||
|         private: | ||||
| 
 | ||||
|             void setBarColor (int type); | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue