mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +00:00 
			
		
		
		
	hide script error list when there are no errors (Fixes #2867)
(cherry picked from commit 1093a53cf9)
			
			
This commit is contained in:
		
							parent
							
								
									0366a05649
								
							
						
					
					
						commit
						2c5f0bf6c5
					
				
					 2 changed files with 21 additions and 0 deletions
				
			
		|  | @ -54,6 +54,7 @@ void CSVWorld::ScriptSubView::updateDeletedState() | ||||||
|     if (isDeleted()) |     if (isDeleted()) | ||||||
|     { |     { | ||||||
|         mErrors->clear(); |         mErrors->clear(); | ||||||
|  |         adjustSplitter(); | ||||||
|         mEditor->setEnabled (false); |         mEditor->setEnabled (false); | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|  | @ -63,6 +64,22 @@ void CSVWorld::ScriptSubView::updateDeletedState() | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void CSVWorld::ScriptSubView::adjustSplitter() | ||||||
|  | { | ||||||
|  |     QList<int> sizes; | ||||||
|  | 
 | ||||||
|  |     if (mErrors->rowCount()) | ||||||
|  |     { | ||||||
|  |         sizes << 1 << 1; | ||||||
|  |     } | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |         sizes << 1 << 0; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     mMain->setSizes (sizes); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) | CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) | ||||||
| : SubView (id), mDocument (document), mColumn (-1), mBottom(0), mButtons (0), | : SubView (id), mDocument (document), mColumn (-1), mBottom(0), mButtons (0), | ||||||
|   mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType())) |   mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType())) | ||||||
|  | @ -347,4 +364,6 @@ void CSVWorld::ScriptSubView::updateRequest() | ||||||
|     QString source = mModel->data (index).toString(); |     QString source = mModel->data (index).toString(); | ||||||
| 
 | 
 | ||||||
|     mErrors->update (source.toUtf8().constData()); |     mErrors->update (source.toUtf8().constData()); | ||||||
|  | 
 | ||||||
|  |     adjustSplitter(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -58,6 +58,8 @@ namespace CSVWorld | ||||||
| 
 | 
 | ||||||
|             void updateDeletedState(); |             void updateDeletedState(); | ||||||
| 
 | 
 | ||||||
|  |             void adjustSplitter(); | ||||||
|  | 
 | ||||||
|         public: |         public: | ||||||
| 
 | 
 | ||||||
|             ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document); |             ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue