mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:12:43 +00:00 
			
		
		
		
	Browser: Allow jumping to stylenames by typing in the inspector
This adds the default behavior of search and highlighting of abstractView to the inspectorWidget. Search results are based on the titles in the first columns.
This commit is contained in:
		
							parent
							
								
									e5e621a63f
								
							
						
					
					
						commit
						044be82567
					
				
					 3 changed files with 22 additions and 0 deletions
				
			
		|  | @ -56,4 +56,21 @@ GUI::Variant StylePropertiesModel::data(GUI::ModelIndex const& index, GUI::Model | |||
|     return {}; | ||||
| } | ||||
| 
 | ||||
| Vector<GUI::ModelIndex> StylePropertiesModel::matches(StringView searching, unsigned flags, GUI::ModelIndex const& parent) | ||||
| { | ||||
|     if (m_values.is_empty()) | ||||
|         return {}; | ||||
|     Vector<GUI::ModelIndex> found_indices; | ||||
|     for (auto it = m_values.begin(); !it.is_end(); ++it) { | ||||
|         GUI::ModelIndex index = this->index(it.index(), Column::PropertyName, parent); | ||||
|         if (!string_matches(data(index, GUI::ModelRole::Display).as_string(), searching, flags)) | ||||
|             continue; | ||||
| 
 | ||||
|         found_indices.append(index); | ||||
|         if (flags & FirstMatchOnly) | ||||
|             break; | ||||
|     } | ||||
|     return found_indices; | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vrins
						Vrins